Class: DatadogAPIClient::V2::UserAuthorizedClientsAPI
- Inherits:
-
Object
- Object
- DatadogAPIClient::V2::UserAuthorizedClientsAPI
- Defined in:
- lib/datadog_api_client/v2/api/user_authorized_clients_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_user_authorized_client(user_authorized_client_id, opts = {}) ⇒ Object
Delete a user authorized client.
-
#delete_user_authorized_client_with_http_info(user_authorized_client_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a user authorized client.
-
#delete_user_authorized_clients_by_client(client_id, opts = {}) ⇒ Object
Delete all user authorized clients for a client.
-
#delete_user_authorized_clients_by_client_with_http_info(client_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete all user authorized clients for a client.
-
#get_user_authorized_client(user_authorized_client_id, opts = {}) ⇒ Object
Get a user authorized client.
-
#get_user_authorized_client_with_http_info(user_authorized_client_id, opts = {}) ⇒ Array<(UserAuthorizedClientResponse, Integer, Hash)>
Get a user authorized client.
-
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ UserAuthorizedClientsAPI
constructor
A new instance of UserAuthorizedClientsAPI.
-
#list_user_authorized_clients(opts = {}) ⇒ Object
List user authorized clients.
-
#list_user_authorized_clients_with_http_info(opts = {}) ⇒ Array<(UserAuthorizedClientsResponse, Integer, Hash)>
List user authorized clients.
-
#list_user_authorized_clients_with_pagination(opts = {}) {|UserAuthorizedClientData| ... } ⇒ Object
List user authorized clients.
Constructor Details
#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ UserAuthorizedClientsAPI
Returns a new instance of UserAuthorizedClientsAPI.
22 23 24 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 22 def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
20 21 22 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 20 def api_client @api_client end |
Instance Method Details
#delete_user_authorized_client(user_authorized_client_id, opts = {}) ⇒ Object
Delete a user authorized client.
29 30 31 32 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 29 def (, opts = {}) (, opts) nil end |
#delete_user_authorized_client_with_http_info(user_authorized_client_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete a user authorized client.
Disable the current user's authorization for the specified OAuth2 client.
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 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 41 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.delete_user_authorized_client ...' end # verify the required parameter 'user_authorized_client_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'user_authorized_client_id' when calling UserAuthorizedClientsAPI.delete_user_authorized_client" end # resource path local_var_path = '/api/v2/user_authorized_clients/{user_authorized_client_id}'.sub('{user_authorized_client_id}', CGI.escape(.to_s).gsub('%2F', '/')) # 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(['*/*']) # 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :delete_user_authorized_client, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#delete_user_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_user_authorized_clients_by_client(client_id, opts = {}) ⇒ Object
Delete all user authorized clients for a client.
94 95 96 97 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 94 def (client_id, opts = {}) (client_id, opts) nil end |
#delete_user_authorized_clients_by_client_with_http_info(client_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete all user authorized clients for a client.
Disable all authorizations the current user has granted to the specified OAuth2 client.
106 107 108 109 110 111 112 113 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 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 106 def (client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.delete_user_authorized_clients_by_client ...' end # verify the required parameter 'client_id' is set if @api_client.config.client_side_validation && client_id.nil? fail ArgumentError, "Missing the required parameter 'client_id' when calling UserAuthorizedClientsAPI.delete_user_authorized_clients_by_client" end # resource path local_var_path = '/api/v2/user_authorized_clients/client/{client_id}'.sub('{client_id}', CGI.escape(client_id.to_s).gsub('%2F', '/')) # 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(['*/*']) # 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] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :delete_user_authorized_clients_by_client, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#delete_user_authorized_clients_by_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_user_authorized_client(user_authorized_client_id, opts = {}) ⇒ Object
Get a user authorized client.
159 160 161 162 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 159 def (, opts = {}) data, _status_code, _headers = (, opts) data end |
#get_user_authorized_client_with_http_info(user_authorized_client_id, opts = {}) ⇒ Array<(UserAuthorizedClientResponse, Integer, Hash)>
Get a user authorized client.
Get a single OAuth2 client authorization for the current user.
171 172 173 174 175 176 177 178 179 180 181 182 183 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 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 171 def (, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.get_user_authorized_client ...' end # verify the required parameter 'user_authorized_client_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'user_authorized_client_id' when calling UserAuthorizedClientsAPI.get_user_authorized_client" end # resource path local_var_path = '/api/v2/user_authorized_clients/{user_authorized_client_id}'.sub('{user_authorized_client_id}', CGI.escape(.to_s).gsub('%2F', '/')) # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UserAuthorizedClientResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :get_user_authorized_client, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#get_user_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_user_authorized_clients(opts = {}) ⇒ Object
List user authorized clients.
224 225 226 227 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 224 def (opts = {}) data, _status_code, _headers = (opts) data end |
#list_user_authorized_clients_with_http_info(opts = {}) ⇒ Array<(UserAuthorizedClientsResponse, Integer, Hash)>
List user authorized clients.
Get a list of all OAuth2 clients authorized by the current user.
240 241 242 243 244 245 246 247 248 249 250 251 252 253 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 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 240 def (opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UserAuthorizedClientsAPI.list_user_authorized_clients ...' end # resource path local_var_path = '/api/v2/user_authorized_clients' # query parameters query_params = opts[:query_params] || {} query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'filter[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil? query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'UserAuthorizedClientsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] = opts.merge( :operation => :list_user_authorized_clients, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type, :api_version => "V2" ) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserAuthorizedClientsAPI#list_user_authorized_clients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_user_authorized_clients_with_pagination(opts = {}) {|UserAuthorizedClientData| ... } ⇒ Object
List user authorized clients.
Provide a paginated version of #list_user_authorized_clients, returning all items.
To use it you need to use a block: list_user_authorized_clients_with_pagination { |item| p item }
298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/datadog_api_client/v2/api/user_authorized_clients_api.rb', line 298 def (opts = {}) api_version = "V2" page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) while true do response = (opts) @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } if @api_client.get_attribute_from_path(response, "data").length < page_size break end @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) end end |