Class: StickyIoRestfulApiV2025731::AffiliatesController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb

Overview

AffiliatesController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#create_affiliate(body, domain, v2_ext) ⇒ ApiResponse

Create a new affiliate. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| ——– | ———– | ——- | ——— | ————————————————————— | | type_id | Required | - | Integer | The affiliate type ID (See type table above for specification). | | value | Required | - | String | The affiliate name (filter value). | | network | Optional | | String | The affiliate network name. | description here

Parameters:

  • body (CreateAffiliateRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb', line 204

def create_affiliate(body,
                     domain,
                     v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}affiliates',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#delete_affiliate(domain, v2_ext) ⇒ ApiResponse

Delete an existing affiliate.

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb', line 274

def delete_affiliate(domain,
                     v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}affiliates/1',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_affiliate_types(domain, v2_ext) ⇒ ApiResponse

Fetch a list of affiliate type objects. **Response Data**\ Response parameters expected in each affiliate type object contained within the ‘data` field array: | Field | Data Type | Description | | —— | ———— | ——————————— | | id | Integer | The affiliate type ID. | | active | Integer Flag | The affiliate type active status. | | name | String | The affiliate type full name. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb', line 21

def get_affiliate_types(domain,
                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}affiliate-types',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_affiliates(domain, v2_ext) ⇒ ApiResponse

Fetch a list of affiliates. **Response Data**\ Response parameters expected in each affiliate object contained within the ‘data` field array: | Field | Data Type | Description

|

| —————————————— | ———— | ————————————————- | | id | Integer | The affiliate ID.

|

| type_id | Integer | The affiliate type ID (See type table above for specification). | | value | String | The affiliate name (filter value). | | network | String | The affiliate network name.

|

| created_by | Integer | The user ID that created the affiliate. | | updated_by | Integer | The user ID that last updated the affiliate. | | created_at | String | A timestamp that represents when the affiliate was created. | | updated_at | String | A timestamp that represents when the affiliate was last updated. | | type | Object | An object representing the affiliate type. | | type.id | Integer | The affiliate type ID.

|

| type.name | String | The affiliate type name.

|

| type.active | Integer Flag | The affiliate type active status. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb', line 76

def get_affiliates(domain,
                   v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}affiliates',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#get_one_affiliate(domain, v2_ext) ⇒ ApiResponse

Fetch a specific affiliate object by ID. **Response Data**\ Response parameters expected in each affiliate object contained within the ‘data` field array: | Field | Data Type | Description

|

| ———————————- | ———— |


  • |

| id | Integer | The affiliate ID.

|

| type_id | Integer | The affiliate type ID (See type table above). | | value | String | The affiliate name (filter value). | | network | String | The affiliate network name. | | created_by | Integer | The user ID that created the affiliate. | | updated_by | Integer | The user ID that last updated the affiliate. | | created_at | String | A timestamp that represents when the affiliate was created. | | updated_at | String | A timestamp that represents when the affiliate was last updated. | | type | Object | An object representing the affiliate type. | | type.id | Integer | The affiliate type ID. | | type.name | String | The affiliate type name. | | type.active | Integer Flag | The affiliate type active status. | | users | Array | An array of user objects. | | users.*.department_id | Integer | The user’s department ID. | | users.*.timezone | String | The user’s timezone.

|

| users.*.id | Integer | The user ID.

|

| users.*.is_active | Integer Flag | The user active status. | | users.*.name | String | The user full name.

|

| users.*.email | String | The user email address. | | permissions | Array | An array of affiliate permission objects. | | permissions.*.id | Integer | The affiliate permission ID. | | permissions.*.user_id | Integer | The trial workflow unit ID. | | permissions.*.affiliate_id | Integer | The affiliate ID associated with the permission. | | permissions.*.access_type_id | Integer | The access type (See type table above for specification). | | permissions.*.access_type_verbose | String | The access type name in all caps. | | permissions.*.created_by | Integer | The user ID that created the affiliate permission. | | permissions.*.updated_by | Integer | The user ID that last updated the affiliate permission. | | permissions.*.created_at | String | A timestamp that represents when the affiliate permission was created. | | permissions.*.updated_at | String | A timestamp that represents when the affiliate permission was last updated. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb', line 166

def get_one_affiliate(domain,
                      v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}affiliates/1',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_affiliate(body, domain, v2_ext) ⇒ ApiResponse

Update an existing affiliate. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| ——– | ———– | ——- | ——— | ————————————————————— | | type_id | Optional | - | Integer | The affiliate type ID (See type table above for specification). | | value | Optional | - | String | The affiliate name (filter value). | | network | Optional | - | String | The affiliate network name. | description here

Parameters:

  • body (UpdateAffiliateRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/sticky_io_restful_api_v2025731/controllers/affiliates_controller.rb', line 246

def update_affiliate(body,
                     domain,
                     v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}affiliates/1',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end