Class: IbmCloudIam::IdentityPreferencesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ IdentityPreferencesApi

Returns a new instance of IdentityPreferencesApi.



19
20
21
# File 'lib/ibm_cloud_iam/api/identity_preferences_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/identity_preferences_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_preferences_on_scope_account(account_id, iam_id, service, preference_id, opts = {}) ⇒ nil

Delete Identity Preference on scope account Delete one Identity Preference on scope account. For details about the preferences supported and how the method request is authorized, refer to the description of operation Update Identity Preference on scope account.

Parameters:

  • account_id (String)

    Account id to delete preference for

  • iam_id (String)

    IAM id to delete the preference for

  • service (String)

    Service of the preference to be deleted

  • preference_id (String)

    Identifier of preference to be deleted

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

    the optional parameters

Options Hash (opts):

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

Returns:

  • (nil)


31
32
33
34
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 31

def (, iam_id, service, preference_id, opts = {})
  (, iam_id, service, preference_id, opts)
  nil
end

#delete_preferences_on_scope_account_with_http_info(account_id, iam_id, service, preference_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Identity Preference on scope account Delete one Identity Preference on scope `account`. For details about the preferences supported and how the method request is authorized, refer to the description of operation `Update Identity Preference on scope account`.

Parameters:

  • account_id (String)

    Account id to delete preference for

  • iam_id (String)

    IAM id to delete the preference for

  • service (String)

    Service of the preference to be deleted

  • preference_id (String)

    Identifier of preference to be deleted

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

    the optional parameters

Options Hash (opts):

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

Returns:

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

    nil, response status code and response headers



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
96
97
98
99
100
101
102
103
104
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 45

