-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add list commands * Add list item commands && update castle required files * update specs and add list_item/count and list/all commands * Add list & list_item apis and tests * Add client actions for list and list item apis * Pluralize list & list item namespaces and add client specs for added actions * Rename lists/all to lists/get_all * Update lib/castle/client_actions/list_items.rb Co-authored-by: Igor Pstyga <[email protected]> * update client action calls to have option signature of apis called --------- Co-authored-by: Igor Pstyga <[email protected]>
- Loading branch information
Showing
59 changed files
with
1,292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Archive | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Archive.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Count | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Count.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Create | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Create.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Get | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Get.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Query | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Query.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Unarchive | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Unarchive.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module ListItems | ||
module Update | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::ListItems::Update.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module Lists | ||
module Create | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::Lists::Create.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module Lists | ||
module Delete | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::Lists::Delete.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module Lists | ||
module Get | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::Lists::Get.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module Lists | ||
module GetAll | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::Lists::GetAll.build, {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module Lists | ||
module Query | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::Lists::Query.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Castle | ||
module API | ||
module Lists | ||
module Update | ||
class << self | ||
# @param options [Hash] | ||
# return [Hash] | ||
def call(options = {}) | ||
options = Castle::Utils::DeepSymbolizeKeys.call(options || {}) | ||
http = options.delete(:http) | ||
config = options.delete(:config) || Castle.config | ||
|
||
Castle::API.call(Castle::Commands::Lists::Update.build(options), {}, http, config) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# frozen_string_literal: true | ||
module Castle | ||
module ClientActions | ||
module ListItems | ||
def archive_list_item(options = {}) | ||
Castle::API::ListItems::Archive.call(options) | ||
end | ||
|
||
def count_list_items(options = {}) | ||
Castle::API::ListItems::Count.call(options) | ||
end | ||
|
||
def create_list_item(options = {}) | ||
Castle::API::ListItems::Create.call(options) | ||
end | ||
|
||
def get_list_item(options = {}) | ||
Castle::API::ListItems::Get.call(options) | ||
end | ||
|
||
def query_list_items(options = {}) | ||
Castle::API::ListItems::Query.call(options) | ||
end | ||
|
||
def unarchive_list_item(options) | ||
Castle::API::ListItems::Unarchive.call(options) | ||
end | ||
|
||
def update_list_item(options = {}) | ||
Castle::API::ListItems::Update.call(options) | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.