Class: MailchimpMarketing::AuthorizedAppsApi
- Inherits:
-
Object
- Object
- MailchimpMarketing::AuthorizedAppsApi
- Defined in:
- lib/MailchimpMarketing/api/authorized_apps_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get(app_id, opts = {}) ⇒ Object
Get authorized app info.
-
#initialize(api_client) ⇒ AuthorizedAppsApi
constructor
A new instance of AuthorizedAppsApi.
-
#list(opts = {}) ⇒ Object
List authorized apps.
Constructor Details
#initialize(api_client) ⇒ AuthorizedAppsApi
Returns a new instance of AuthorizedAppsApi.
19 20 21 |
# File 'lib/MailchimpMarketing/api/authorized_apps_api.rb', line 19 def initialize(api_client) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/MailchimpMarketing/api/authorized_apps_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#get(app_id, opts = {}) ⇒ Object
Get authorized app info
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/MailchimpMarketing/api/authorized_apps_api.rb', line 42 def get(app_id, opts = {}) fail ArgumentError, "Missing required param: 'app_id'" if app_id.nil? query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? post_body = nil local_var_path = '/authorized-apps/{app_id}'.sub('{' + 'app_id' + '}', app_id.to_s) data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end |
#list(opts = {}) ⇒ Object
List authorized apps
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/MailchimpMarketing/api/authorized_apps_api.rb', line 24 def list(opts = {}) fail ArgumentError, 'invalid value for "opts[:"count"]", must be smaller than or equal to 1000.' if !opts[:'count'].nil? && opts[:'count'] > 1000 query_params = {} query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].nil? query_params[:'exclude_fields'] = @api_client.build_collection_param(opts[:'exclude_fields'], :csv) if !opts[:'exclude_fields'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? post_body = nil local_var_path = '/authorized-apps' data = @api_client.call_api(:GET, local_var_path, :query_params => query_params, :body => post_body) return data end |