From 94c673f89fae1912d4455d12ba51f36f3a2c9c75 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 4 Jun 2026 21:12:11 +0000 Subject: [PATCH] Regenerate client from commit 0c0933c of spec repo --- .generator/schemas/v2/openapi.yaml | 503 ++++++++++++++++++ .../v2/organizations/GetSAMLConfiguration.rb | 5 + .../organizations/ListSAMLConfigurations.rb | 5 + .../UpdateOrgSamlConfigurations.rb | 23 + .../organizations/UpdateSAMLConfiguration.rb | 28 + features/scenarios_model_mapping.rb | 10 + features/v2/organizations.feature | 76 +++ features/v2/undo.json | 24 + lib/datadog_api_client/configuration.rb | 1 + lib/datadog_api_client/inflector.rb | 13 + .../v2/api/organizations_api.rb | 277 ++++++++++ .../models/org_saml_preferences_attributes.rb | 162 ++++++ .../v2/models/org_saml_preferences_data.rb | 154 ++++++ .../v2/models/org_saml_preferences_type.rb | 26 + .../org_saml_preferences_update_request.rb | 123 +++++ .../v2/models/saml_configuration.rb | 164 ++++++ .../models/saml_configuration_attributes.rb | 190 +++++++ .../saml_configuration_relationships.rb | 105 ++++ .../v2/models/saml_configuration_response.rb | 135 +++++ .../saml_configuration_update_attributes.rb | 140 +++++ .../models/saml_configuration_update_data.rb | 168 ++++++ .../saml_configuration_update_request.rb | 123 +++++ .../v2/models/saml_configurations_response.rb | 119 +++++ .../v2/models/saml_configurations_type.rb | 26 + 24 files changed, 2600 insertions(+) create mode 100644 examples/v2/organizations/GetSAMLConfiguration.rb create mode 100644 examples/v2/organizations/ListSAMLConfigurations.rb create mode 100644 examples/v2/organizations/UpdateOrgSamlConfigurations.rb create mode 100644 examples/v2/organizations/UpdateSAMLConfiguration.rb create mode 100644 lib/datadog_api_client/v2/models/org_saml_preferences_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/org_saml_preferences_data.rb create mode 100644 lib/datadog_api_client/v2/models/org_saml_preferences_type.rb create mode 100644 lib/datadog_api_client/v2/models/org_saml_preferences_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration_response.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configuration_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configurations_response.rb create mode 100644 lib/datadog_api_client/v2/models/saml_configurations_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85c263148490..74b9de40104c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1593,6 +1593,14 @@ components: required: true schema: type: string + SAMLConfigurationUUIDPathParameter: + description: The UUID of the SAML configuration. + in: path + name: saml_config_uuid + required: true + schema: + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string SalesforceIncidentsOrganizationIDPathParameter: description: The Datadog-assigned ID of the connected Salesforce organization. in: path @@ -66055,6 +66063,73 @@ components: type: string x-enum-varnames: - ORGS + OrgSAMLPreferencesAttributes: + description: Attributes for updating an organization's SAML preferences. + properties: + default_role_uuids: + description: |- + The UUID of the default role assigned to just-in-time provisioned users. + Exactly one role UUID must be provided. + example: + - 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + items: + description: The UUID of a role. + example: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + format: uuid + type: string + maxItems: 1 + minItems: 1 + type: array + jit_domains: + description: |- + Email domains for which users are automatically provisioned on first SAML login + (just-in-time provisioning). + example: + - example.com + items: + description: An email domain for just-in-time user provisioning. + example: example.com + maxLength: 256 + minLength: 1 + type: string + maxItems: 50 + type: array + required: + - jit_domains + - default_role_uuids + type: object + OrgSAMLPreferencesData: + description: Data for updating an organization's SAML preferences. + properties: + attributes: + $ref: "#/components/schemas/OrgSAMLPreferencesAttributes" + id: + description: The identifier of the SAML preferences resource. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: "#/components/schemas/OrgSAMLPreferencesType" + required: + - type + - attributes + type: object + OrgSAMLPreferencesType: + default: saml_preferences + description: SAML preferences resource type. + enum: + - saml_preferences + example: saml_preferences + type: string + x-enum-varnames: + - SAML_PREFERENCES + OrgSAMLPreferencesUpdateRequest: + description: Request to update an organization's SAML preferences. + properties: + data: + $ref: "#/components/schemas/OrgSAMLPreferencesData" + required: + - data + type: object Organization: description: Organization object. properties: @@ -74707,6 +74782,169 @@ components: type: string x-enum-varnames: - SAML_ASSERTION_ATTRIBUTES + SAMLConfiguration: + description: A SAML configuration object. + properties: + attributes: + $ref: "#/components/schemas/SAMLConfigurationAttributes" + id: + description: The UUID of the SAML configuration. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: string + relationships: + $ref: "#/components/schemas/SAMLConfigurationRelationships" + type: + $ref: "#/components/schemas/SAMLConfigurationsType" + required: + - id + - type + type: object + SAMLConfigurationAttributes: + description: Attributes of a SAML configuration. + properties: + assertion_consumer_service: + description: The assertion consumer service (ACS) URLs that the identity provider posts SAML responses to. + example: + - https://app.datadoghq.com/account/saml/assertion + items: + description: An assertion consumer service URL. + example: https://app.datadoghq.com/account/saml/assertion + type: string + type: array + created_at: + description: Creation time of the SAML configuration. + format: date-time + readOnly: true + type: string + entity_id: + description: The service provider entity ID Datadog presents to the identity provider. + example: https://app.datadoghq.com/account/saml/metadata.xml?id=00000000-0000-0000-0000-000000000000 + type: string + expires_at: + description: Expiration time of the uploaded identity provider metadata. + example: "2010-10-26T13:31:15+00:00" + format: date-time + nullable: true + type: string + idp_initiated: + description: Whether identity-provider-initiated login is enabled for the organization. + example: true + type: boolean + jit_domains: + description: |- + Email domains for which users are automatically provisioned on first SAML login + (just-in-time provisioning). + example: + - example.com + items: + description: An email domain for just-in-time user provisioning. + example: example.com + type: string + type: array + modified_at: + description: Time of the last SAML configuration modification. + format: date-time + readOnly: true + type: string + sso_url: + description: |- + The single sign-on URL users can visit to start a SAML login. + Returns `null` when the organization is identity-provider-initiated and has no subdomain. + example: https://app.datadoghq.com/account/login/id/00000000-0000-0000-0000-000000000000 + nullable: true + type: string + type: object + SAMLConfigurationRelationships: + description: Relationships of a SAML configuration. + properties: + default_roles: + $ref: "#/components/schemas/RelationshipToRoles" + type: object + SAMLConfigurationResponse: + description: Response containing a single SAML configuration. + properties: + data: + $ref: "#/components/schemas/SAMLConfiguration" + included: + description: Resources related to the SAML configuration, such as the default roles. + items: + $ref: "#/components/schemas/Role" + type: array + required: + - data + type: object + SAMLConfigurationUpdateAttributes: + description: Attributes for updating a SAML configuration. + properties: + idp_initiated: + description: Whether identity-provider-initiated login is enabled for the organization. + example: true + type: boolean + jit_domains: + description: |- + Email domains for which users are automatically provisioned on first SAML login + (just-in-time provisioning). A default role is required to enable just-in-time provisioning. + example: + - example.com + items: + description: An email domain for just-in-time user provisioning. + example: example.com + maxLength: 255 + minLength: 1 + type: string + maxItems: 50 + minItems: 0 + type: array + type: object + SAMLConfigurationUpdateData: + description: Data for updating a SAML configuration. + properties: + attributes: + $ref: "#/components/schemas/SAMLConfigurationUpdateAttributes" + id: + description: The UUID of the SAML configuration to update. Must match the UUID in the URL path. + example: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + maxLength: 39 + type: string + relationships: + $ref: "#/components/schemas/SAMLConfigurationRelationships" + type: + $ref: "#/components/schemas/SAMLConfigurationsType" + required: + - id + - type + type: object + SAMLConfigurationUpdateRequest: + description: Request to update a SAML configuration. + properties: + data: + $ref: "#/components/schemas/SAMLConfigurationUpdateData" + required: + - data + type: object + SAMLConfigurationsResponse: + description: Response containing a list of SAML configurations. + properties: + data: + description: Array of SAML configurations. An organization has at most one SAML configuration. + items: + $ref: "#/components/schemas/SAMLConfiguration" + type: array + included: + description: Resources related to the SAML configurations, such as the default roles. + items: + $ref: "#/components/schemas/Role" + type: array + type: object + SAMLConfigurationsType: + default: saml_configurations + description: SAML configurations resource type. + enum: + - saml_configurations + example: saml_configurations + type: string + x-enum-varnames: + - SAML_CONFIGURATIONS SBOM: description: A single SBOM properties: @@ -145038,6 +145276,64 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/org/saml_configurations: + patch: + description: |- + Update the SAML preferences for the current organization. + + Use this endpoint to set the just-in-time (JIT) provisioning domains and the default role + assigned to just-in-time provisioned users. + operationId: UpdateOrgSamlConfigurations + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + default_role_uuids: + - 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + jit_domains: + - example.com + type: saml_preferences + schema: + $ref: "#/components/schemas/OrgSAMLPreferencesUpdateRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update organization SAML preferences + tags: + - Organizations + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - org_management + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/org_configs: get: description: Returns all Org Configs (name, description, and value). @@ -154186,6 +154482,57 @@ paths: summary: List RUM replay viewership history sessions tags: - Rum Replay Viewership + /api/v2/saml_configurations: + get: + description: Get the list of SAML configurations for the current organization. An organization has at most one SAML configuration. + operationId: ListSAMLConfigurations + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + assertion_consumer_service: + - https://app.datadoghq.com/account/saml/assertion + entity_id: https://app.datadoghq.com/account/saml/metadata.xml?id=00000000-0000-0000-0000-000000000000 + expires_at: "2010-10-26T13:31:15+00:00" + idp_initiated: true + jit_domains: + - example.com + sso_url: https://app.datadoghq.com/account/login/id/00000000-0000-0000-0000-000000000000 + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + default_roles: + data: + - id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + type: saml_configurations + included: + - attributes: + name: Datadog Standard Role + id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + schema: + $ref: "#/components/schemas/SAMLConfigurationsResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication Error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List SAML configurations + tags: + - Organizations + "x-permission": + operator: OR + permissions: + - org_management /api/v2/saml_configurations/idp_metadata: post: description: |- @@ -154227,6 +154574,162 @@ paths: operator: OR permissions: - org_management + /api/v2/saml_configurations/{saml_config_uuid}: + get: + description: Get a single SAML configuration for the current organization by its UUID. + operationId: GetSAMLConfiguration + parameters: + - $ref: "#/components/parameters/SAMLConfigurationUUIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + assertion_consumer_service: + - https://app.datadoghq.com/account/saml/assertion + entity_id: https://app.datadoghq.com/account/saml/metadata.xml?id=00000000-0000-0000-0000-000000000000 + expires_at: "2010-10-26T13:31:15+00:00" + idp_initiated: true + jit_domains: + - example.com + sso_url: https://app.datadoghq.com/account/login/id/00000000-0000-0000-0000-000000000000 + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + default_roles: + data: + - id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + type: saml_configurations + included: + - attributes: + name: Datadog Standard Role + id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + schema: + $ref: "#/components/schemas/SAMLConfigurationResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication Error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a SAML configuration + tags: + - Organizations + "x-permission": + operator: OR + permissions: + - org_management + patch: + description: |- + Update a single SAML configuration for the current organization. + + Use this endpoint to enable or disable identity-provider-initiated login, set the + just-in-time provisioning domains, and set the default role assigned to + just-in-time provisioned users. A default role is required to enable just-in-time provisioning. + operationId: UpdateSAMLConfiguration + parameters: + - $ref: "#/components/parameters/SAMLConfigurationUUIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + idp_initiated: true + jit_domains: + - example.com + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + default_roles: + data: + - id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + type: saml_configurations + schema: + $ref: "#/components/schemas/SAMLConfigurationUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + assertion_consumer_service: + - https://app.datadoghq.com/account/saml/assertion + entity_id: https://app.datadoghq.com/account/saml/metadata.xml?id=00000000-0000-0000-0000-000000000000 + expires_at: "2010-10-26T13:31:15+00:00" + idp_initiated: true + jit_domains: + - example.com + sso_url: https://app.datadoghq.com/account/login/id/00000000-0000-0000-0000-000000000000 + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + relationships: + default_roles: + data: + - id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + type: saml_configurations + included: + - attributes: + name: Datadog Standard Role + id: 8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d + type: roles + schema: + $ref: "#/components/schemas/SAMLConfigurationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication Error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a SAML configuration + tags: + - Organizations + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - org_management /api/v2/scorecard/campaigns: get: description: Fetches all scorecard campaigns. diff --git a/examples/v2/organizations/GetSAMLConfiguration.rb b/examples/v2/organizations/GetSAMLConfiguration.rb new file mode 100644 index 000000000000..779e710e1af0 --- /dev/null +++ b/examples/v2/organizations/GetSAMLConfiguration.rb @@ -0,0 +1,5 @@ +# Get a SAML configuration returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrganizationsAPI.new +p api_instance.get_saml_configuration("3653d3c6-0c75-11ea-ad28-fb5701eabc7d") diff --git a/examples/v2/organizations/ListSAMLConfigurations.rb b/examples/v2/organizations/ListSAMLConfigurations.rb new file mode 100644 index 000000000000..41175f17d552 --- /dev/null +++ b/examples/v2/organizations/ListSAMLConfigurations.rb @@ -0,0 +1,5 @@ +# List SAML configurations returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrganizationsAPI.new +p api_instance.list_saml_configurations() diff --git a/examples/v2/organizations/UpdateOrgSamlConfigurations.rb b/examples/v2/organizations/UpdateOrgSamlConfigurations.rb new file mode 100644 index 000000000000..c9b601202719 --- /dev/null +++ b/examples/v2/organizations/UpdateOrgSamlConfigurations.rb @@ -0,0 +1,23 @@ +# Update organization SAML preferences returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_org_saml_configurations".to_sym] = true +end +api_instance = DatadogAPIClient::V2::OrganizationsAPI.new + +body = DatadogAPIClient::V2::OrgSAMLPreferencesUpdateRequest.new({ + data: DatadogAPIClient::V2::OrgSAMLPreferencesData.new({ + attributes: DatadogAPIClient::V2::OrgSAMLPreferencesAttributes.new({ + default_role_uuids: [ + "8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d", + ], + jit_domains: [ + "example.com", + ], + }), + id: "00000000-0000-0000-0000-000000000000", + type: DatadogAPIClient::V2::OrgSAMLPreferencesType::SAML_PREFERENCES, + }), +}) +api_instance.update_org_saml_configurations(body) diff --git a/examples/v2/organizations/UpdateSAMLConfiguration.rb b/examples/v2/organizations/UpdateSAMLConfiguration.rb new file mode 100644 index 000000000000..3bc2df3f2ade --- /dev/null +++ b/examples/v2/organizations/UpdateSAMLConfiguration.rb @@ -0,0 +1,28 @@ +# Update a SAML configuration returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrganizationsAPI.new + +body = DatadogAPIClient::V2::SAMLConfigurationUpdateRequest.new({ + data: DatadogAPIClient::V2::SAMLConfigurationUpdateData.new({ + attributes: DatadogAPIClient::V2::SAMLConfigurationUpdateAttributes.new({ + idp_initiated: true, + jit_domains: [ + "example.com", + ], + }), + id: "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", + relationships: DatadogAPIClient::V2::SAMLConfigurationRelationships.new({ + default_roles: DatadogAPIClient::V2::RelationshipToRoles.new({ + data: [ + DatadogAPIClient::V2::RelationshipToRoleData.new({ + id: "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", + type: DatadogAPIClient::V2::RolesType::ROLES, + }), + ], + }), + }), + type: DatadogAPIClient::V2::SAMLConfigurationsType::SAML_CONFIGURATIONS, + }), +}) +p api_instance.update_saml_configuration("3653d3c6-0c75-11ea-ad28-fb5701eabc7d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 403725296b92..e0afdeb4fdc8 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4167,6 +4167,9 @@ "v2.ListOrgs" => { "filter_name" => "String", }, + "v2.UpdateOrgSamlConfigurations" => { + "body" => "OrgSAMLPreferencesUpdateRequest", + }, "v2.GetOrgConfig" => { "org_config_name" => "String", }, @@ -4177,6 +4180,13 @@ "v2.UploadIdPMetadata" => { "idp_file" => "File", }, + "v2.GetSAMLConfiguration" => { + "saml_config_uuid" => "String", + }, + "v2.UpdateSAMLConfiguration" => { + "saml_config_uuid" => "String", + "body" => "SAMLConfigurationUpdateRequest", + }, "v2.DisableCustomerOrg" => { "body" => "CustomerOrgDisableRequest", }, diff --git a/features/v2/organizations.feature b/features/v2/organizations.feature index d50c9a305d59..01706fd55851 100644 --- a/features/v2/organizations.feature +++ b/features/v2/organizations.feature @@ -8,6 +8,20 @@ Feature: Organizations And a valid "appKeyAuth" key in the system And an instance of "Organizations" API + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get a SAML configuration returns "Not Found" response + Given new "GetSAMLConfiguration" request + And request contains "saml_config_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Get a SAML configuration returns "OK" response + Given new "GetSAMLConfiguration" request + And request contains "saml_config_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: Get a specific Org Config value returns "Bad Request" response Given new "GetOrgConfig" request @@ -41,12 +55,50 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List SAML configurations returns "OK" response + Given new "ListSAMLConfigurations" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: List your managed organizations returns "OK" response Given new "ListOrgs" request When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update a SAML configuration returns "Bad Request" response + Given new "UpdateSAMLConfiguration" request + And request contains "saml_config_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"idp_initiated": true, "jit_domains": ["example.com"]}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"default_roles": {"data": [{"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}]}}, "type": "saml_configurations"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update a SAML configuration returns "Not Found" response + Given new "UpdateSAMLConfiguration" request + And request contains "saml_config_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"idp_initiated": true, "jit_domains": ["example.com"]}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"default_roles": {"data": [{"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}]}}, "type": "saml_configurations"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update a SAML configuration returns "OK" response + Given new "UpdateSAMLConfiguration" request + And request contains "saml_config_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"idp_initiated": true, "jit_domains": ["example.com"]}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"default_roles": {"data": [{"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}]}}, "type": "saml_configurations"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update a SAML configuration returns "Unprocessable Entity" response + Given new "UpdateSAMLConfiguration" request + And request contains "saml_config_uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"idp_initiated": true, "jit_domains": ["example.com"]}, "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "relationships": {"default_roles": {"data": [{"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d", "type": "roles"}]}}, "type": "saml_configurations"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @team:DataDog/org-management Scenario: Update a specific Org Config returns "Bad Request" response Given new "UpdateOrgConfig" request @@ -71,6 +123,30 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update organization SAML preferences returns "Bad Request" response + Given operation "UpdateOrgSamlConfigurations" enabled + And new "UpdateOrgSamlConfigurations" request + And body with value {"data": {"attributes": {"default_role_uuids": ["8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d"], "jit_domains": ["example.com"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "saml_preferences"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update organization SAML preferences returns "No Content" response + Given operation "UpdateOrgSamlConfigurations" enabled + And new "UpdateOrgSamlConfigurations" request + And body with value {"data": {"attributes": {"default_role_uuids": ["8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d"], "jit_domains": ["example.com"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "saml_preferences"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update organization SAML preferences returns "Not Found" response + Given operation "UpdateOrgSamlConfigurations" enabled + And new "UpdateOrgSamlConfigurations" request + And body with value {"data": {"attributes": {"default_role_uuids": ["8dd1cf3c-0c75-11ea-ad28-fb5701eabc7d"], "jit_domains": ["example.com"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "saml_preferences"}} + When the request is sent + Then the response status is 404 Not Found + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/delegated-auth-login Scenario: Upload IdP metadata returns "Bad Request - caused by either malformed XML or invalid SAML IdP metadata" response Given new "UploadIdPMetadata" request diff --git a/features/v2/undo.json b/features/v2/undo.json index a2ff6ce184cb..bf8c214ecee0 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5208,6 +5208,12 @@ "type": "unsafe" } }, + "UpdateOrgSamlConfigurations": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "ListOrgConfigs": { "tag": "Organizations", "undo": { @@ -6304,12 +6310,30 @@ "type": "safe" } }, + "ListSAMLConfigurations": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "UploadIdPMetadata": { "tag": "Organizations", "undo": { "type": "idempotent" } }, + "GetSAMLConfiguration": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, + "UpdateSAMLConfiguration": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "ListScorecardCampaigns": { "tag": "Scorecards", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index c22dd8749e04..a9fbf00f57db 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -540,6 +540,7 @@ def initialize "v2.get_scopes_restriction": false, "v2.register_o_auth_client": false, "v2.upsert_scopes_restriction": false, + "v2.update_org_saml_configurations": false, "v2.disable_customer_org": false, "v2.bulk_update_org_group_memberships": false, "v2.create_org_group": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c1dbc42206b8..0854081621e5 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5114,6 +5114,10 @@ def overrides "v2.org_group_update_request" => "OrgGroupUpdateRequest", "v2.org_relationship_data" => "OrgRelationshipData", "v2.org_resource_type" => "OrgResourceType", + "v2.org_saml_preferences_attributes" => "OrgSAMLPreferencesAttributes", + "v2.org_saml_preferences_data" => "OrgSAMLPreferencesData", + "v2.org_saml_preferences_type" => "OrgSAMLPreferencesType", + "v2.org_saml_preferences_update_request" => "OrgSAMLPreferencesUpdateRequest", "v2.outbound_edge" => "OutboundEdge", "v2.outcomes_batch_attributes" => "OutcomesBatchAttributes", "v2.outcomes_batch_request" => "OutcomesBatchRequest", @@ -5727,6 +5731,15 @@ def overrides "v2.saml_assertion_attribute" => "SAMLAssertionAttribute", "v2.saml_assertion_attribute_attributes" => "SAMLAssertionAttributeAttributes", "v2.saml_assertion_attributes_type" => "SAMLAssertionAttributesType", + "v2.saml_configuration" => "SAMLConfiguration", + "v2.saml_configuration_attributes" => "SAMLConfigurationAttributes", + "v2.saml_configuration_relationships" => "SAMLConfigurationRelationships", + "v2.saml_configuration_response" => "SAMLConfigurationResponse", + "v2.saml_configurations_response" => "SAMLConfigurationsResponse", + "v2.saml_configurations_type" => "SAMLConfigurationsType", + "v2.saml_configuration_update_attributes" => "SAMLConfigurationUpdateAttributes", + "v2.saml_configuration_update_data" => "SAMLConfigurationUpdateData", + "v2.saml_configuration_update_request" => "SAMLConfigurationUpdateRequest", "v2.sample_log_generation_bulk_subscription_attributes" => "SampleLogGenerationBulkSubscriptionAttributes", "v2.sample_log_generation_bulk_subscription_data" => "SampleLogGenerationBulkSubscriptionData", "v2.sample_log_generation_bulk_subscription_item_meta" => "SampleLogGenerationBulkSubscriptionItemMeta", diff --git a/lib/datadog_api_client/v2/api/organizations_api.rb b/lib/datadog_api_client/v2/api/organizations_api.rb index ea537b66bfef..180b9c517cee 100644 --- a/lib/datadog_api_client/v2/api/organizations_api.rb +++ b/lib/datadog_api_client/v2/api/organizations_api.rb @@ -88,6 +88,71 @@ def get_org_config_with_http_info(org_config_name, opts = {}) return data, status_code, headers end + # Get a SAML configuration. + # + # @see #get_saml_configuration_with_http_info + def get_saml_configuration(saml_config_uuid, opts = {}) + data, _status_code, _headers = get_saml_configuration_with_http_info(saml_config_uuid, opts) + data + end + + # Get a SAML configuration. + # + # Get a single SAML configuration for the current organization by its UUID. + # + # @param saml_config_uuid [String] The UUID of the SAML configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(SAMLConfigurationResponse, Integer, Hash)>] SAMLConfigurationResponse data, response status code and response headers + def get_saml_configuration_with_http_info(saml_config_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsAPI.get_saml_configuration ...' + end + # verify the required parameter 'saml_config_uuid' is set + if @api_client.config.client_side_validation && saml_config_uuid.nil? + fail ArgumentError, "Missing the required parameter 'saml_config_uuid' when calling OrganizationsAPI.get_saml_configuration" + end + # resource path + local_var_path = '/api/v2/saml_configurations/{saml_config_uuid}'.sub('{saml_config_uuid}', CGI.escape(saml_config_uuid.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] || 'SAMLConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_saml_configuration, + :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: OrganizationsAPI#get_saml_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List Org Configs. # # @see #list_org_configs_with_http_info @@ -210,6 +275,66 @@ def list_orgs_with_http_info(opts = {}) return data, status_code, headers end + # List SAML configurations. + # + # @see #list_saml_configurations_with_http_info + def list_saml_configurations(opts = {}) + data, _status_code, _headers = list_saml_configurations_with_http_info(opts) + data + end + + # List SAML configurations. + # + # Get the list of SAML configurations for the current organization. An organization has at most one SAML configuration. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SAMLConfigurationsResponse, Integer, Hash)>] SAMLConfigurationsResponse data, response status code and response headers + def list_saml_configurations_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsAPI.list_saml_configurations ...' + end + # resource path + local_var_path = '/api/v2/saml_configurations' + + # 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] || 'SAMLConfigurationsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_saml_configurations, + :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: OrganizationsAPI#list_saml_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a specific Org Config. # # @see #update_org_config_with_http_info @@ -282,6 +407,158 @@ def update_org_config_with_http_info(org_config_name, body, opts = {}) return data, status_code, headers end + # Update organization SAML preferences. + # + # @see #update_org_saml_configurations_with_http_info + def update_org_saml_configurations(body, opts = {}) + update_org_saml_configurations_with_http_info(body, opts) + nil + end + + # Update organization SAML preferences. + # + # Update the SAML preferences for the current organization. + # + # Use this endpoint to set the just-in-time (JIT) provisioning domains and the default role + # assigned to just-in-time provisioned users. + # + # @param body [OrgSAMLPreferencesUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_org_saml_configurations_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_org_saml_configurations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_org_saml_configurations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_org_saml_configurations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsAPI.update_org_saml_configurations ...' + 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 OrganizationsAPI.update_org_saml_configurations" + end + # resource path + local_var_path = '/api/v2/org/saml_configurations' + + # 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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_org_saml_configurations, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrganizationsAPI#update_org_saml_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a SAML configuration. + # + # @see #update_saml_configuration_with_http_info + def update_saml_configuration(saml_config_uuid, body, opts = {}) + data, _status_code, _headers = update_saml_configuration_with_http_info(saml_config_uuid, body, opts) + data + end + + # Update a SAML configuration. + # + # Update a single SAML configuration for the current organization. + # + # Use this endpoint to enable or disable identity-provider-initiated login, set the + # just-in-time provisioning domains, and set the default role assigned to + # just-in-time provisioned users. A default role is required to enable just-in-time provisioning. + # + # @param saml_config_uuid [String] The UUID of the SAML configuration. + # @param body [SAMLConfigurationUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SAMLConfigurationResponse, Integer, Hash)>] SAMLConfigurationResponse data, response status code and response headers + def update_saml_configuration_with_http_info(saml_config_uuid, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrganizationsAPI.update_saml_configuration ...' + end + # verify the required parameter 'saml_config_uuid' is set + if @api_client.config.client_side_validation && saml_config_uuid.nil? + fail ArgumentError, "Missing the required parameter 'saml_config_uuid' when calling OrganizationsAPI.update_saml_configuration" + 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 OrganizationsAPI.update_saml_configuration" + end + # resource path + local_var_path = '/api/v2/saml_configurations/{saml_config_uuid}'.sub('{saml_config_uuid}', CGI.escape(saml_config_uuid.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']) + # 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] || 'SAMLConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_saml_configuration, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrganizationsAPI#update_saml_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Upload IdP metadata. # # @see #upload_idp_metadata_with_http_info diff --git a/lib/datadog_api_client/v2/models/org_saml_preferences_attributes.rb b/lib/datadog_api_client/v2/models/org_saml_preferences_attributes.rb new file mode 100644 index 000000000000..038db3d37ffc --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_saml_preferences_attributes.rb @@ -0,0 +1,162 @@ +=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 + # Attributes for updating an organization's SAML preferences. + class OrgSAMLPreferencesAttributes + include BaseGenericModel + + # The UUID of the default role assigned to just-in-time provisioned users. + # Exactly one role UUID must be provided. + attr_reader :default_role_uuids + + # Email domains for which users are automatically provisioned on first SAML login + # (just-in-time provisioning). + attr_reader :jit_domains + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'default_role_uuids' => :'default_role_uuids', + :'jit_domains' => :'jit_domains' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'default_role_uuids' => :'Array', + :'jit_domains' => :'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::OrgSAMLPreferencesAttributes` 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?(:'default_role_uuids') + if (value = attributes[:'default_role_uuids']).is_a?(Array) + self.default_role_uuids = value + end + end + + if attributes.key?(:'jit_domains') + if (value = attributes[:'jit_domains']).is_a?(Array) + self.jit_domains = 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 @default_role_uuids.nil? + return false if @default_role_uuids.length > 1 + return false if @default_role_uuids.length < 1 + return false if @jit_domains.nil? + return false if @jit_domains.length > 50 + true + end + + # Custom attribute writer method with validation + # @param default_role_uuids [Object] Object to be assigned + # @!visibility private + def default_role_uuids=(default_role_uuids) + if default_role_uuids.nil? + fail ArgumentError, 'invalid value for "default_role_uuids", default_role_uuids cannot be nil.' + end + if default_role_uuids.length > 1 + fail ArgumentError, 'invalid value for "default_role_uuids", number of items must be less than or equal to 1.' + end + if default_role_uuids.length < 1 + fail ArgumentError, 'invalid value for "default_role_uuids", number of items must be greater than or equal to 1.' + end + @default_role_uuids = default_role_uuids + end + + # Custom attribute writer method with validation + # @param jit_domains [Object] Object to be assigned + # @!visibility private + def jit_domains=(jit_domains) + if jit_domains.nil? + fail ArgumentError, 'invalid value for "jit_domains", jit_domains cannot be nil.' + end + if jit_domains.length > 50 + fail ArgumentError, 'invalid value for "jit_domains", number of items must be less than or equal to 50.' + end + @jit_domains = jit_domains + 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 && + default_role_uuids == o.default_role_uuids && + jit_domains == o.jit_domains && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [default_role_uuids, jit_domains, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_saml_preferences_data.rb b/lib/datadog_api_client/v2/models/org_saml_preferences_data.rb new file mode 100644 index 000000000000..5b138c5d0968 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_saml_preferences_data.rb @@ -0,0 +1,154 @@ +=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 + # Data for updating an organization's SAML preferences. + class OrgSAMLPreferencesData + include BaseGenericModel + + # Attributes for updating an organization's SAML preferences. + attr_reader :attributes + + # The identifier of the SAML preferences resource. + attr_accessor :id + + # SAML preferences 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OrgSAMLPreferencesAttributes', + :'id' => :'String', + :'type' => :'OrgSAMLPreferencesType' + } + 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::OrgSAMLPreferencesData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_saml_preferences_type.rb b/lib/datadog_api_client/v2/models/org_saml_preferences_type.rb new file mode 100644 index 000000000000..6208d1967357 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_saml_preferences_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 + # SAML preferences resource type. + class OrgSAMLPreferencesType + include BaseEnumModel + + SAML_PREFERENCES = "saml_preferences".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_saml_preferences_update_request.rb b/lib/datadog_api_client/v2/models/org_saml_preferences_update_request.rb new file mode 100644 index 000000000000..9b71d7358bec --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_saml_preferences_update_request.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 + # Request to update an organization's SAML preferences. + class OrgSAMLPreferencesUpdateRequest + include BaseGenericModel + + # Data for updating an organization's SAML preferences. + 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' => :'OrgSAMLPreferencesData' + } + 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::OrgSAMLPreferencesUpdateRequest` 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/saml_configuration.rb b/lib/datadog_api_client/v2/models/saml_configuration.rb new file mode 100644 index 000000000000..e8aadf58f9c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration.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 + # A SAML configuration object. + class SAMLConfiguration + include BaseGenericModel + + # Attributes of a SAML configuration. + attr_accessor :attributes + + # The UUID of the SAML configuration. + attr_reader :id + + # Relationships of a SAML configuration. + attr_accessor :relationships + + # SAML configurations 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' => :'SAMLConfigurationAttributes', + :'id' => :'String', + :'relationships' => :'SAMLConfigurationRelationships', + :'type' => :'SAMLConfigurationsType' + } + 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::SAMLConfiguration` 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/saml_configuration_attributes.rb b/lib/datadog_api_client/v2/models/saml_configuration_attributes.rb new file mode 100644 index 000000000000..6e187d4e041f --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration_attributes.rb @@ -0,0 +1,190 @@ +=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 + # Attributes of a SAML configuration. + class SAMLConfigurationAttributes + include BaseGenericModel + + # The assertion consumer service (ACS) URLs that the identity provider posts SAML responses to. + attr_accessor :assertion_consumer_service + + # Creation time of the SAML configuration. + attr_accessor :created_at + + # The service provider entity ID Datadog presents to the identity provider. + attr_accessor :entity_id + + # Expiration time of the uploaded identity provider metadata. + attr_accessor :expires_at + + # Whether identity-provider-initiated login is enabled for the organization. + attr_accessor :idp_initiated + + # Email domains for which users are automatically provisioned on first SAML login + # (just-in-time provisioning). + attr_accessor :jit_domains + + # Time of the last SAML configuration modification. + attr_accessor :modified_at + + # The single sign-on URL users can visit to start a SAML login. + # Returns `null` when the organization is identity-provider-initiated and has no subdomain. + attr_accessor :sso_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assertion_consumer_service' => :'assertion_consumer_service', + :'created_at' => :'created_at', + :'entity_id' => :'entity_id', + :'expires_at' => :'expires_at', + :'idp_initiated' => :'idp_initiated', + :'jit_domains' => :'jit_domains', + :'modified_at' => :'modified_at', + :'sso_url' => :'sso_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assertion_consumer_service' => :'Array', + :'created_at' => :'Time', + :'entity_id' => :'String', + :'expires_at' => :'Time', + :'idp_initiated' => :'Boolean', + :'jit_domains' => :'Array', + :'modified_at' => :'Time', + :'sso_url' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'expires_at', + :'sso_url', + ]) + 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::SAMLConfigurationAttributes` 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?(:'assertion_consumer_service') + if (value = attributes[:'assertion_consumer_service']).is_a?(Array) + self.assertion_consumer_service = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'entity_id') + self.entity_id = attributes[:'entity_id'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'idp_initiated') + self.idp_initiated = attributes[:'idp_initiated'] + end + + if attributes.key?(:'jit_domains') + if (value = attributes[:'jit_domains']).is_a?(Array) + self.jit_domains = value + end + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'sso_url') + self.sso_url = attributes[:'sso_url'] + 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 && + assertion_consumer_service == o.assertion_consumer_service && + created_at == o.created_at && + entity_id == o.entity_id && + expires_at == o.expires_at && + idp_initiated == o.idp_initiated && + jit_domains == o.jit_domains && + modified_at == o.modified_at && + sso_url == o.sso_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assertion_consumer_service, created_at, entity_id, expires_at, idp_initiated, jit_domains, modified_at, sso_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/saml_configuration_relationships.rb b/lib/datadog_api_client/v2/models/saml_configuration_relationships.rb new file mode 100644 index 000000000000..7b89a527dc89 --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration_relationships.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 + # Relationships of a SAML configuration. + class SAMLConfigurationRelationships + include BaseGenericModel + + # Relationship to roles. + attr_accessor :default_roles + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'default_roles' => :'default_roles' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'default_roles' => :'RelationshipToRoles' + } + 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::SAMLConfigurationRelationships` 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?(:'default_roles') + self.default_roles = attributes[:'default_roles'] + 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 && + default_roles == o.default_roles && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [default_roles, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/saml_configuration_response.rb b/lib/datadog_api_client/v2/models/saml_configuration_response.rb new file mode 100644 index 000000000000..8c7d8dd5ef19 --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration_response.rb @@ -0,0 +1,135 @@ +=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 + # Response containing a single SAML configuration. + class SAMLConfigurationResponse + include BaseGenericModel + + # A SAML configuration object. + attr_reader :data + + # Resources related to the SAML configuration, such as the default roles. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SAMLConfiguration', + :'included' => :'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::SAMLConfigurationResponse` 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 + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = 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 && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/saml_configuration_update_attributes.rb b/lib/datadog_api_client/v2/models/saml_configuration_update_attributes.rb new file mode 100644 index 000000000000..bba69ab56e0c --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration_update_attributes.rb @@ -0,0 +1,140 @@ +=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 + # Attributes for updating a SAML configuration. + class SAMLConfigurationUpdateAttributes + include BaseGenericModel + + # Whether identity-provider-initiated login is enabled for the organization. + attr_accessor :idp_initiated + + # Email domains for which users are automatically provisioned on first SAML login + # (just-in-time provisioning). A default role is required to enable just-in-time provisioning. + attr_reader :jit_domains + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'idp_initiated' => :'idp_initiated', + :'jit_domains' => :'jit_domains' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'idp_initiated' => :'Boolean', + :'jit_domains' => :'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::SAMLConfigurationUpdateAttributes` 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?(:'idp_initiated') + self.idp_initiated = attributes[:'idp_initiated'] + end + + if attributes.key?(:'jit_domains') + if (value = attributes[:'jit_domains']).is_a?(Array) + self.jit_domains = 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 !@jit_domains.nil? && @jit_domains.length > 50 + return false if !@jit_domains.nil? && @jit_domains.length < 0 + true + end + + # Custom attribute writer method with validation + # @param jit_domains [Object] Object to be assigned + # @!visibility private + def jit_domains=(jit_domains) + if !jit_domains.nil? && jit_domains.length > 50 + fail ArgumentError, 'invalid value for "jit_domains", number of items must be less than or equal to 50.' + end + if !jit_domains.nil? && jit_domains.length < 0 + fail ArgumentError, 'invalid value for "jit_domains", number of items must be greater than or equal to 0.' + end + @jit_domains = jit_domains + 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 && + idp_initiated == o.idp_initiated && + jit_domains == o.jit_domains && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [idp_initiated, jit_domains, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/saml_configuration_update_data.rb b/lib/datadog_api_client/v2/models/saml_configuration_update_data.rb new file mode 100644 index 000000000000..a7785991f229 --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration_update_data.rb @@ -0,0 +1,168 @@ +=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 + # Data for updating a SAML configuration. + class SAMLConfigurationUpdateData + include BaseGenericModel + + # Attributes for updating a SAML configuration. + attr_accessor :attributes + + # The UUID of the SAML configuration to update. Must match the UUID in the URL path. + attr_reader :id + + # Relationships of a SAML configuration. + attr_accessor :relationships + + # SAML configurations 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' => :'SAMLConfigurationUpdateAttributes', + :'id' => :'String', + :'relationships' => :'SAMLConfigurationRelationships', + :'type' => :'SAMLConfigurationsType' + } + 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::SAMLConfigurationUpdateData` 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 @id.to_s.length > 39 + 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 + if id.to_s.length > 39 + fail ArgumentError, 'invalid value for "id", the character length must be smaller than or equal to 39.' + 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/saml_configuration_update_request.rb b/lib/datadog_api_client/v2/models/saml_configuration_update_request.rb new file mode 100644 index 000000000000..2d2f15729560 --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configuration_update_request.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 + # Request to update a SAML configuration. + class SAMLConfigurationUpdateRequest + include BaseGenericModel + + # Data for updating a SAML configuration. + 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' => :'SAMLConfigurationUpdateData' + } + 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::SAMLConfigurationUpdateRequest` 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/saml_configurations_response.rb b/lib/datadog_api_client/v2/models/saml_configurations_response.rb new file mode 100644 index 000000000000..174e9148a20b --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configurations_response.rb @@ -0,0 +1,119 @@ +=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 + # Response containing a list of SAML configurations. + class SAMLConfigurationsResponse + include BaseGenericModel + + # Array of SAML configurations. An organization has at most one SAML configuration. + attr_accessor :data + + # Resources related to the SAML configurations, such as the default roles. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'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::SAMLConfigurationsResponse` 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 + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + 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 && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/saml_configurations_type.rb b/lib/datadog_api_client/v2/models/saml_configurations_type.rb new file mode 100644 index 000000000000..f41195a8fb41 --- /dev/null +++ b/lib/datadog_api_client/v2/models/saml_configurations_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 + # SAML configurations resource type. + class SAMLConfigurationsType + include BaseEnumModel + + SAML_CONFIGURATIONS = "saml_configurations".freeze + end +end