Class: StickyIoRestfulApiV2025731::PermissionsController

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

Overview

PermissionsController

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

#clear_user_affiliate_permissions(domain, v2_ext) ⇒ ApiResponse

Completely remove affiliate permissions from a platform user.

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.



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/sticky_io_restful_api_v2025731/controllers/permissions_controller.rb', line 288

def clear_user_affiliate_permissions(domain,
                                     v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}affiliate-permissions/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_user_affiliate_permissions(domain, v2_ext) ⇒ ApiResponse

Fetch a list of all affiliate permission objects associated with a platform user. **Response Data**\ Response parameters expected in each affiliate permission object contained within the ‘data` field array: | Field | Data Type | Description

|

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


  • |

| id | Integer | The affiliate permission ID.

|

| user_id | Integer | The user associated with the affiliate permission ID. | | affiliate_id | Integer | The affiliate ID associated with the permission. | | access_type_id | Integer | The access type (See type table above for specification). | | access_type_verbose | String | The access type name in all caps.

|

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

|

| user.department_id | Integer | The user’s department ID.

|

| user.timezone | String | The user’s timezone.

|

| user.id | Integer | The user ID.

|

| user.is_active | Integer Flag | The user active status.

|

| user.name | String | The user full name.

|

| user.email | String | The user email address.

|

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.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/sticky_io_restful_api_v2025731/controllers/permissions_controller.rb', line 54

def get_user_affiliate_permissions(domain,
                                   v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}affiliate-permissions/1/all',
                                 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_user_granted_affiliate_permissions(domain, v2_ext) ⇒ ApiResponse

Fetch a list of ‘whitelist` type affiliate permission objects associated with a platform user. **Response Data**\ Response parameters expected in each affiliate permission object contained within the `data` field array: | Field | Data Type | Description

|

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


  • |

| id | Integer | The affiliate permission ID.

|

| user_id | Integer | The user associated with the affiliate permission ID. | | affiliate_id | Integer | The affiliate ID associated with the permission. | | access_type_id | Integer | The access type (See type table above for specification). | | access_type_verbose | String | The access type name in all caps.

|

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

|

| user.department_id | Integer | The user’s department ID.

|

| user.timezone | String | The user’s timezone.

|

| user.id | Integer | The user ID.

|

| user.is_active | Integer Flag | The user active status.

|

| user.name | String | The user full name.

|

| user.email | String | The user email address.

|

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.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/sticky_io_restful_api_v2025731/controllers/permissions_controller.rb', line 119

def get_user_granted_affiliate_permissions(domain,
                                           v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}affiliate-permissions/1/granted',
                                 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_user_revoked_affiliate_permissions(domain, v2_ext) ⇒ ApiResponse

Fetch a list of ‘blacklist` type affiliate permission objects associated with a platform user. **Response Data**\ Response parameters expected in each affiliate permission object contained within the `data` field array: | Field | Data Type | Description

|

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


  • |

| id | Integer | The affiliate permission ID.

|

| user_id | Integer | The user associated with the affiliate permission ID. | | affiliate_id | Integer | The affiliate ID associated with the permission. | | access_type_id | Integer | The access type (See type table above for specification). | | access_type_verbose | String | The access type name in all caps.

|

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

|

| user.department_id | Integer | The user’s department ID.

|

| user.timezone | String | The user’s timezone.

|

| user.id | Integer | The user ID.

|

| user.is_active | Integer Flag | The user active status.

|

| user.name | String | The user full name.

|

| user.email | String | The user email address.

|

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.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/sticky_io_restful_api_v2025731/controllers/permissions_controller.rb', line 184

def get_user_revoked_affiliate_permissions(domain,
                                           v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}affiliate-permissions/1/revoked',
                                 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

#grant_user_affiliate_permissions(body, domain, v2_ext) ⇒ ApiResponse

Associate ‘whitelist` type affiliate permissions to a platform user. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————- | ———– | ——- | ——— | ————————————————————– | | affiliates | Required | - | Array | Array of objects containing affiliate IDs. | | affiliates.*.id | Required | - | Integer | The affiliate ID that will be associated to the platform user. | TODO: type description here

Parameters:

  • body (GrantUserAffiliatePermissionsRequest)

    Required parameter:

  • 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.



220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/sticky_io_restful_api_v2025731/controllers/permissions_controller.rb', line 220

def grant_user_affiliate_permissions(body,
                                     domain,
                                     v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}affiliate-permissions/1/grant',
                                 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

#revoke_user_affiliate_permissions(body, domain, v2_ext) ⇒ ApiResponse

Associate ‘blacklist` type affiliate permissions to a platform user. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————- | ———– | ——- | ——— | ————————————————————– | | affiliates | Required | - | Array | Array of objects containing affiliate IDs. | | affiliates.*.id | Required | - | Integer | The affiliate ID that will be associated to the platform user. | TODO: type description here

Parameters:

  • body (RevokeUserAffiliatePermissionsRequest)

    Required parameter:

  • 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.



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/sticky_io_restful_api_v2025731/controllers/permissions_controller.rb', line 260

def revoke_user_affiliate_permissions(body,
                                      domain,
                                      v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}affiliate-permissions/1/grant',
                                 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