|
| 1 | +=begin |
| 2 | +#Datadog API V2 Collection |
| 3 | +
|
| 4 | +#Collection of all Datadog Public endpoints. |
| 5 | +
|
| 6 | +The version of the OpenAPI document: 1.0 |
| 7 | +Contact: support@datadoghq.com |
| 8 | +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator |
| 9 | +
|
| 10 | + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 11 | + This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 12 | + Copyright 2020-Present Datadog, Inc. |
| 13 | +
|
| 14 | +=end |
| 15 | + |
| 16 | +require 'cgi' |
| 17 | + |
| 18 | +module DatadogAPIClient::V2 |
| 19 | + class CloudAuthenticationAPI |
| 20 | + attr_accessor :api_client |
| 21 | + |
| 22 | + def initialize(api_client = DatadogAPIClient::APIClient.default) |
| 23 | + @api_client = api_client |
| 24 | + end |
| 25 | + |
| 26 | + # List AWS cloud authentication persona mappings. |
| 27 | + # |
| 28 | + # @see #list_aws_cloud_auth_persona_mappings_with_http_info |
| 29 | + def list_aws_cloud_auth_persona_mappings(opts = {}) |
| 30 | + data, _status_code, _headers = list_aws_cloud_auth_persona_mappings_with_http_info(opts) |
| 31 | + data |
| 32 | + end |
| 33 | + |
| 34 | + # List AWS cloud authentication persona mappings. |
| 35 | + # |
| 36 | + # List all AWS cloud authentication persona mappings. This endpoint retrieves all configured persona mappings that associate AWS IAM principals with Datadog users. |
| 37 | + # |
| 38 | + # @param opts [Hash] the optional parameters |
| 39 | + # @return [Array<(AWSCloudAuthPersonaMappingsResponse, Integer, Hash)>] AWSCloudAuthPersonaMappingsResponse data, response status code and response headers |
| 40 | + def list_aws_cloud_auth_persona_mappings_with_http_info(opts = {}) |
| 41 | + unstable_enabled = @api_client.config.unstable_operations["v2.list_aws_cloud_auth_persona_mappings".to_sym] |
| 42 | + if unstable_enabled |
| 43 | + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_aws_cloud_auth_persona_mappings") |
| 44 | + else |
| 45 | + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_aws_cloud_auth_persona_mappings")) |
| 46 | + end |
| 47 | + |
| 48 | + if @api_client.config.debugging |
| 49 | + @api_client.config.logger.debug 'Calling API: CloudAuthenticationAPI.list_aws_cloud_auth_persona_mappings ...' |
| 50 | + end |
| 51 | + # resource path |
| 52 | + local_var_path = '/api/v2/cloud_auth/aws/persona_mapping' |
| 53 | + |
| 54 | + # query parameters |
| 55 | + query_params = opts[:query_params] || {} |
| 56 | + |
| 57 | + # header parameters |
| 58 | + header_params = opts[:header_params] || {} |
| 59 | + # HTTP header 'Accept' (if needed) |
| 60 | + header_params['Accept'] = @api_client.select_header_accept(['application/json']) |
| 61 | + |
| 62 | + # form parameters |
| 63 | + form_params = opts[:form_params] || {} |
| 64 | + |
| 65 | + # http body (model) |
| 66 | + post_body = opts[:debug_body] |
| 67 | + |
| 68 | + # return_type |
| 69 | + return_type = opts[:debug_return_type] || 'AWSCloudAuthPersonaMappingsResponse' |
| 70 | + |
| 71 | + # auth_names |
| 72 | + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] |
| 73 | + |
| 74 | + new_options = opts.merge( |
| 75 | + :operation => :list_aws_cloud_auth_persona_mappings, |
| 76 | + :header_params => header_params, |
| 77 | + :query_params => query_params, |
| 78 | + :form_params => form_params, |
| 79 | + :body => post_body, |
| 80 | + :auth_names => auth_names, |
| 81 | + :return_type => return_type, |
| 82 | + :api_version => "V2" |
| 83 | + ) |
| 84 | + |
| 85 | + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) |
| 86 | + if @api_client.config.debugging |
| 87 | + @api_client.config.logger.debug "API called: CloudAuthenticationAPI#list_aws_cloud_auth_persona_mappings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" |
| 88 | + end |
| 89 | + return data, status_code, headers |
| 90 | + end |
| 91 | + end |
| 92 | +end |
0 commit comments