Class: IbmCloudIam::ServiceIDGroupsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ibm_cloud_iam/api/service_id_groups_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ServiceIDGroupsApi

Returns a new instance of ServiceIDGroupsApi.



19
20
21
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_service_id_group(authorization, create_service_id_group_request, opts = {}) ⇒ ServiceIdGroup

Create a service ID group Creates a service ID group for the given account ID

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • create_service_id_group_request (CreateServiceIdGroupRequest)

    Request to create a service ID Group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 28

def create_service_id_group(authorization, create_service_id_group_request, opts = {})
  data, _status_code, _headers = create_service_id_group_with_http_info(authorization, create_service_id_group_request, opts)
  data
end

#create_service_id_group_with_http_info(authorization, create_service_id_group_request, opts = {}) ⇒ Array<(ServiceIdGroup, Integer, Hash)>

Create a service ID group Creates a service ID group for the given account ID

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • create_service_id_group_request (CreateServiceIdGroupRequest)

    Request to create a service ID Group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ServiceIdGroup, Integer, Hash)>)

    ServiceIdGroup data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 39

def create_service_id_group_with_http_info(authorization, create_service_id_group_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDGroupsApi.create_service_id_group ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDGroupsApi.create_service_id_group"
  end
  # verify the required parameter 'create_service_id_group_request' is set
  if @api_client.config.client_side_validation && create_service_id_group_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_service_id_group_request' when calling ServiceIDGroupsApi.create_service_id_group"
  end
  # resource path
  local_var_path = '/v1/serviceid_groups'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_service_id_group_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceIdGroup'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDGroupsApi.create_service_id_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceIDGroupsApi#create_service_id_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_service_id_group(id, authorization, opts = {}) ⇒ nil

Delete a service ID group Delete a service ID group.

Parameters:

  • id (String)

    Unique ID of the service ID group.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


103
104
105
106
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 103

def delete_service_id_group(id, authorization, opts = {})
  delete_service_id_group_with_http_info(id, authorization, opts)
  nil
end

#delete_service_id_group_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a service ID group Delete a service ID group.

Parameters:

  • id (String)

    Unique ID of the service ID group.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 114

def delete_service_id_group_with_http_info(id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDGroupsApi.delete_service_id_group ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ServiceIDGroupsApi.delete_service_id_group"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDGroupsApi.delete_service_id_group"
  end
  # resource path
  local_var_path = '/v1/serviceid_groups/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDGroupsApi.delete_service_id_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceIDGroupsApi#delete_service_id_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_service_id_group(id, authorization, opts = {}) ⇒ ServiceIdGroup

Get details of a service ID group Returns the details of a service ID group.

Parameters:

  • id (String)

    Unique ID of the service ID group.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



173
174
175
176
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 173

def get_service_id_group(id, authorization, opts = {})
  data, _status_code, _headers = get_service_id_group_with_http_info(id, authorization, opts)
  data
end

#get_service_id_group_with_http_info(id, authorization, opts = {}) ⇒ Array<(ServiceIdGroup, Integer, Hash)>

Get details of a service ID group Returns the details of a service ID group.

Parameters:

  • id (String)

    Unique ID of the service ID group.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ServiceIdGroup, Integer, Hash)>)

    ServiceIdGroup data, response status code and response headers



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 184

def get_service_id_group_with_http_info(id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDGroupsApi.get_service_id_group ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ServiceIDGroupsApi.get_service_id_group"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDGroupsApi.get_service_id_group"
  end
  # resource path
  local_var_path = '/v1/serviceid_groups/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceIdGroup'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDGroupsApi.get_service_id_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceIDGroupsApi#get_service_id_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_service_id_group(authorization, opts = {}) ⇒ ServiceIdGroupList

List service ID groups Returns a list of all service ID groups for the given account ID

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Account ID of the service ID groups to query

Returns:



243
244
245
246
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 243

def list_service_id_group(authorization, opts = {})
  data, _status_code, _headers = list_service_id_group_with_http_info(authorization, opts)
  data
end

#list_service_id_group_with_http_info(authorization, opts = {}) ⇒ Array<(ServiceIdGroupList, Integer, Hash)>

List service ID groups Returns a list of all service ID groups for the given account ID

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Account ID of the service ID groups to query

Returns:

  • (Array<(ServiceIdGroupList, Integer, Hash)>)

    ServiceIdGroupList data, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 254

def list_service_id_group_with_http_info(authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDGroupsApi.list_service_id_group ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDGroupsApi.list_service_id_group"
  end
  # resource path
  local_var_path = '/v1/serviceid_groups'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceIdGroupList'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDGroupsApi.list_service_id_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceIDGroupsApi#list_service_id_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_service_id_group(id, if_match, authorization, update_service_id_group_request, opts = {}) ⇒ ServiceIdGroup

Update a service ID group Update a service ID group

Parameters:

  • id (String)

    Unique ID of the service ID group to be updated.

  • if_match (String)

    Version of the service ID gorup to be updated. Specify the version that you retrieved when reading service ID group. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • update_service_id_group_request (UpdateServiceIdGroupRequest)

    Request to update service ID group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



312
313
314
315
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 312

def update_service_id_group(id, if_match, authorization, update_service_id_group_request, opts = {})
  data, _status_code, _headers = update_service_id_group_with_http_info(id, if_match, authorization, update_service_id_group_request, opts)
  data
end

#update_service_id_group_with_http_info(id, if_match, authorization, update_service_id_group_request, opts = {}) ⇒ Array<(ServiceIdGroup, Integer, Hash)>

Update a service ID group Update a service ID group

Parameters:

  • id (String)

    Unique ID of the service ID group to be updated.

  • if_match (String)

    Version of the service ID gorup to be updated. Specify the version that you retrieved when reading service ID group. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • update_service_id_group_request (UpdateServiceIdGroupRequest)

    Request to update service ID group.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ServiceIdGroup, Integer, Hash)>)

    ServiceIdGroup data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/ibm_cloud_iam/api/service_id_groups_api.rb', line 325

def update_service_id_group_with_http_info(id, if_match, authorization, update_service_id_group_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDGroupsApi.update_service_id_group ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ServiceIDGroupsApi.update_service_id_group"
  end
  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling ServiceIDGroupsApi.update_service_id_group"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDGroupsApi.update_service_id_group"
  end
  # verify the required parameter 'update_service_id_group_request' is set
  if @api_client.config.client_side_validation && update_service_id_group_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_service_id_group_request' when calling ServiceIDGroupsApi.update_service_id_group"
  end
  # resource path
  local_var_path = '/v1/serviceid_groups/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'Authorization'] = authorization

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_service_id_group_request)

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceIdGroup'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDGroupsApi.update_service_id_group",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceIDGroupsApi#update_service_id_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end