diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2c64bbd7a3fb..5d5c5b1803b5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12289,6 +12289,46 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateEventEmailAddressRequest: + properties: + data: + $ref: '#/components/schemas/CreateEventEmailAddressRequestData' + type: object + CreateEventEmailAddressRequestData: + properties: + attributes: + $ref: '#/components/schemas/CreateEventEmailAddressRequestDataAttributes' + type: + $ref: '#/components/schemas/EventEmailsType' + required: + - type + type: object + CreateEventEmailAddressRequestDataAttributes: + properties: + alert_type: + type: string + description: + type: string + format: + example: '' + type: string + notify_handles: + example: + - '' + items: + type: string + type: array + tags: + example: + - '' + items: + type: string + type: array + required: + - format + - notify_handles + - tags + type: object CreateIncidentNotificationRuleRequest: description: Create request for a notification rule. properties: @@ -12341,6 +12381,41 @@ components: - name - targets type: object + CreateOnCallEventEmailAddressRequest: + properties: + data: + $ref: '#/components/schemas/CreateOnCallEventEmailAddressRequestData' + type: object + CreateOnCallEventEmailAddressRequestData: + properties: + attributes: + $ref: '#/components/schemas/CreateOnCallEventEmailAddressRequestDataAttributes' + type: + $ref: '#/components/schemas/EventEmailsType' + required: + - type + type: object + CreateOnCallEventEmailAddressRequestDataAttributes: + properties: + alert_type: + type: string + description: + type: string + format: + example: '' + type: string + tags: + example: + - '' + items: + type: string + type: array + team_handle: + type: string + required: + - format + - tags + type: object CreateOpenAPIResponse: description: Response for `CreateOpenAPI` operation. properties: @@ -18701,6 +18776,112 @@ components: the default subdomain. type: string type: object + EventEmailAddressResponse: + properties: + data: + $ref: '#/components/schemas/EventEmailAddressResponseData' + type: object + EventEmailAddressResponseArray: + properties: + data: + items: + $ref: '#/components/schemas/EventEmailAddressResponseData' + type: array + required: + - data + type: object + EventEmailAddressResponseData: + properties: + attributes: + $ref: '#/components/schemas/EventEmailAddressResponseDataAttributes' + id: + example: '' + type: string + relationships: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationships' + type: + $ref: '#/components/schemas/EventEmailsType' + required: + - type + - id + type: object + EventEmailAddressResponseDataAttributes: + properties: + alert_type: + type: string + created_at: + example: '' + format: date-time + type: string + description: + type: string + email: + example: '' + type: string + format: + example: '' + type: string + last_used_at: + format: date-time + type: string + notify_handles: + example: + - '' + items: + type: string + type: array + revoked_at: + format: date-time + type: string + tags: + example: + - '' + items: + type: string + type: array + required: + - created_at + - email + - format + - notify_handles + - tags + type: object + EventEmailAddressResponseDataRelationships: + properties: + created_by: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationshipsUser' + revoked_by: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationshipsUser' + required: + - created_by + type: object + EventEmailAddressResponseDataRelationshipsUser: + properties: + data: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationshipsUserData' + required: + - data + type: object + EventEmailAddressResponseDataRelationshipsUserData: + properties: + id: + example: '' + type: string + type: + $ref: '#/components/schemas/UsersType' + required: + - type + - id + type: object + EventEmailsType: + default: event_emails + description: Event emails resource type. + enum: + - event_emails + example: event_emails + type: string + x-enum-varnames: + - EVENT_EMAILS EventPayload: additionalProperties: false description: Event attributes. @@ -61743,6 +61924,92 @@ paths: tags: - Events x-codegen-request-body-name: body + /api/v2/events/mail: + get: + operationId: ListEventEmailAddresses + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponseArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List event email addresses + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' + post: + operationId: CreateEventEmailAddress + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEventEmailAddressRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponse' + description: Created + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create event email address + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/events/mail/on-call: + get: + operationId: GetOnCallEventEmailAddress + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponseArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get on-call event email address + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' + post: + operationId: CreateOnCallEventEmailAddress + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOnCallEventEmailAddressRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponse' + description: Created + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create on-call event email address + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/events/search: post: description: 'List endpoint returns events that match an events search query. @@ -61771,6 +62038,9 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] summary: Search events tags: - Events diff --git a/examples/v2/events/CreateEventEmailAddress.rb b/examples/v2/events/CreateEventEmailAddress.rb new file mode 100644 index 000000000000..fb8740c84207 --- /dev/null +++ b/examples/v2/events/CreateEventEmailAddress.rb @@ -0,0 +1,23 @@ +# Create event email address returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_event_email_address".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EventsAPI.new + +body = DatadogAPIClient::V2::CreateEventEmailAddressRequest.new({ + data: DatadogAPIClient::V2::CreateEventEmailAddressRequestData.new({ + attributes: DatadogAPIClient::V2::CreateEventEmailAddressRequestDataAttributes.new({ + format: "", + notify_handles: [ + "", + ], + tags: [ + "", + ], + }), + type: DatadogAPIClient::V2::EventEmailsType::EVENT_EMAILS, + }), +}) +p api_instance.create_event_email_address(body) diff --git a/examples/v2/events/CreateOnCallEventEmailAddress.rb b/examples/v2/events/CreateOnCallEventEmailAddress.rb new file mode 100644 index 000000000000..2b05737d80f0 --- /dev/null +++ b/examples/v2/events/CreateOnCallEventEmailAddress.rb @@ -0,0 +1,20 @@ +# Create on-call event email address returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_on_call_event_email_address".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EventsAPI.new + +body = DatadogAPIClient::V2::CreateOnCallEventEmailAddressRequest.new({ + data: DatadogAPIClient::V2::CreateOnCallEventEmailAddressRequestData.new({ + attributes: DatadogAPIClient::V2::CreateOnCallEventEmailAddressRequestDataAttributes.new({ + format: "", + tags: [ + "", + ], + }), + type: DatadogAPIClient::V2::EventEmailsType::EVENT_EMAILS, + }), +}) +p api_instance.create_on_call_event_email_address(body) diff --git a/examples/v2/events/GetOnCallEventEmailAddress.rb b/examples/v2/events/GetOnCallEventEmailAddress.rb new file mode 100644 index 000000000000..221238e5ffa3 --- /dev/null +++ b/examples/v2/events/GetOnCallEventEmailAddress.rb @@ -0,0 +1,8 @@ +# Get on-call event email address returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_on_call_event_email_address".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EventsAPI.new +p api_instance.get_on_call_event_email_address() diff --git a/examples/v2/events/ListEventEmailAddresses.rb b/examples/v2/events/ListEventEmailAddresses.rb new file mode 100644 index 000000000000..a59679f83982 --- /dev/null +++ b/examples/v2/events/ListEventEmailAddresses.rb @@ -0,0 +1,8 @@ +# List event email addresses returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_event_email_addresses".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EventsAPI.new +p api_instance.list_event_email_addresses() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c3d2f43620e9..431b40eef730 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1920,6 +1920,12 @@ "v2.CreateEvent" => { "body" => "EventCreateRequestPayload", }, + "v2.CreateEventEmailAddress" => { + "body" => "CreateEventEmailAddressRequest", + }, + "v2.CreateOnCallEventEmailAddress" => { + "body" => "CreateOnCallEventEmailAddressRequest", + }, "v2.SearchEvents" => { "body" => "EventsListRequest", }, diff --git a/features/v2/events.feature b/features/v2/events.feature index 61d824ce1084..5d9436920628 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -17,6 +17,22 @@ Feature: Events And a valid "appKeyAuth" key in the system And an instance of "Events" API + @generated @skip @team:DataDog/event-management + Scenario: Create event email address returns "Created" response + Given operation "CreateEventEmailAddress" enabled + And new "CreateEventEmailAddress" request + And body with value {"data": {"attributes": {"format": "", "notify_handles": [""], "tags": [""]}, "type": "event_emails"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/event-management + Scenario: Create on-call event email address returns "Created" response + Given operation "CreateOnCallEventEmailAddress" enabled + And new "CreateOnCallEventEmailAddress" request + And body with value {"data": {"attributes": {"format": "", "tags": [""]}, "type": "event_emails"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/event-management Scenario: Get a list of events returns "Bad Request" response Given new "ListEvents" request @@ -71,6 +87,20 @@ Feature: Events When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/event-management + Scenario: Get on-call event email address returns "OK" response + Given operation "GetOnCallEventEmailAddress" enabled + And new "GetOnCallEventEmailAddress" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/event-management + Scenario: List event email addresses returns "OK" response + Given operation "ListEventEmailAddresses" enabled + And new "ListEventEmailAddresses" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request diff --git a/features/v2/undo.json b/features/v2/undo.json index bb35cea36c2e..e94d595ef210 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1380,6 +1380,34 @@ "type": "safe" } }, + "ListEventEmailAddresses": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "CreateEventEmailAddress": { + "tag": "Events", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetOnCallEventEmailAddress": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "CreateOnCallEventEmailAddress": { + "tag": "Events", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "SearchEvents": { "tag": "Events", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7978919a4967..b3358f03bb63 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -225,6 +225,10 @@ def initialize "v2.cancel_data_deletion_request": false, "v2.create_data_deletion_request": false, "v2.get_data_deletion_requests": false, + "v2.create_event_email_address": false, + "v2.create_on_call_event_email_address": false, + "v2.get_on_call_event_email_address": false, + "v2.list_event_email_addresses": false, "v2.create_incident": false, "v2.create_incident_impact": false, "v2.create_incident_integration": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5436fa6f85c3..4397ce6b47b3 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1627,11 +1627,17 @@ def overrides "v2.create_data_deletion_request_body_data" => "CreateDataDeletionRequestBodyData", "v2.create_data_deletion_request_body_data_type" => "CreateDataDeletionRequestBodyDataType", "v2.create_data_deletion_response_body" => "CreateDataDeletionResponseBody", + "v2.create_event_email_address_request" => "CreateEventEmailAddressRequest", + "v2.create_event_email_address_request_data" => "CreateEventEmailAddressRequestData", + "v2.create_event_email_address_request_data_attributes" => "CreateEventEmailAddressRequestDataAttributes", "v2.create_incident_notification_rule_request" => "CreateIncidentNotificationRuleRequest", "v2.create_incident_notification_template_request" => "CreateIncidentNotificationTemplateRequest", "v2.create_notification_rule_parameters" => "CreateNotificationRuleParameters", "v2.create_notification_rule_parameters_data" => "CreateNotificationRuleParametersData", "v2.create_notification_rule_parameters_data_attributes" => "CreateNotificationRuleParametersDataAttributes", + "v2.create_on_call_event_email_address_request" => "CreateOnCallEventEmailAddressRequest", + "v2.create_on_call_event_email_address_request_data" => "CreateOnCallEventEmailAddressRequestData", + "v2.create_on_call_event_email_address_request_data_attributes" => "CreateOnCallEventEmailAddressRequestDataAttributes", "v2.create_open_api_response" => "CreateOpenAPIResponse", "v2.create_open_api_response_attributes" => "CreateOpenAPIResponseAttributes", "v2.create_open_api_response_data" => "CreateOpenAPIResponseData", @@ -2036,6 +2042,14 @@ def overrides "v2.event_create_response_attributes_attributes_evt" => "EventCreateResponseAttributesAttributesEvt", "v2.event_create_response_payload" => "EventCreateResponsePayload", "v2.event_create_response_payload_links" => "EventCreateResponsePayloadLinks", + "v2.event_email_address_response" => "EventEmailAddressResponse", + "v2.event_email_address_response_array" => "EventEmailAddressResponseArray", + "v2.event_email_address_response_data" => "EventEmailAddressResponseData", + "v2.event_email_address_response_data_attributes" => "EventEmailAddressResponseDataAttributes", + "v2.event_email_address_response_data_relationships" => "EventEmailAddressResponseDataRelationships", + "v2.event_email_address_response_data_relationships_user" => "EventEmailAddressResponseDataRelationshipsUser", + "v2.event_email_address_response_data_relationships_user_data" => "EventEmailAddressResponseDataRelationshipsUserData", + "v2.event_emails_type" => "EventEmailsType", "v2.event_payload" => "EventPayload", "v2.event_payload_attributes" => "EventPayloadAttributes", "v2.event_payload_integration_id" => "EventPayloadIntegrationId", diff --git a/lib/datadog_api_client/v2/api/events_api.rb b/lib/datadog_api_client/v2/api/events_api.rb index 51478b6fc5c7..4b2fe521f9a3 100644 --- a/lib/datadog_api_client/v2/api/events_api.rb +++ b/lib/datadog_api_client/v2/api/events_api.rb @@ -98,6 +98,146 @@ def create_event_with_http_info(body, opts = {}) return data, status_code, headers end + # Create event email address. + # + # @see #create_event_email_address_with_http_info + def create_event_email_address(body, opts = {}) + data, _status_code, _headers = create_event_email_address_with_http_info(body, opts) + data + end + + # Create event email address. + # @param body [CreateEventEmailAddressRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(EventEmailAddressResponse, Integer, Hash)>] EventEmailAddressResponse data, response status code and response headers + def create_event_email_address_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_event_email_address".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_event_email_address") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_event_email_address")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsAPI.create_event_email_address ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EventsAPI.create_event_email_address" + end + # resource path + local_var_path = '/api/v2/events/mail' + + # 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']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'EventEmailAddressResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_event_email_address, + :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::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EventsAPI#create_event_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create on-call event email address. + # + # @see #create_on_call_event_email_address_with_http_info + def create_on_call_event_email_address(body, opts = {}) + data, _status_code, _headers = create_on_call_event_email_address_with_http_info(body, opts) + data + end + + # Create on-call event email address. + # @param body [CreateOnCallEventEmailAddressRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(EventEmailAddressResponse, Integer, Hash)>] EventEmailAddressResponse data, response status code and response headers + def create_on_call_event_email_address_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_on_call_event_email_address".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_on_call_event_email_address") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_on_call_event_email_address")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsAPI.create_on_call_event_email_address ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling EventsAPI.create_on_call_event_email_address" + end + # resource path + local_var_path = '/api/v2/events/mail/on-call' + + # 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']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'EventEmailAddressResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_on_call_event_email_address, + :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::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EventsAPI#create_on_call_event_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get an event. # # @see #get_event_with_http_info @@ -163,6 +303,132 @@ def get_event_with_http_info(event_id, opts = {}) return data, status_code, headers end + # Get on-call event email address. + # + # @see #get_on_call_event_email_address_with_http_info + def get_on_call_event_email_address(opts = {}) + data, _status_code, _headers = get_on_call_event_email_address_with_http_info(opts) + data + end + + # Get on-call event email address. + # @param opts [Hash] the optional parameters + # @return [Array<(EventEmailAddressResponseArray, Integer, Hash)>] EventEmailAddressResponseArray data, response status code and response headers + def get_on_call_event_email_address_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_on_call_event_email_address".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_on_call_event_email_address") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_on_call_event_email_address")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsAPI.get_on_call_event_email_address ...' + end + # resource path + local_var_path = '/api/v2/events/mail/on-call' + + # 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] || 'EventEmailAddressResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_on_call_event_email_address, + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EventsAPI#get_on_call_event_email_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List event email addresses. + # + # @see #list_event_email_addresses_with_http_info + def list_event_email_addresses(opts = {}) + data, _status_code, _headers = list_event_email_addresses_with_http_info(opts) + data + end + + # List event email addresses. + # @param opts [Hash] the optional parameters + # @return [Array<(EventEmailAddressResponseArray, Integer, Hash)>] EventEmailAddressResponseArray data, response status code and response headers + def list_event_email_addresses_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_event_email_addresses".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_event_email_addresses") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_event_email_addresses")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsAPI.list_event_email_addresses ...' + end + # resource path + local_var_path = '/api/v2/events/mail' + + # 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] || 'EventEmailAddressResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_event_email_addresses, + :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, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EventsAPI#list_event_email_addresses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a list of events. # # @see #list_events_with_http_info diff --git a/lib/datadog_api_client/v2/models/create_event_email_address_request.rb b/lib/datadog_api_client/v2/models/create_event_email_address_request.rb new file mode 100644 index 000000000000..c96c6b02735f --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_event_email_address_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CreateEventEmailAddressRequest + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateEventEmailAddressRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateEventEmailAddressRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_event_email_address_request_data.rb b/lib/datadog_api_client/v2/models/create_event_email_address_request_data.rb new file mode 100644 index 000000000000..1eed1d49ab02 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_event_email_address_request_data.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CreateEventEmailAddressRequestData + include BaseGenericModel + + # + attr_accessor :attributes + + # Event emails resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateEventEmailAddressRequestDataAttributes', + :'type' => :'EventEmailsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateEventEmailAddressRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_event_email_address_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_event_email_address_request_data_attributes.rb new file mode 100644 index 000000000000..f6bcd219b379 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_event_email_address_request_data_attributes.rb @@ -0,0 +1,189 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CreateEventEmailAddressRequestDataAttributes + include BaseGenericModel + + # + attr_accessor :alert_type + + # + attr_accessor :description + + # + attr_reader :format + + # + attr_reader :notify_handles + + # + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'alert_type' => :'alert_type', + :'description' => :'description', + :'format' => :'format', + :'notify_handles' => :'notify_handles', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'alert_type' => :'String', + :'description' => :'String', + :'format' => :'String', + :'notify_handles' => :'Array', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateEventEmailAddressRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'alert_type') + self.alert_type = attributes[:'alert_type'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'notify_handles') + if (value = attributes[:'notify_handles']).is_a?(Array) + self.notify_handles = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @format.nil? + return false if @notify_handles.nil? + return false if @tags.nil? + true + end + + # Custom attribute writer method with validation + # @param format [Object] Object to be assigned + # @!visibility private + def format=(format) + if format.nil? + fail ArgumentError, 'invalid value for "format", format cannot be nil.' + end + @format = format + end + + # Custom attribute writer method with validation + # @param notify_handles [Object] Object to be assigned + # @!visibility private + def notify_handles=(notify_handles) + if notify_handles.nil? + fail ArgumentError, 'invalid value for "notify_handles", notify_handles cannot be nil.' + end + @notify_handles = notify_handles + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + alert_type == o.alert_type && + description == o.description && + format == o.format && + notify_handles == o.notify_handles && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [alert_type, description, format, notify_handles, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request.rb b/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request.rb new file mode 100644 index 000000000000..7ebdc3170ef3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CreateOnCallEventEmailAddressRequest + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateOnCallEventEmailAddressRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateOnCallEventEmailAddressRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request_data.rb b/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request_data.rb new file mode 100644 index 000000000000..55fd5fce9209 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request_data.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CreateOnCallEventEmailAddressRequestData + include BaseGenericModel + + # + attr_accessor :attributes + + # Event emails resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateOnCallEventEmailAddressRequestDataAttributes', + :'type' => :'EventEmailsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateOnCallEventEmailAddressRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request_data_attributes.rb new file mode 100644 index 000000000000..ea82a2b44c56 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_on_call_event_email_address_request_data_attributes.rb @@ -0,0 +1,176 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CreateOnCallEventEmailAddressRequestDataAttributes + include BaseGenericModel + + # + attr_accessor :alert_type + + # + attr_accessor :description + + # + attr_reader :format + + # + attr_reader :tags + + # + attr_accessor :team_handle + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'alert_type' => :'alert_type', + :'description' => :'description', + :'format' => :'format', + :'tags' => :'tags', + :'team_handle' => :'team_handle' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'alert_type' => :'String', + :'description' => :'String', + :'format' => :'String', + :'tags' => :'Array', + :'team_handle' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateOnCallEventEmailAddressRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'alert_type') + self.alert_type = attributes[:'alert_type'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'team_handle') + self.team_handle = attributes[:'team_handle'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @format.nil? + return false if @tags.nil? + true + end + + # Custom attribute writer method with validation + # @param format [Object] Object to be assigned + # @!visibility private + def format=(format) + if format.nil? + fail ArgumentError, 'invalid value for "format", format cannot be nil.' + end + @format = format + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + alert_type == o.alert_type && + description == o.description && + format == o.format && + tags == o.tags && + team_handle == o.team_handle && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [alert_type, description, format, tags, team_handle, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response.rb b/lib/datadog_api_client/v2/models/event_email_address_response.rb new file mode 100644 index 000000000000..28352803bdfb --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponse + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'EventEmailAddressResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response_array.rb b/lib/datadog_api_client/v2/models/event_email_address_response_array.rb new file mode 100644 index 000000000000..4bb9e46bbae1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponseArray + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponseArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response_data.rb b/lib/datadog_api_client/v2/models/event_email_address_response_data.rb new file mode 100644 index 000000000000..58be3408bd5b --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response_data.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_reader :id + + # + attr_accessor :relationships + + # Event emails resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'EventEmailAddressResponseDataAttributes', + :'id' => :'String', + :'relationships' => :'EventEmailAddressResponseDataRelationships', + :'type' => :'EventEmailsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response_data_attributes.rb b/lib/datadog_api_client/v2/models/event_email_address_response_data_attributes.rb new file mode 100644 index 000000000000..69202d5c6962 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response_data_attributes.rb @@ -0,0 +1,251 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponseDataAttributes + include BaseGenericModel + + # + attr_accessor :alert_type + + # + attr_reader :created_at + + # + attr_accessor :description + + # + attr_reader :email + + # + attr_reader :format + + # + attr_accessor :last_used_at + + # + attr_reader :notify_handles + + # + attr_accessor :revoked_at + + # + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'alert_type' => :'alert_type', + :'created_at' => :'created_at', + :'description' => :'description', + :'email' => :'email', + :'format' => :'format', + :'last_used_at' => :'last_used_at', + :'notify_handles' => :'notify_handles', + :'revoked_at' => :'revoked_at', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'alert_type' => :'String', + :'created_at' => :'Time', + :'description' => :'String', + :'email' => :'String', + :'format' => :'String', + :'last_used_at' => :'Time', + :'notify_handles' => :'Array', + :'revoked_at' => :'Time', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'alert_type') + self.alert_type = attributes[:'alert_type'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'notify_handles') + if (value = attributes[:'notify_handles']).is_a?(Array) + self.notify_handles = value + end + end + + if attributes.key?(:'revoked_at') + self.revoked_at = attributes[:'revoked_at'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @email.nil? + return false if @format.nil? + return false if @notify_handles.nil? + return false if @tags.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param email [Object] Object to be assigned + # @!visibility private + def email=(email) + if email.nil? + fail ArgumentError, 'invalid value for "email", email cannot be nil.' + end + @email = email + end + + # Custom attribute writer method with validation + # @param format [Object] Object to be assigned + # @!visibility private + def format=(format) + if format.nil? + fail ArgumentError, 'invalid value for "format", format cannot be nil.' + end + @format = format + end + + # Custom attribute writer method with validation + # @param notify_handles [Object] Object to be assigned + # @!visibility private + def notify_handles=(notify_handles) + if notify_handles.nil? + fail ArgumentError, 'invalid value for "notify_handles", notify_handles cannot be nil.' + end + @notify_handles = notify_handles + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + alert_type == o.alert_type && + created_at == o.created_at && + description == o.description && + email == o.email && + format == o.format && + last_used_at == o.last_used_at && + notify_handles == o.notify_handles && + revoked_at == o.revoked_at && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [alert_type, created_at, description, email, format, last_used_at, notify_handles, revoked_at, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships.rb b/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships.rb new file mode 100644 index 000000000000..77056c01fcf2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponseDataRelationships + include BaseGenericModel + + # + attr_reader :created_by + + # + attr_accessor :revoked_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'revoked_by' => :'revoked_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'EventEmailAddressResponseDataRelationshipsUser', + :'revoked_by' => :'EventEmailAddressResponseDataRelationshipsUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponseDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'revoked_by') + self.revoked_by = attributes[:'revoked_by'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_by.nil? + true + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by == o.created_by && + revoked_by == o.revoked_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by, revoked_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships_user.rb b/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships_user.rb new file mode 100644 index 000000000000..620dfa03af16 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships_user.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponseDataRelationshipsUser + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'EventEmailAddressResponseDataRelationshipsUserData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponseDataRelationshipsUser` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships_user_data.rb b/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships_user_data.rb new file mode 100644 index 000000000000..66676441617e --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_email_address_response_data_relationships_user_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class EventEmailAddressResponseDataRelationshipsUserData + include BaseGenericModel + + # + attr_reader :id + + # Users resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'UsersType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EventEmailAddressResponseDataRelationshipsUserData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_emails_type.rb b/lib/datadog_api_client/v2/models/event_emails_type.rb new file mode 100644 index 000000000000..59a06387f0f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_emails_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Event emails resource type. + class EventEmailsType + include BaseEnumModel + + EVENT_EMAILS = "event_emails".freeze + end +end