diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 440627d7e6b3..49086bdc75de 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4568,6 +4568,15 @@ components: type: string x-enum-varnames: - DEPLOYMENT + AppFavoriteType: + default: favorites + description: The favorite resource type. + enum: + - favorites + example: favorites + type: string + x-enum-varnames: + - FAVORITES AppKeyRegistrationData: description: Data related to the app key registration. properties: @@ -4628,6 +4637,25 @@ components: format: int64 type: integer type: object + AppProtectionLevel: + description: The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + enum: + - direct_publish + - approval_required + example: direct_publish + type: string + x-enum-varnames: + - DIRECT_PUBLISH + - APPROVAL_REQUIRED + AppProtectionLevelType: + default: protectionLevel + description: The protection-level resource type. + enum: + - protectionLevel + example: protectionLevel + type: string + x-enum-varnames: + - PROTECTIONLEVEL AppRelationship: description: The app's publication relationship and custom connections. properties: @@ -4639,6 +4667,24 @@ components: deployment: $ref: "#/components/schemas/DeploymentRelationship" type: object + AppSelfServiceType: + default: selfService + description: The self-service resource type. + enum: + - selfService + example: selfService + type: string + x-enum-varnames: + - SELFSERVICE + AppTagsType: + default: tags + description: The tags resource type. + enum: + - tags + example: tags + type: string + x-enum-varnames: + - TAGS AppTriggerWrapper: description: "Schema for an App-based trigger." properties: @@ -4650,6 +4696,80 @@ components: required: - appTrigger type: object + AppVersion: + description: A version of an app. + properties: + attributes: + $ref: "#/components/schemas/AppVersionAttributes" + id: + description: The ID of the app version. + example: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + format: uuid + type: string + type: + $ref: "#/components/schemas/AppVersionType" + type: object + AppVersionAttributes: + description: Attributes describing an app version. + properties: + app_id: + description: The ID of the app this version belongs to. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + created_at: + description: Timestamp of when the version was created. + format: date-time + type: string + has_ever_been_published: + description: Whether this version has ever been published. + example: true + type: boolean + name: + description: The optional human-readable name of the version. + example: v1.2.0 - bug fix release + type: string + updated_at: + description: Timestamp of when the version was last updated. + format: date-time + type: string + user_id: + description: The ID of the user who created the version. + format: int64 + type: integer + user_name: + description: The name (or email) of the user who created the version. + example: jane.doe@example.com + type: string + user_uuid: + description: The UUID of the user who created the version. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + format: uuid + type: string + version: + description: The version number of the app, starting at 1. + example: 3 + format: int64 + type: integer + type: object + AppVersionNameType: + default: versionNames + description: The version-name resource type. + enum: + - versionNames + example: versionNames + type: string + x-enum-varnames: + - VERSIONNAMES + AppVersionType: + default: appVersions + description: The app-version resource type. + enum: + - appVersions + example: appVersions + type: string + x-enum-varnames: + - APPVERSIONS ApplicationKeyCreateAttributes: description: Attributes used to create an application Key. properties: @@ -17102,6 +17222,40 @@ components: - type - number type: object + CreatePublishRequestRequest: + description: A request to ask for approval to publish an app whose protection level is `approval_required`. + example: + data: + attributes: + description: Adds new dashboard widgets and a few bug fixes. + title: Release v1.2 to production + type: publishRequest + properties: + data: + $ref: "#/components/schemas/CreatePublishRequestRequestData" + type: object + CreatePublishRequestRequestData: + description: Data for creating a publish request. + properties: + attributes: + $ref: "#/components/schemas/CreatePublishRequestRequestDataAttributes" + type: + $ref: "#/components/schemas/PublishRequestType" + type: object + CreatePublishRequestRequestDataAttributes: + description: Attributes for creating a publish request. + properties: + description: + description: An optional description of the changes in this publish request. + example: Adds new dashboard widgets and a few bug fixes. + type: string + title: + description: A short title for the publish request. + example: Release v1.2 to production + type: string + required: + - title + type: object CreateRuleRequest: description: Scorecard create rule request. properties: @@ -40575,6 +40729,17 @@ components: format: int64 type: integer type: object + ListAppVersionsResponse: + description: A paginated list of versions for an app. + properties: + data: + description: The list of app versions. + items: + $ref: "#/components/schemas/AppVersion" + type: array + meta: + $ref: "#/components/schemas/ListAppsResponseMeta" + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -56379,6 +56544,15 @@ components: data: $ref: "#/components/schemas/Deployment" type: object + PublishRequestType: + default: publishRequest + description: The publish-request resource type. + enum: + - publishRequest + example: publishRequest + type: string + x-enum-varnames: + - PUBLISHREQUEST PutAppsDatastoreItemResponseArray: description: Response after successfully inserting multiple items into a datastore, containing the identifiers of the created items. properties: @@ -79669,6 +79843,62 @@ components: data: $ref: "#/components/schemas/ActionConnectionData" type: object + UpdateAppFavoriteRequest: + description: A request to add or remove an app from the current user's favorites. + example: + data: + attributes: + favorite: true + type: favorites + properties: + data: + $ref: "#/components/schemas/UpdateAppFavoriteRequestData" + type: object + UpdateAppFavoriteRequestData: + description: Data for updating an app's favorite status. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppFavoriteRequestDataAttributes" + type: + $ref: "#/components/schemas/AppFavoriteType" + type: object + UpdateAppFavoriteRequestDataAttributes: + description: Attributes for updating an app's favorite status. + properties: + favorite: + description: Whether the app should be marked as a favorite for the current user. + example: true + type: boolean + required: + - favorite + type: object + UpdateAppProtectionLevelRequest: + description: A request to update an app's publication protection level. + example: + data: + attributes: + protectionLevel: approval_required + type: protectionLevel + properties: + data: + $ref: "#/components/schemas/UpdateAppProtectionLevelRequestData" + type: object + UpdateAppProtectionLevelRequestData: + description: Data for updating an app's publication protection level. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppProtectionLevelRequestDataAttributes" + type: + $ref: "#/components/schemas/AppProtectionLevelType" + type: object + UpdateAppProtectionLevelRequestDataAttributes: + description: Attributes for updating an app's publication protection level. + properties: + protectionLevel: + $ref: "#/components/schemas/AppProtectionLevel" + required: + - protectionLevel + type: object UpdateAppRequest: description: A request object for updating an existing app. example: @@ -79828,6 +80058,99 @@ components: type: string type: array type: object + UpdateAppSelfServiceRequest: + description: A request to enable or disable self-service for an app. + example: + data: + attributes: + selfService: true + type: selfService + properties: + data: + $ref: "#/components/schemas/UpdateAppSelfServiceRequestData" + type: object + UpdateAppSelfServiceRequestData: + description: Data for updating an app's self-service status. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppSelfServiceRequestDataAttributes" + type: + $ref: "#/components/schemas/AppSelfServiceType" + type: object + UpdateAppSelfServiceRequestDataAttributes: + description: Attributes for updating an app's self-service status. + properties: + selfService: + description: Whether the app is enabled for self-service. + example: true + type: boolean + required: + - selfService + type: object + UpdateAppTagsRequest: + description: A request to replace the tags on an app. + example: + data: + attributes: + tags: + - team:platform + - service:ops + type: tags + properties: + data: + $ref: "#/components/schemas/UpdateAppTagsRequestData" + type: object + UpdateAppTagsRequestData: + description: Data for replacing an app's tags. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppTagsRequestDataAttributes" + type: + $ref: "#/components/schemas/AppTagsType" + type: object + UpdateAppTagsRequestDataAttributes: + description: Attributes for replacing an app's tags. + properties: + tags: + description: The full list of tags that should be set on the app. Existing tags not present in this list are removed. + example: + - team:platform + - service:ops + items: + type: string + type: array + required: + - tags + type: object + UpdateAppVersionNameRequest: + description: A request to assign a human-readable name to a specific app version. + example: + data: + attributes: + name: v1.2.0 - bug fix release + type: versionNames + properties: + data: + $ref: "#/components/schemas/UpdateAppVersionNameRequestData" + type: object + UpdateAppVersionNameRequestData: + description: Data for naming a specific app version. + properties: + attributes: + $ref: "#/components/schemas/UpdateAppVersionNameRequestDataAttributes" + type: + $ref: "#/components/schemas/AppVersionNameType" + type: object + UpdateAppVersionNameRequestDataAttributes: + description: Attributes for naming a specific app version. + properties: + name: + description: The name to assign to the app version. + example: v1.2.0 - bug fix release + type: string + required: + - name + type: object UpdateAppsDatastoreItemRequest: description: Request to update specific fields on an existing datastore item. properties: @@ -88719,6 +89042,534 @@ paths: operator: OR permissions: - apps_write + "/api/v2/app-builder/apps/{app_id}/favorite": + patch: + description: Add or remove an app from the current user's favorites. Favorited apps can be filtered for using the `filter[favorite]` query parameter on the [List Apps](https://docs.datadoghq.com/api/latest/app-builder/#list-apps) endpoint. + operationId: UpdateAppFavorite + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + favorite: true + type: favorites + schema: + $ref: "#/components/schemas/UpdateAppFavoriteRequest" + required: true + responses: + "200": + description: OK + "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 App Favorite Status + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_run + "/api/v2/app-builder/apps/{app_id}/protection-level": + patch: + description: Update the publication protection level of an app. When set to `approval_required`, future publishes must go through an approval workflow before going live. + operationId: UpdateProtectionLevel + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + protectionLevel: approval_required + type: protectionLevel + schema: + $ref: "#/components/schemas/UpdateAppProtectionLevelRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + components: [] + description: This is a simple example app + favorite: false + name: Example App + queries: [] + rootInstanceName: grid0 + tags: [] + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: appDefinitions + schema: + $ref: "#/components/schemas/UpdateAppResponse" + description: OK + "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 App Protection Level + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/publish-request": + post: + description: Create a publish request to ask for approval to publish an app whose protection level is `approval_required`. Publishing happens automatically once the request is approved by a user with the appropriate permissions. + operationId: CreatePublishRequest + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Adds new dashboard widgets and a few bug fixes. + title: Release v1.2 to production + type: publishRequest + schema: + $ref: "#/components/schemas/CreatePublishRequestRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + app_version_id: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + meta: + created_at: "2026-04-01T12:00:00Z" + user_name: jane.doe@example.com + user_uuid: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: deployment + schema: + $ref: "#/components/schemas/PublishAppResponse" + description: Created + "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: Create Publish Request + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/revert": + post: + description: Revert an app to a previous version. The version to revert to is selected through the `version` query parameter. The reverted version becomes the new latest version of the app. + operationId: RevertApp + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + - description: The version number of the app to revert to. Cannot be `latest`. The special value `deployed` can be used to revert to the currently published version. + example: "2" + in: query + name: version + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + components: [] + description: This is a simple example app + favorite: false + name: Example App + queries: [] + rootInstanceName: grid0 + tags: [] + id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + type: appDefinitions + schema: + $ref: "#/components/schemas/UpdateAppResponse" + description: OK + "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: Revert App + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/self-service": + patch: + description: Enable or disable self-service for an app. Self-service apps can be discovered and run by users in your organization without explicit access being granted. + operationId: UpdateAppSelfService + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + selfService: true + type: selfService + schema: + $ref: "#/components/schemas/UpdateAppSelfServiceRequest" + required: true + responses: + "200": + description: OK + "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 App Self-Service Status + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/tags": + patch: + description: Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not present in the request body are removed. + operationId: UpdateAppTags + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + tags: + - team:platform + - service:ops + type: tags + schema: + $ref: "#/components/schemas/UpdateAppTagsRequest" + 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 App Tags + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/version-name": + patch: + description: Assign a human-readable name to a specific version of an app. The version is selected through the `version` query parameter. + operationId: UpdateAppVersionName + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + - description: The version number of the app to name. The special values `latest` and `deployed` can also be used to target the latest or currently published version. + example: "3" + in: query + name: version + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: v1.2.0 - bug fix release + type: versionNames + schema: + $ref: "#/components/schemas/UpdateAppVersionNameRequest" + 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: Name App Version + tags: + - App Builder + "x-permission": + operator: OR + permissions: + - apps_write + "/api/v2/app-builder/apps/{app_id}/versions": + get: + description: List the versions of an app. This endpoint is paginated. + operationId: ListAppVersions + parameters: + - description: The ID of the app. + example: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + in: path + name: app_id + required: true + schema: + format: uuid + type: string + - description: The number of versions to return per page. + in: query + name: limit + required: false + schema: + format: int64 + type: integer + - description: The page number to return. + in: query + name: page + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + app_id: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + created_at: "2026-04-01T12:00:00Z" + has_ever_been_published: true + name: v1.2.0 - bug fix release + updated_at: "2026-04-01T12:00:00Z" + user_name: jane.doe@example.com + user_uuid: 65bb1f25-52e1-4510-9f8d-22d1516ed693 + version: 3 + id: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + type: appVersions + meta: + page: + totalCount: 1 + schema: + $ref: "#/components/schemas/ListAppVersionsResponse" + description: OK + "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: List App Versions + tags: + - App Builder + "x-permission": + operator: AND + permissions: + - apps_run + - connections_read /api/v2/application_keys: get: description: List all application keys available for your org diff --git a/examples/v2/app-builder/CreatePublishRequest.rb b/examples/v2/app-builder/CreatePublishRequest.rb new file mode 100644 index 000000000000..e41f678d5721 --- /dev/null +++ b/examples/v2/app-builder/CreatePublishRequest.rb @@ -0,0 +1,15 @@ +# Create Publish Request returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::CreatePublishRequestRequest.new({ + data: DatadogAPIClient::V2::CreatePublishRequestRequestData.new({ + attributes: DatadogAPIClient::V2::CreatePublishRequestRequestDataAttributes.new({ + description: "Adds new dashboard widgets and a few bug fixes.", + title: "Release v1.2 to production", + }), + type: DatadogAPIClient::V2::PublishRequestType::PUBLISHREQUEST, + }), +}) +p api_instance.create_publish_request("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/ListAppVersions.rb b/examples/v2/app-builder/ListAppVersions.rb new file mode 100644 index 000000000000..1c53dd590e11 --- /dev/null +++ b/examples/v2/app-builder/ListAppVersions.rb @@ -0,0 +1,5 @@ +# List App Versions returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.list_app_versions("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/app-builder/RevertApp.rb b/examples/v2/app-builder/RevertApp.rb new file mode 100644 index 000000000000..3c0650a918bd --- /dev/null +++ b/examples/v2/app-builder/RevertApp.rb @@ -0,0 +1,5 @@ +# Revert App returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.revert_app("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "version") diff --git a/examples/v2/app-builder/UpdateAppFavorite.rb b/examples/v2/app-builder/UpdateAppFavorite.rb new file mode 100644 index 000000000000..64ac13f05244 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppFavorite.rb @@ -0,0 +1,14 @@ +# Update App Favorite Status returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppFavoriteRequest.new({ + data: DatadogAPIClient::V2::UpdateAppFavoriteRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppFavoriteRequestDataAttributes.new({ + favorite: true, + }), + type: DatadogAPIClient::V2::AppFavoriteType::FAVORITES, + }), +}) +p api_instance.update_app_favorite("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/UpdateAppSelfService.rb b/examples/v2/app-builder/UpdateAppSelfService.rb new file mode 100644 index 000000000000..c491677bd3e8 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppSelfService.rb @@ -0,0 +1,14 @@ +# Update App Self-Service Status returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppSelfServiceRequest.new({ + data: DatadogAPIClient::V2::UpdateAppSelfServiceRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppSelfServiceRequestDataAttributes.new({ + self_service: true, + }), + type: DatadogAPIClient::V2::AppSelfServiceType::SELFSERVICE, + }), +}) +p api_instance.update_app_self_service("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/UpdateAppTags.rb b/examples/v2/app-builder/UpdateAppTags.rb new file mode 100644 index 000000000000..04d8ec88dbab --- /dev/null +++ b/examples/v2/app-builder/UpdateAppTags.rb @@ -0,0 +1,17 @@ +# Update App Tags returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppTagsRequest.new({ + data: DatadogAPIClient::V2::UpdateAppTagsRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppTagsRequestDataAttributes.new({ + tags: [ + "team:platform", + "service:ops", + ], + }), + type: DatadogAPIClient::V2::AppTagsType::TAGS, + }), +}) +api_instance.update_app_tags("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/UpdateAppVersionName.rb b/examples/v2/app-builder/UpdateAppVersionName.rb new file mode 100644 index 000000000000..b321d09ad329 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppVersionName.rb @@ -0,0 +1,14 @@ +# Name App Version returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppVersionNameRequest.new({ + data: DatadogAPIClient::V2::UpdateAppVersionNameRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppVersionNameRequestDataAttributes.new({ + name: "v1.2.0 - bug fix release", + }), + type: DatadogAPIClient::V2::AppVersionNameType::VERSIONNAMES, + }), +}) +api_instance.update_app_version_name("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "version", body) diff --git a/examples/v2/app-builder/UpdateProtectionLevel.rb b/examples/v2/app-builder/UpdateProtectionLevel.rb new file mode 100644 index 000000000000..877c217e4443 --- /dev/null +++ b/examples/v2/app-builder/UpdateProtectionLevel.rb @@ -0,0 +1,14 @@ +# Update App Protection Level returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppProtectionLevelRequest.new({ + data: DatadogAPIClient::V2::UpdateAppProtectionLevelRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppProtectionLevelRequestDataAttributes.new({ + protection_level: DatadogAPIClient::V2::AppProtectionLevel::APPROVAL_REQUIRED, + }), + type: DatadogAPIClient::V2::AppProtectionLevelType::PROTECTIONLEVEL, + }), +}) +p api_instance.update_protection_level("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f88a3c3f133f..a6b889ea283d 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1352,6 +1352,40 @@ "v2.PublishApp" => { "app_id" => "UUID", }, + "v2.UpdateAppFavorite" => { + "app_id" => "UUID", + "body" => "UpdateAppFavoriteRequest", + }, + "v2.UpdateProtectionLevel" => { + "app_id" => "UUID", + "body" => "UpdateAppProtectionLevelRequest", + }, + "v2.CreatePublishRequest" => { + "app_id" => "UUID", + "body" => "CreatePublishRequestRequest", + }, + "v2.RevertApp" => { + "app_id" => "UUID", + "version" => "String", + }, + "v2.UpdateAppSelfService" => { + "app_id" => "UUID", + "body" => "UpdateAppSelfServiceRequest", + }, + "v2.UpdateAppTags" => { + "app_id" => "UUID", + "body" => "UpdateAppTagsRequest", + }, + "v2.UpdateAppVersionName" => { + "app_id" => "UUID", + "version" => "String", + "body" => "UpdateAppVersionNameRequest", + }, + "v2.ListAppVersions" => { + "app_id" => "UUID", + "limit" => "Integer", + "page" => "Integer", + }, "v2.ListAuditLogs" => { "filter_query" => "String", "filter_from" => "Time", diff --git a/features/v2/app_builder.feature b/features/v2/app_builder.feature index 1ef2502e807c..a61d55f15e77 100644 --- a/features/v2/app_builder.feature +++ b/features/v2/app_builder.feature @@ -27,6 +27,30 @@ Feature: App Builder Then the response status is 201 Created And the response "data.type" is equal to "appDefinitions" + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Bad Request" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Created" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Not Found" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend Scenario: Delete App returns "Bad Request" response Given new "DeleteApp" request @@ -115,6 +139,27 @@ Feature: App Builder And the response "data.id" has the same value as "app.data.id" And the response "data.type" is equal to "appDefinitions" + @generated @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "Bad Request" response + Given new "ListAppVersions" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "Not Found" response + Given new "ListAppVersions" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "OK" response + Given new "ListAppVersions" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend Scenario: List Apps returns "Bad Request" response Given new "ListApps" request @@ -127,6 +172,33 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "Bad Request" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "No Content" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "Not Found" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend Scenario: Publish App returns "Bad Request" response Given new "PublishApp" request @@ -149,6 +221,30 @@ Feature: App Builder When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "Bad Request" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "Not Found" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "OK" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/app-builder-backend Scenario: Unpublish App returns "Bad Request" response Given new "UnpublishApp" request @@ -171,6 +267,102 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "Bad Request" response + Given new "UpdateAppFavorite" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "Not Found" response + Given new "UpdateAppFavorite" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "OK" response + Given new "UpdateAppFavorite" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Protection Level returns "Bad Request" response + Given new "UpdateProtectionLevel" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"protectionLevel": "approval_required"}, "type": "protectionLevel"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Protection Level returns "Not Found" response + Given new "UpdateProtectionLevel" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"protectionLevel": "approval_required"}, "type": "protectionLevel"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Protection Level returns "OK" response + Given new "UpdateProtectionLevel" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"protectionLevel": "approval_required"}, "type": "protectionLevel"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Self-Service Status returns "Bad Request" response + Given new "UpdateAppSelfService" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"selfService": true}, "type": "selfService"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Self-Service Status returns "Not Found" response + Given new "UpdateAppSelfService" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"selfService": true}, "type": "selfService"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Self-Service Status returns "OK" response + Given new "UpdateAppSelfService" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"selfService": true}, "type": "selfService"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "Bad Request" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "No Content" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "Not Found" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 404 Not Found + @skip-typescript @team:DataDog/app-builder-backend Scenario: Update App returns "Bad Request" response Given new "UpdateApp" request diff --git a/features/v2/undo.json b/features/v2/undo.json index d5a8323e2702..eab901e5b6e4 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -632,6 +632,61 @@ "type": "idempotent" } }, + "UpdateAppFavorite": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateProtectionLevel": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "CreatePublishRequest": { + "tag": "App Builder", + "undo": { + "operationId": "DeleteApp", + "parameters": [ + { + "name": "app_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RevertApp": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppSelfService": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppTags": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppVersionName": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "ListAppVersions": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, "ListApplicationKeys": { "tag": "Key Management", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 3ba1b16d4765..350c0ebdc6ea 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1204,6 +1204,7 @@ def overrides "v2.app_builder_event_type" => "AppBuilderEventType", "v2.app_definition_type" => "AppDefinitionType", "v2.app_deployment_type" => "AppDeploymentType", + "v2.app_favorite_type" => "AppFavoriteType", "v2.app_key_registration_data" => "AppKeyRegistrationData", "v2.app_key_registration_data_type" => "AppKeyRegistrationDataType", "v2.application_key_create_attributes" => "ApplicationKeyCreateAttributes", @@ -1261,9 +1262,17 @@ def overrides "v2.application_security_waf_exclusion_filter_update_data" => "ApplicationSecurityWafExclusionFilterUpdateData", "v2.application_security_waf_exclusion_filter_update_request" => "ApplicationSecurityWafExclusionFilterUpdateRequest", "v2.app_meta" => "AppMeta", + "v2.app_protection_level" => "AppProtectionLevel", + "v2.app_protection_level_type" => "AppProtectionLevelType", "v2.app_relationship" => "AppRelationship", + "v2.app_self_service_type" => "AppSelfServiceType", "v2.apps_sort_field" => "AppsSortField", + "v2.app_tags_type" => "AppTagsType", "v2.app_trigger_wrapper" => "AppTriggerWrapper", + "v2.app_version" => "AppVersion", + "v2.app_version_attributes" => "AppVersionAttributes", + "v2.app_version_name_type" => "AppVersionNameType", + "v2.app_version_type" => "AppVersionType", "v2.arbitrary_cost_upsert_request" => "ArbitraryCostUpsertRequest", "v2.arbitrary_cost_upsert_request_data" => "ArbitraryCostUpsertRequestData", "v2.arbitrary_cost_upsert_request_data_attributes" => "ArbitraryCostUpsertRequestDataAttributes", @@ -2077,6 +2086,9 @@ def overrides "v2.create_page_response_data" => "CreatePageResponseData", "v2.create_page_response_data_type" => "CreatePageResponseDataType", "v2.create_phone_notification_channel_config" => "CreatePhoneNotificationChannelConfig", + "v2.create_publish_request_request" => "CreatePublishRequestRequest", + "v2.create_publish_request_request_data" => "CreatePublishRequestRequestData", + "v2.create_publish_request_request_data_attributes" => "CreatePublishRequestRequestDataAttributes", "v2.create_rule_request" => "CreateRuleRequest", "v2.create_rule_request_data" => "CreateRuleRequestData", "v2.create_rule_response" => "CreateRuleResponse", @@ -3432,6 +3444,7 @@ def overrides "v2.list_apps_response_data_items_relationships" => "ListAppsResponseDataItemsRelationships", "v2.list_apps_response_meta" => "ListAppsResponseMeta", "v2.list_apps_response_meta_page" => "ListAppsResponseMetaPage", + "v2.list_app_versions_response" => "ListAppVersionsResponse", "v2.list_assets_sbo_ms_response" => "ListAssetsSBOMsResponse", "v2.list_campaigns_response" => "ListCampaignsResponse", "v2.list_connections_response" => "ListConnectionsResponse", @@ -4627,6 +4640,7 @@ def overrides "v2.project_update_attributes" => "ProjectUpdateAttributes", "v2.project_update_request" => "ProjectUpdateRequest", "v2.publish_app_response" => "PublishAppResponse", + "v2.publish_request_type" => "PublishRequestType", "v2.put_apps_datastore_item_response_array" => "PutAppsDatastoreItemResponseArray", "v2.put_apps_datastore_item_response_data" => "PutAppsDatastoreItemResponseData", "v2.put_incident_notification_rule_request" => "PutIncidentNotificationRuleRequest", @@ -6095,6 +6109,12 @@ def overrides "v2.unpublish_app_response" => "UnpublishAppResponse", "v2.update_action_connection_request" => "UpdateActionConnectionRequest", "v2.update_action_connection_response" => "UpdateActionConnectionResponse", + "v2.update_app_favorite_request" => "UpdateAppFavoriteRequest", + "v2.update_app_favorite_request_data" => "UpdateAppFavoriteRequestData", + "v2.update_app_favorite_request_data_attributes" => "UpdateAppFavoriteRequestDataAttributes", + "v2.update_app_protection_level_request" => "UpdateAppProtectionLevelRequest", + "v2.update_app_protection_level_request_data" => "UpdateAppProtectionLevelRequestData", + "v2.update_app_protection_level_request_data_attributes" => "UpdateAppProtectionLevelRequestDataAttributes", "v2.update_app_request" => "UpdateAppRequest", "v2.update_app_request_data" => "UpdateAppRequestData", "v2.update_app_request_data_attributes" => "UpdateAppRequestDataAttributes", @@ -6109,6 +6129,15 @@ def overrides "v2.update_apps_datastore_request" => "UpdateAppsDatastoreRequest", "v2.update_apps_datastore_request_data" => "UpdateAppsDatastoreRequestData", "v2.update_apps_datastore_request_data_attributes" => "UpdateAppsDatastoreRequestDataAttributes", + "v2.update_app_self_service_request" => "UpdateAppSelfServiceRequest", + "v2.update_app_self_service_request_data" => "UpdateAppSelfServiceRequestData", + "v2.update_app_self_service_request_data_attributes" => "UpdateAppSelfServiceRequestDataAttributes", + "v2.update_app_tags_request" => "UpdateAppTagsRequest", + "v2.update_app_tags_request_data" => "UpdateAppTagsRequestData", + "v2.update_app_tags_request_data_attributes" => "UpdateAppTagsRequestDataAttributes", + "v2.update_app_version_name_request" => "UpdateAppVersionNameRequest", + "v2.update_app_version_name_request_data" => "UpdateAppVersionNameRequestData", + "v2.update_app_version_name_request_data_attributes" => "UpdateAppVersionNameRequestDataAttributes", "v2.update_campaign_request" => "UpdateCampaignRequest", "v2.update_campaign_request_attributes" => "UpdateCampaignRequestAttributes", "v2.update_campaign_request_data" => "UpdateCampaignRequestData", diff --git a/lib/datadog_api_client/v2/api/app_builder_api.rb b/lib/datadog_api_client/v2/api/app_builder_api.rb index b8b9468b48bf..00b73ec0b2cb 100644 --- a/lib/datadog_api_client/v2/api/app_builder_api.rb +++ b/lib/datadog_api_client/v2/api/app_builder_api.rb @@ -90,6 +90,78 @@ def create_app_with_http_info(body, opts = {}) return data, status_code, headers end + # Create Publish Request. + # + # @see #create_publish_request_with_http_info + def create_publish_request(app_id, body, opts = {}) + data, _status_code, _headers = create_publish_request_with_http_info(app_id, body, opts) + data + end + + # Create Publish Request. + # + # Create a publish request to ask for approval to publish an app whose protection level is `approval_required`. Publishing happens automatically once the request is approved by a user with the appropriate permissions. + # + # @param app_id [UUID] The ID of the app. + # @param body [CreatePublishRequestRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PublishAppResponse, Integer, Hash)>] PublishAppResponse data, response status code and response headers + def create_publish_request_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.create_publish_request ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.create_publish_request" + 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 AppBuilderAPI.create_publish_request" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/publish-request'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['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] || 'PublishAppResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_publish_request, + :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: AppBuilderAPI#create_publish_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete App. # # @see #delete_app_with_http_info @@ -371,6 +443,75 @@ def list_apps_with_http_info(opts = {}) return data, status_code, headers end + # List App Versions. + # + # @see #list_app_versions_with_http_info + def list_app_versions(app_id, opts = {}) + data, _status_code, _headers = list_app_versions_with_http_info(app_id, opts) + data + end + + # List App Versions. + # + # List the versions of an app. This endpoint is paginated. + # + # @param app_id [UUID] The ID of the app. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :limit The number of versions to return per page. + # @option opts [Integer] :page The page number to return. + # @return [Array<(ListAppVersionsResponse, Integer, Hash)>] ListAppVersionsResponse data, response status code and response headers + def list_app_versions_with_http_info(app_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.list_app_versions ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.list_app_versions" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/versions'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListAppVersionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_app_versions, + :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: AppBuilderAPI#list_app_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Publish App. # # @see #publish_app_with_http_info @@ -436,6 +577,77 @@ def publish_app_with_http_info(app_id, opts = {}) return data, status_code, headers end + # Revert App. + # + # @see #revert_app_with_http_info + def revert_app(app_id, version, opts = {}) + data, _status_code, _headers = revert_app_with_http_info(app_id, version, opts) + data + end + + # Revert App. + # + # Revert an app to a previous version. The version to revert to is selected through the `version` query parameter. The reverted version becomes the new latest version of the app. + # + # @param app_id [UUID] The ID of the app. + # @param version [String] The version number of the app to revert to. Cannot be `latest`. The special value `deployed` can be used to revert to the currently published version. + # @param opts [Hash] the optional parameters + # @return [Array<(UpdateAppResponse, Integer, Hash)>] UpdateAppResponse data, response status code and response headers + def revert_app_with_http_info(app_id, version, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.revert_app ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.revert_app" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling AppBuilderAPI.revert_app" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/revert'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = version + + # 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] || 'UpdateAppResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :revert_app, + :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: AppBuilderAPI#revert_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Unpublish App. # # @see #unpublish_app_with_http_info @@ -572,5 +784,371 @@ def update_app_with_http_info(app_id, body, opts = {}) end return data, status_code, headers end + + # Update App Favorite Status. + # + # @see #update_app_favorite_with_http_info + def update_app_favorite(app_id, body, opts = {}) + update_app_favorite_with_http_info(app_id, body, opts) + nil + end + + # Update App Favorite Status. + # + # Add or remove an app from the current user's favorites. Favorited apps can be filtered for using the `filter[favorite]` query parameter on the [List Apps](https://docs.datadoghq.com/api/latest/app-builder/#list-apps) endpoint. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppFavoriteRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_favorite_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_favorite ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_favorite" + 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 AppBuilderAPI.update_app_favorite" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/favorite'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # 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_app_favorite, + :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: AppBuilderAPI#update_app_favorite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update App Self-Service Status. + # + # @see #update_app_self_service_with_http_info + def update_app_self_service(app_id, body, opts = {}) + update_app_self_service_with_http_info(app_id, body, opts) + nil + end + + # Update App Self-Service Status. + # + # Enable or disable self-service for an app. Self-service apps can be discovered and run by users in your organization without explicit access being granted. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppSelfServiceRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_self_service_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_self_service ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_self_service" + 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 AppBuilderAPI.update_app_self_service" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/self-service'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # 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_app_self_service, + :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: AppBuilderAPI#update_app_self_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update App Tags. + # + # @see #update_app_tags_with_http_info + def update_app_tags(app_id, body, opts = {}) + update_app_tags_with_http_info(app_id, body, opts) + nil + end + + # Update App Tags. + # + # Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not present in the request body are removed. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppTagsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_tags_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_tags ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_tags" + 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 AppBuilderAPI.update_app_tags" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/tags'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # 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_app_tags, + :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: AppBuilderAPI#update_app_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Name App Version. + # + # @see #update_app_version_name_with_http_info + def update_app_version_name(app_id, version, body, opts = {}) + update_app_version_name_with_http_info(app_id, version, body, opts) + nil + end + + # Name App Version. + # + # Assign a human-readable name to a specific version of an app. The version is selected through the `version` query parameter. + # + # @param app_id [UUID] The ID of the app. + # @param version [String] The version number of the app to name. The special values `latest` and `deployed` can also be used to target the latest or currently published version. + # @param body [UpdateAppVersionNameRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_version_name_with_http_info(app_id, version, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_version_name ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_version_name" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling AppBuilderAPI.update_app_version_name" + 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 AppBuilderAPI.update_app_version_name" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/version-name'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = version + + # 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_app_version_name, + :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: AppBuilderAPI#update_app_version_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update App Protection Level. + # + # @see #update_protection_level_with_http_info + def update_protection_level(app_id, body, opts = {}) + data, _status_code, _headers = update_protection_level_with_http_info(app_id, body, opts) + data + end + + # Update App Protection Level. + # + # Update the publication protection level of an app. When set to `approval_required`, future publishes must go through an approval workflow before going live. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppProtectionLevelRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(UpdateAppResponse, Integer, Hash)>] UpdateAppResponse data, response status code and response headers + def update_protection_level_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_protection_level ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_protection_level" + 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 AppBuilderAPI.update_protection_level" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/protection-level'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['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] || 'UpdateAppResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_protection_level, + :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: AppBuilderAPI#update_protection_level\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/app_favorite_type.rb b/lib/datadog_api_client/v2/models/app_favorite_type.rb new file mode 100644 index 000000000000..8d533114ad30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_favorite_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 + # The favorite resource type. + class AppFavoriteType + include BaseEnumModel + + FAVORITES = "favorites".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_protection_level.rb b/lib/datadog_api_client/v2/models/app_protection_level.rb new file mode 100644 index 000000000000..62b0ecc3678e --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_protection_level.rb @@ -0,0 +1,27 @@ +=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 + # The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + class AppProtectionLevel + include BaseEnumModel + + DIRECT_PUBLISH = "direct_publish".freeze + APPROVAL_REQUIRED = "approval_required".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_protection_level_type.rb b/lib/datadog_api_client/v2/models/app_protection_level_type.rb new file mode 100644 index 000000000000..34d0bf657492 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_protection_level_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 + # The protection-level resource type. + class AppProtectionLevelType + include BaseEnumModel + + PROTECTIONLEVEL = "protectionLevel".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_self_service_type.rb b/lib/datadog_api_client/v2/models/app_self_service_type.rb new file mode 100644 index 000000000000..d1ac3547c6ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_self_service_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 + # The self-service resource type. + class AppSelfServiceType + include BaseEnumModel + + SELFSERVICE = "selfService".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_tags_type.rb b/lib/datadog_api_client/v2/models/app_tags_type.rb new file mode 100644 index 000000000000..00a3a0eca05d --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_tags_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 + # The tags resource type. + class AppTagsType + include BaseEnumModel + + TAGS = "tags".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_version.rb b/lib/datadog_api_client/v2/models/app_version.rb new file mode 100644 index 000000000000..2decf602950f --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version.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 + # A version of an app. + class AppVersion + include BaseGenericModel + + # Attributes describing an app version. + attr_accessor :attributes + + # The ID of the app version. + attr_accessor :id + + # The app-version resource type. + attr_accessor :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' => :'AppVersionAttributes', + :'id' => :'UUID', + :'type' => :'AppVersionType' + } + 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::AppVersion` 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 + + # 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/app_version_attributes.rb b/lib/datadog_api_client/v2/models/app_version_attributes.rb new file mode 100644 index 000000000000..0ac2e1be6c12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version_attributes.rb @@ -0,0 +1,185 @@ +=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 describing an app version. + class AppVersionAttributes + include BaseGenericModel + + # The ID of the app this version belongs to. + attr_accessor :app_id + + # Timestamp of when the version was created. + attr_accessor :created_at + + # Whether this version has ever been published. + attr_accessor :has_ever_been_published + + # The optional human-readable name of the version. + attr_accessor :name + + # Timestamp of when the version was last updated. + attr_accessor :updated_at + + # The ID of the user who created the version. + attr_accessor :user_id + + # The name (or email) of the user who created the version. + attr_accessor :user_name + + # The UUID of the user who created the version. + attr_accessor :user_uuid + + # The version number of the app, starting at 1. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'app_id' => :'app_id', + :'created_at' => :'created_at', + :'has_ever_been_published' => :'has_ever_been_published', + :'name' => :'name', + :'updated_at' => :'updated_at', + :'user_id' => :'user_id', + :'user_name' => :'user_name', + :'user_uuid' => :'user_uuid', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'app_id' => :'UUID', + :'created_at' => :'Time', + :'has_ever_been_published' => :'Boolean', + :'name' => :'String', + :'updated_at' => :'Time', + :'user_id' => :'Integer', + :'user_name' => :'String', + :'user_uuid' => :'UUID', + :'version' => :'Integer' + } + 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::AppVersionAttributes` 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?(:'app_id') + self.app_id = attributes[:'app_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'has_ever_been_published') + self.has_ever_been_published = attributes[:'has_ever_been_published'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + 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 && + app_id == o.app_id && + created_at == o.created_at && + has_ever_been_published == o.has_ever_been_published && + name == o.name && + updated_at == o.updated_at && + user_id == o.user_id && + user_name == o.user_name && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [app_id, created_at, has_ever_been_published, name, updated_at, user_id, user_name, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/app_version_name_type.rb b/lib/datadog_api_client/v2/models/app_version_name_type.rb new file mode 100644 index 000000000000..926842a6703a --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version_name_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 + # The version-name resource type. + class AppVersionNameType + include BaseEnumModel + + VERSIONNAMES = "versionNames".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_version_type.rb b/lib/datadog_api_client/v2/models/app_version_type.rb new file mode 100644 index 000000000000..57b337b1e970 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version_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 + # The app-version resource type. + class AppVersionType + include BaseEnumModel + + APPVERSIONS = "appVersions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_publish_request_request.rb b/lib/datadog_api_client/v2/models/create_publish_request_request.rb new file mode 100644 index 000000000000..a8eb0571ffa4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_publish_request_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 + # A request to ask for approval to publish an app whose protection level is `approval_required`. + class CreatePublishRequestRequest + include BaseGenericModel + + # Data for creating a publish request. + 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' => :'CreatePublishRequestRequestData' + } + 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::CreatePublishRequestRequest` 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_publish_request_request_data.rb b/lib/datadog_api_client/v2/models/create_publish_request_request_data.rb new file mode 100644 index 000000000000..098e2c787290 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_publish_request_request_data.rb @@ -0,0 +1,115 @@ +=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 creating a publish request. + class CreatePublishRequestRequestData + include BaseGenericModel + + # Attributes for creating a publish request. + attr_accessor :attributes + + # The publish-request resource type. + attr_accessor :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' => :'CreatePublishRequestRequestDataAttributes', + :'type' => :'PublishRequestType' + } + 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::CreatePublishRequestRequestData` 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 + + # 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_publish_request_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_publish_request_request_data_attributes.rb new file mode 100644 index 000000000000..46e6e006ec21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_publish_request_request_data_attributes.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 + # Attributes for creating a publish request. + class CreatePublishRequestRequestDataAttributes + include BaseGenericModel + + # An optional description of the changes in this publish request. + attr_accessor :description + + # A short title for the publish request. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'title' => :'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::CreatePublishRequestRequestDataAttributes` 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?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 @title.nil? + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + 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 && + description == o.description && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_app_versions_response.rb b/lib/datadog_api_client/v2/models/list_app_versions_response.rb new file mode 100644 index 000000000000..f45a6faf35a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_app_versions_response.rb @@ -0,0 +1,117 @@ +=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 paginated list of versions for an app. + class ListAppVersionsResponse + include BaseGenericModel + + # The list of app versions. + attr_accessor :data + + # Pagination metadata. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ListAppsResponseMeta' + } + 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::ListAppVersionsResponse` 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?(:'meta') + self.meta = attributes[:'meta'] + 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 && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/publish_request_type.rb b/lib/datadog_api_client/v2/models/publish_request_type.rb new file mode 100644 index 000000000000..1b0a2e144e1e --- /dev/null +++ b/lib/datadog_api_client/v2/models/publish_request_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 + # The publish-request resource type. + class PublishRequestType + include BaseEnumModel + + PUBLISHREQUEST = "publishRequest".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_favorite_request.rb b/lib/datadog_api_client/v2/models/update_app_favorite_request.rb new file mode 100644 index 000000000000..c8f0c704bcbd --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_favorite_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 + # A request to add or remove an app from the current user's favorites. + class UpdateAppFavoriteRequest + include BaseGenericModel + + # Data for updating an app's favorite status. + 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' => :'UpdateAppFavoriteRequestData' + } + 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::UpdateAppFavoriteRequest` 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/update_app_favorite_request_data.rb b/lib/datadog_api_client/v2/models/update_app_favorite_request_data.rb new file mode 100644 index 000000000000..a1adf5faedec --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_favorite_request_data.rb @@ -0,0 +1,115 @@ +=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 app's favorite status. + class UpdateAppFavoriteRequestData + include BaseGenericModel + + # Attributes for updating an app's favorite status. + attr_accessor :attributes + + # The favorite resource type. + attr_accessor :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' => :'UpdateAppFavoriteRequestDataAttributes', + :'type' => :'AppFavoriteType' + } + 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::UpdateAppFavoriteRequestData` 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 + + # 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/update_app_favorite_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_favorite_request_data_attributes.rb new file mode 100644 index 000000000000..ee37d7adbd32 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_favorite_request_data_attributes.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 + # Attributes for updating an app's favorite status. + class UpdateAppFavoriteRequestDataAttributes + include BaseGenericModel + + # Whether the app should be marked as a favorite for the current user. + attr_reader :favorite + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'favorite' => :'favorite' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'favorite' => :'Boolean' + } + 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::UpdateAppFavoriteRequestDataAttributes` 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?(:'favorite') + self.favorite = attributes[:'favorite'] + 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 @favorite.nil? + true + end + + # Custom attribute writer method with validation + # @param favorite [Object] Object to be assigned + # @!visibility private + def favorite=(favorite) + if favorite.nil? + fail ArgumentError, 'invalid value for "favorite", favorite cannot be nil.' + end + @favorite = favorite + 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 && + favorite == o.favorite && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [favorite, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_protection_level_request.rb b/lib/datadog_api_client/v2/models/update_app_protection_level_request.rb new file mode 100644 index 000000000000..a4ccd3d21132 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_protection_level_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 + # A request to update an app's publication protection level. + class UpdateAppProtectionLevelRequest + include BaseGenericModel + + # Data for updating an app's publication protection level. + 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' => :'UpdateAppProtectionLevelRequestData' + } + 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::UpdateAppProtectionLevelRequest` 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/update_app_protection_level_request_data.rb b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data.rb new file mode 100644 index 000000000000..3e6815ae1e10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data.rb @@ -0,0 +1,115 @@ +=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 app's publication protection level. + class UpdateAppProtectionLevelRequestData + include BaseGenericModel + + # Attributes for updating an app's publication protection level. + attr_accessor :attributes + + # The protection-level resource type. + attr_accessor :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' => :'UpdateAppProtectionLevelRequestDataAttributes', + :'type' => :'AppProtectionLevelType' + } + 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::UpdateAppProtectionLevelRequestData` 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 + + # 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/update_app_protection_level_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data_attributes.rb new file mode 100644 index 000000000000..f184036b0999 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data_attributes.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 + # Attributes for updating an app's publication protection level. + class UpdateAppProtectionLevelRequestDataAttributes + include BaseGenericModel + + # The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + attr_reader :protection_level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'protection_level' => :'protectionLevel' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'protection_level' => :'AppProtectionLevel' + } + 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::UpdateAppProtectionLevelRequestDataAttributes` 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?(:'protection_level') + self.protection_level = attributes[:'protection_level'] + 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 @protection_level.nil? + true + end + + # Custom attribute writer method with validation + # @param protection_level [Object] Object to be assigned + # @!visibility private + def protection_level=(protection_level) + if protection_level.nil? + fail ArgumentError, 'invalid value for "protection_level", protection_level cannot be nil.' + end + @protection_level = protection_level + 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 && + protection_level == o.protection_level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [protection_level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_self_service_request.rb b/lib/datadog_api_client/v2/models/update_app_self_service_request.rb new file mode 100644 index 000000000000..07bfb8239568 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_self_service_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 + # A request to enable or disable self-service for an app. + class UpdateAppSelfServiceRequest + include BaseGenericModel + + # Data for updating an app's self-service status. + 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' => :'UpdateAppSelfServiceRequestData' + } + 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::UpdateAppSelfServiceRequest` 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/update_app_self_service_request_data.rb b/lib/datadog_api_client/v2/models/update_app_self_service_request_data.rb new file mode 100644 index 000000000000..d3fb07b0cb92 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_self_service_request_data.rb @@ -0,0 +1,115 @@ +=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 app's self-service status. + class UpdateAppSelfServiceRequestData + include BaseGenericModel + + # Attributes for updating an app's self-service status. + attr_accessor :attributes + + # The self-service resource type. + attr_accessor :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' => :'UpdateAppSelfServiceRequestDataAttributes', + :'type' => :'AppSelfServiceType' + } + 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::UpdateAppSelfServiceRequestData` 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 + + # 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/update_app_self_service_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_self_service_request_data_attributes.rb new file mode 100644 index 000000000000..306b33b0cb7d --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_self_service_request_data_attributes.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 + # Attributes for updating an app's self-service status. + class UpdateAppSelfServiceRequestDataAttributes + include BaseGenericModel + + # Whether the app is enabled for self-service. + attr_reader :self_service + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'self_service' => :'selfService' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'self_service' => :'Boolean' + } + 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::UpdateAppSelfServiceRequestDataAttributes` 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?(:'self_service') + self.self_service = attributes[:'self_service'] + 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 @self_service.nil? + true + end + + # Custom attribute writer method with validation + # @param self_service [Object] Object to be assigned + # @!visibility private + def self_service=(self_service) + if self_service.nil? + fail ArgumentError, 'invalid value for "self_service", self_service cannot be nil.' + end + @self_service = self_service + 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 && + self_service == o.self_service && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [self_service, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_tags_request.rb b/lib/datadog_api_client/v2/models/update_app_tags_request.rb new file mode 100644 index 000000000000..8eff4e23c5a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_tags_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 + # A request to replace the tags on an app. + class UpdateAppTagsRequest + include BaseGenericModel + + # Data for replacing an app's tags. + 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' => :'UpdateAppTagsRequestData' + } + 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::UpdateAppTagsRequest` 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/update_app_tags_request_data.rb b/lib/datadog_api_client/v2/models/update_app_tags_request_data.rb new file mode 100644 index 000000000000..c94df12a60fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_tags_request_data.rb @@ -0,0 +1,115 @@ +=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 replacing an app's tags. + class UpdateAppTagsRequestData + include BaseGenericModel + + # Attributes for replacing an app's tags. + attr_accessor :attributes + + # The tags resource type. + attr_accessor :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' => :'UpdateAppTagsRequestDataAttributes', + :'type' => :'AppTagsType' + } + 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::UpdateAppTagsRequestData` 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 + + # 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/update_app_tags_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_tags_request_data_attributes.rb new file mode 100644 index 000000000000..11a7cd1d1005 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_tags_request_data_attributes.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 + # Attributes for replacing an app's tags. + class UpdateAppTagsRequestDataAttributes + include BaseGenericModel + + # The full list of tags that should be set on the app. Existing tags not present in this list are removed. + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'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::UpdateAppTagsRequestDataAttributes` 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?(:'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 @tags.nil? + true + 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 && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_version_name_request.rb b/lib/datadog_api_client/v2/models/update_app_version_name_request.rb new file mode 100644 index 000000000000..a3e19fcbb0e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_version_name_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 + # A request to assign a human-readable name to a specific app version. + class UpdateAppVersionNameRequest + include BaseGenericModel + + # Data for naming a specific app version. + 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' => :'UpdateAppVersionNameRequestData' + } + 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::UpdateAppVersionNameRequest` 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/update_app_version_name_request_data.rb b/lib/datadog_api_client/v2/models/update_app_version_name_request_data.rb new file mode 100644 index 000000000000..9ecb2d346d9c --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_version_name_request_data.rb @@ -0,0 +1,115 @@ +=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 naming a specific app version. + class UpdateAppVersionNameRequestData + include BaseGenericModel + + # Attributes for naming a specific app version. + attr_accessor :attributes + + # The version-name resource type. + attr_accessor :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' => :'UpdateAppVersionNameRequestDataAttributes', + :'type' => :'AppVersionNameType' + } + 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::UpdateAppVersionNameRequestData` 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 + + # 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/update_app_version_name_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_version_name_request_data_attributes.rb new file mode 100644 index 000000000000..1978da593fca --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_version_name_request_data_attributes.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 + # Attributes for naming a specific app version. + class UpdateAppVersionNameRequestDataAttributes + include BaseGenericModel + + # The name to assign to the app version. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'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::UpdateAppVersionNameRequestDataAttributes` 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?(:'name') + self.name = attributes[:'name'] + 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 @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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 && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, additional_properties].hash + end + end +end