def (, iam_id, service, preference_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityPreferencesApi.delete_preferences_on_scope_account ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling IdentityPreferencesApi.delete_preferences_on_scope_account"
  end
  # verify the required parameter 'iam_id' is set
  if @api_client.config.client_side_validation && iam_id.nil?
    fail ArgumentError, "Missing the required parameter 'iam_id' when calling IdentityPreferencesApi.delete_preferences_on_scope_account"
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling IdentityPreferencesApi.delete_preferences_on_scope_account"
  end
  # verify the required parameter 'preference_id' is set
  if @api_client.config.client_side_validation && preference_id.nil?
    fail ArgumentError, "Missing the required parameter 'preference_id' when calling IdentityPreferencesApi.delete_preferences_on_scope_account"
  end
  # resource path
  local_var_path = '/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}'.sub('{account_id}', CGI.escape(.to_s)).sub('{iam_id}', CGI.escape(iam_id.to_s)).sub('{service}', CGI.escape(service.to_s)).sub('{preference_id}', CGI.escape(preference_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'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # 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 => :"IdentityPreferencesApi.delete_preferences_on_scope_account",
    :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: IdentityPreferencesApi#delete_preferences_on_scope_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_all_preferences_on_scope_account(account_id, iam_id, opts = {}) ⇒ IdentityPreferencesResponse

Get all Identity Preferences on scope account Get all Identity Preferences for one account / identity combination. For details about the preferences supported and how the method request is authorized, refer to the description of operation Get Identity Preference on scope account. If you are not allowed to read a preference, the call will not fail. Instead, this preference is/ these preferences are not returned in the list call.

Parameters:

  • account_id (String)

    Account id to get preferences for

  • iam_id (String)

    IAM id to get the preferences for

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

    the optional parameters

Options Hash (opts):

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

Returns:



113
114
115
116
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 113

def (, iam_id, opts = {})
  data, _status_code, _headers = (, iam_id, opts)
  data
end

#get_all_preferences_on_scope_account_with_http_info(account_id, iam_id, opts = {}) ⇒ Array<(IdentityPreferencesResponse, Integer, Hash)>

Get all Identity Preferences on scope account Get all Identity Preferences for one account / identity combination. For details about the preferences supported and how the method request is authorized, refer to the description of operation `Get Identity Preference on scope account`. If you are not allowed to read a preference, the call will not fail. Instead, this preference is/ these preferences are not returned in the list call.

Parameters:

  • account_id (String)

    Account id to get preferences for

  • iam_id (String)

    IAM id to get the preferences for

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

    the optional parameters

Options Hash (opts):

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

Returns:

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

    IdentityPreferencesResponse data, response status code and response headers



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
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 125

def (, iam_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityPreferencesApi.get_all_preferences_on_scope_account ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling IdentityPreferencesApi.get_all_preferences_on_scope_account"
  end
  # verify the required parameter 'iam_id' is set
  if @api_client.config.client_side_validation && iam_id.nil?
    fail ArgumentError, "Missing the required parameter 'iam_id' when calling IdentityPreferencesApi.get_all_preferences_on_scope_account"
  end
  # resource path
  local_var_path = '/v1/preferences/accounts/{account_id}/identities/{iam_id}'.sub('{account_id}', CGI.escape(.to_s)).sub('{iam_id}', CGI.escape(iam_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'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"IdentityPreferencesApi.get_all_preferences_on_scope_account",
    :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: IdentityPreferencesApi#get_all_preferences_on_scope_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_preferences_on_scope_account(account_id, iam_id, service, preference_id, opts = {}) ⇒ IdentityPreferenceResponse

Get Identity Preference on scope account Get one Identity Preference on scope account. For details about the preferences supported, refer to the description of operation Update Identity Preference on scope account. ### Authorization To call this method for the identity type Trusted Profile, one of the following conditions must be true: - the Authorization token represents the trusted profile which is addressed by this request - you must be assigned one or more IAM access roles that include the following action on the target resource account and resource type preferences: - iam-identity.preferences.update By default, the Administrator role on service iam-identity contains this action. - Services inside the IBM Cloud Console can call this method.

Parameters:

  • account_id (String)

    Account id to get preference for

  • iam_id (String)

    IAM id to get the preference for

  • service (String)

    Service of the preference to be fetched

  • preference_id (String)

    Identifier of preference to be fetched

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

    the optional parameters

Options Hash (opts):

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

Returns:



187
188
189
190
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 187

def (, iam_id, service, preference_id, opts = {})
  data, _status_code, _headers = (, iam_id, service, preference_id, opts)
  data
end

#get_preferences_on_scope_account_with_http_info(account_id, iam_id, service, preference_id, opts = {}) ⇒ Array<(IdentityPreferenceResponse, Integer, Hash)>

Get Identity Preference on scope account Get one Identity Preference on scope `account`. For details about the preferences supported, refer to the description of operation `Update Identity Preference on scope account`. ### Authorization To call this method for the identity type `Trusted Profile`, one of the following conditions must be true: - the Authorization token represents the trusted profile which is addressed by this request - you must be assigned one or more IAM access roles that include the following action on the target resource `account` and resource type `preferences`: - iam-identity.preferences.update By default, the `Administrator` role on service `iam-identity` contains this action. - Services inside the IBM Cloud Console can call this method.

Parameters:

  • account_id (String)

    Account id to get preference for

  • iam_id (String)

    IAM id to get the preference for

  • service (String)

    Service of the preference to be fetched

  • preference_id (String)

    Identifier of preference to be fetched

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

    the optional parameters

Options Hash (opts):

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

Returns:

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

    IdentityPreferenceResponse data, response status code and response headers



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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 201

def (, iam_id, service, preference_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityPreferencesApi.get_preferences_on_scope_account ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling IdentityPreferencesApi.get_preferences_on_scope_account"
  end
  # verify the required parameter 'iam_id' is set
  if @api_client.config.client_side_validation && iam_id.nil?
    fail ArgumentError, "Missing the required parameter 'iam_id' when calling IdentityPreferencesApi.get_preferences_on_scope_account"
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling IdentityPreferencesApi.get_preferences_on_scope_account"
  end
  # verify the required parameter 'preference_id' is set
  if @api_client.config.client_side_validation && preference_id.nil?
    fail ArgumentError, "Missing the required parameter 'preference_id' when calling IdentityPreferencesApi.get_preferences_on_scope_account"
  end
  # resource path
  local_var_path = '/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}'.sub('{account_id}', CGI.escape(.to_s)).sub('{iam_id}', CGI.escape(iam_id.to_s)).sub('{service}', CGI.escape(service.to_s)).sub('{preference_id}', CGI.escape(preference_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'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"IdentityPreferencesApi.get_preferences_on_scope_account",
    :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: IdentityPreferencesApi#get_preferences_on_scope_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_preference_on_scope_account(account_id, iam_id, service, preference_id, update_preference_request, opts = {}) ⇒ IdentityPreferenceResponse

Update Identity Preference on scope account Update one Identity Preference on scope account. The following preferences are storing values for identities inside an account, i.e. for each account that an identity is member of, the value stored might be different. This means, users who might be member of multiple accounts can have multiple preferences, one per account. Identities like Service Ids or Trusted Profiles can only exist in one account, therefore they can only have one preference inside their related account. ### Preferences - console/landing_page service: console preference_id: landing_page supported identity types: Trusted Profile type: string validation: valid path for the IBM Cloud Console (without host part), e.g. /billing or /iam - console/global_left_navigation service: console preference_id: global_left_navigation supported identity types: Trusted Profile type: list of strings validation: each entry in the list of strings must match the identifier of one navigation entry in the console; these identifiers are defined and interpreted by the IBM Cloud Console; currently the following entries are supported: slash,projects,rex,containers,databases,is,logmet,automation,complianceAndSecurity,apis,cp4d,partner-center,sap,satellite,vmWare,watsonx ### Authorization To call this method for the identity type Trusted Profile, you must be assigned one or more IAM access roles that include the following action on the target resource account and resource type preferences: - iam-identity.preferences.update By default, the Administrator role on service iam-identity contains this action.

Parameters:

  • account_id (String)

    Account id to update preference for

  • iam_id (String)

    IAM id to update the preference for

  • service (String)

    Service of the preference to be updated

  • preference_id (String)

    Identifier of preference to be updated

  • update_preference_request (UpdatePreferenceRequest)

    Request to update one identity preference on scope 'acount'.

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

    the optional parameters

Options Hash (opts):

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

Returns:



272
273
274
275
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 272

def (, iam_id, service, preference_id, update_preference_request, opts = {})
  data, _status_code, _headers = (, iam_id, service, preference_id, update_preference_request, opts)
  data
end

#update_preference_on_scope_account_with_http_info(account_id, iam_id, service, preference_id, update_preference_request, opts = {}) ⇒ Array<(IdentityPreferenceResponse, Integer, Hash)>

Update Identity Preference on scope account Update one Identity Preference on scope `account`. The following preferences are storing values for identities inside an account, i.e. for each account that an identity is member of, the value stored might be different. This means, users who might be member of multiple accounts can have multiple preferences, one per account. Identities like Service Ids or Trusted Profiles can only exist in one account, therefore they can only have one preference inside their related account. ### Preferences - console/landing_page service: `console` preference_id: `landing_page` supported identity types: `Trusted Profile` type: `string` validation: valid path for the IBM Cloud Console (without host part), e.g. `/billing` or `/iam` - console/global_left_navigation service: `console` preference_id: `global_left_navigation` supported identity types: `Trusted Profile` type: `list of strings` validation: each entry in the list of strings must match the identifier of one navigation entry in the console; these identifiers are defined and interpreted by the IBM Cloud Console; currently the following entries are supported: `slash,projects,rex,containers,databases,is,logmet,automation,complianceAndSecurity,apis,cp4d,partner-center,sap,satellite,vmWare,watsonx` ### Authorization To call this method for the identity type `Trusted Profile`, you must be assigned one or more IAM access roles that include the following action on the target resource `account` and resource type `preferences`: - iam-identity.preferences.update By default, the `Administrator` role on service `iam-identity` contains this action.

Parameters:

  • account_id (String)

    Account id to update preference for

  • iam_id (String)

    IAM id to update the preference for

  • service (String)

    Service of the preference to be updated

  • preference_id (String)

    Identifier of preference to be updated

  • update_preference_request (UpdatePreferenceRequest)

    Request to update one identity preference on scope 'acount'.

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

    the optional parameters

Options Hash (opts):

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

Returns:

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

    IdentityPreferenceResponse data, response status code and response headers



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
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
# File 'lib/ibm_cloud_iam/api/identity_preferences_api.rb', line 287

def (, iam_id, service, preference_id, update_preference_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityPreferencesApi.update_preference_on_scope_account ...'
  end
  # verify the required parameter 'account_id' is set
  if @api_client.config.client_side_validation && .nil?
    fail ArgumentError, "Missing the required parameter 'account_id' when calling IdentityPreferencesApi.update_preference_on_scope_account"
  end
  # verify the required parameter 'iam_id' is set
  if @api_client.config.client_side_validation && iam_id.nil?
    fail ArgumentError, "Missing the required parameter 'iam_id' when calling IdentityPreferencesApi.update_preference_on_scope_account"
  end
  # verify the required parameter 'service' is set
  if @api_client.config.client_side_validation && service.nil?
    fail ArgumentError, "Missing the required parameter 'service' when calling IdentityPreferencesApi.update_preference_on_scope_account"
  end
  # verify the required parameter 'preference_id' is set
  if @api_client.config.client_side_validation && preference_id.nil?
    fail ArgumentError, "Missing the required parameter 'preference_id' when calling IdentityPreferencesApi.update_preference_on_scope_account"
  end
  # verify the required parameter 'update_preference_request' is set
  if @api_client.config.client_side_validation && update_preference_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_preference_request' when calling IdentityPreferencesApi.update_preference_on_scope_account"
  end
  # resource path
  local_var_path = '/v1/preferences/accounts/{account_id}/identities/{iam_id}/{service}/{preference_id}'.sub('{account_id}', CGI.escape(.to_s)).sub('{iam_id}', CGI.escape(iam_id.to_s)).sub('{service}', CGI.escape(service.to_s)).sub('{preference_id}', CGI.escape(preference_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[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

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

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

  new_options = opts.merge(
    :operation => :"IdentityPreferencesApi.update_preference_on_scope_account",
    :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: IdentityPreferencesApi#update_preference_on_scope_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end