diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 440627d7e6b..49086bdc75d 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.java b/examples/v2/app-builder/CreatePublishRequest.java new file mode 100644 index 00000000000..668c7480cea --- /dev/null +++ b/examples/v2/app-builder/CreatePublishRequest.java @@ -0,0 +1,41 @@ +// Create Publish Request returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.CreatePublishRequestRequest; +import com.datadog.api.client.v2.model.CreatePublishRequestRequestData; +import com.datadog.api.client.v2.model.CreatePublishRequestRequestDataAttributes; +import com.datadog.api.client.v2.model.PublishAppResponse; +import com.datadog.api.client.v2.model.PublishRequestType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + CreatePublishRequestRequest body = + new CreatePublishRequestRequest() + .data( + new CreatePublishRequestRequestData() + .attributes( + new CreatePublishRequestRequestDataAttributes() + .description("Adds new dashboard widgets and a few bug fixes.") + .title("Release v1.2 to production")) + .type(PublishRequestType.PUBLISHREQUEST)); + + try { + PublishAppResponse result = + apiInstance.createPublishRequest( + UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#createPublishRequest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/ListAppVersions.java b/examples/v2/app-builder/ListAppVersions.java new file mode 100644 index 00000000000..8c057e5b23c --- /dev/null +++ b/examples/v2/app-builder/ListAppVersions.java @@ -0,0 +1,26 @@ +// List App Versions returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.ListAppVersionsResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + try { + ListAppVersionsResponse result = + apiInstance.listAppVersions(UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#listAppVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/RevertApp.java b/examples/v2/app-builder/RevertApp.java new file mode 100644 index 00000000000..5839ce1fe5c --- /dev/null +++ b/examples/v2/app-builder/RevertApp.java @@ -0,0 +1,26 @@ +// Revert App returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.UpdateAppResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + try { + UpdateAppResponse result = + apiInstance.revertApp(UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), "2"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#revertApp"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/UpdateAppFavorite.java b/examples/v2/app-builder/UpdateAppFavorite.java new file mode 100644 index 00000000000..7287651e731 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppFavorite.java @@ -0,0 +1,34 @@ +// Update App Favorite Status returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.AppFavoriteType; +import com.datadog.api.client.v2.model.UpdateAppFavoriteRequest; +import com.datadog.api.client.v2.model.UpdateAppFavoriteRequestData; +import com.datadog.api.client.v2.model.UpdateAppFavoriteRequestDataAttributes; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + UpdateAppFavoriteRequest body = + new UpdateAppFavoriteRequest() + .data( + new UpdateAppFavoriteRequestData() + .attributes(new UpdateAppFavoriteRequestDataAttributes().favorite(true)) + .type(AppFavoriteType.FAVORITES)); + + try { + apiInstance.updateAppFavorite(UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), body); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#updateAppFavorite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/UpdateAppSelfService.java b/examples/v2/app-builder/UpdateAppSelfService.java new file mode 100644 index 00000000000..d535ce7b849 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppSelfService.java @@ -0,0 +1,35 @@ +// Update App Self-Service Status returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.AppSelfServiceType; +import com.datadog.api.client.v2.model.UpdateAppSelfServiceRequest; +import com.datadog.api.client.v2.model.UpdateAppSelfServiceRequestData; +import com.datadog.api.client.v2.model.UpdateAppSelfServiceRequestDataAttributes; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + UpdateAppSelfServiceRequest body = + new UpdateAppSelfServiceRequest() + .data( + new UpdateAppSelfServiceRequestData() + .attributes(new UpdateAppSelfServiceRequestDataAttributes().selfService(true)) + .type(AppSelfServiceType.SELFSERVICE)); + + try { + apiInstance.updateAppSelfService( + UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), body); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#updateAppSelfService"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/UpdateAppTags.java b/examples/v2/app-builder/UpdateAppTags.java new file mode 100644 index 00000000000..942e89985f5 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppTags.java @@ -0,0 +1,37 @@ +// Update App Tags returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.AppTagsType; +import com.datadog.api.client.v2.model.UpdateAppTagsRequest; +import com.datadog.api.client.v2.model.UpdateAppTagsRequestData; +import com.datadog.api.client.v2.model.UpdateAppTagsRequestDataAttributes; +import java.util.Arrays; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + UpdateAppTagsRequest body = + new UpdateAppTagsRequest() + .data( + new UpdateAppTagsRequestData() + .attributes( + new UpdateAppTagsRequestDataAttributes() + .tags(Arrays.asList("team:platform", "service:ops"))) + .type(AppTagsType.TAGS)); + + try { + apiInstance.updateAppTags(UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), body); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#updateAppTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/UpdateAppVersionName.java b/examples/v2/app-builder/UpdateAppVersionName.java new file mode 100644 index 00000000000..9d775544e1b --- /dev/null +++ b/examples/v2/app-builder/UpdateAppVersionName.java @@ -0,0 +1,37 @@ +// Name App Version returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.AppVersionNameType; +import com.datadog.api.client.v2.model.UpdateAppVersionNameRequest; +import com.datadog.api.client.v2.model.UpdateAppVersionNameRequestData; +import com.datadog.api.client.v2.model.UpdateAppVersionNameRequestDataAttributes; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + UpdateAppVersionNameRequest body = + new UpdateAppVersionNameRequest() + .data( + new UpdateAppVersionNameRequestData() + .attributes( + new UpdateAppVersionNameRequestDataAttributes() + .name("v1.2.0 - bug fix release")) + .type(AppVersionNameType.VERSIONNAMES)); + + try { + apiInstance.updateAppVersionName( + UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), "3", body); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#updateAppVersionName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/app-builder/UpdateProtectionLevel.java b/examples/v2/app-builder/UpdateProtectionLevel.java new file mode 100644 index 00000000000..c99f8715b5a --- /dev/null +++ b/examples/v2/app-builder/UpdateProtectionLevel.java @@ -0,0 +1,41 @@ +// Update App Protection Level returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AppBuilderApi; +import com.datadog.api.client.v2.model.AppProtectionLevel; +import com.datadog.api.client.v2.model.AppProtectionLevelType; +import com.datadog.api.client.v2.model.UpdateAppProtectionLevelRequest; +import com.datadog.api.client.v2.model.UpdateAppProtectionLevelRequestData; +import com.datadog.api.client.v2.model.UpdateAppProtectionLevelRequestDataAttributes; +import com.datadog.api.client.v2.model.UpdateAppResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AppBuilderApi apiInstance = new AppBuilderApi(defaultClient); + + UpdateAppProtectionLevelRequest body = + new UpdateAppProtectionLevelRequest() + .data( + new UpdateAppProtectionLevelRequestData() + .attributes( + new UpdateAppProtectionLevelRequestDataAttributes() + .protectionLevel(AppProtectionLevel.APPROVAL_REQUIRED)) + .type(AppProtectionLevelType.PROTECTIONLEVEL)); + + try { + UpdateAppResponse result = + apiInstance.updateProtectionLevel( + UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AppBuilderApi#updateProtectionLevel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java b/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java index 8711c0a1ffa..52fb9113c42 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AppBuilderApi.java @@ -7,15 +7,22 @@ import com.datadog.api.client.v2.model.AppsSortField; import com.datadog.api.client.v2.model.CreateAppRequest; import com.datadog.api.client.v2.model.CreateAppResponse; +import com.datadog.api.client.v2.model.CreatePublishRequestRequest; import com.datadog.api.client.v2.model.DeleteAppResponse; import com.datadog.api.client.v2.model.DeleteAppsRequest; import com.datadog.api.client.v2.model.DeleteAppsResponse; import com.datadog.api.client.v2.model.GetAppResponse; +import com.datadog.api.client.v2.model.ListAppVersionsResponse; import com.datadog.api.client.v2.model.ListAppsResponse; import com.datadog.api.client.v2.model.PublishAppResponse; import com.datadog.api.client.v2.model.UnpublishAppResponse; +import com.datadog.api.client.v2.model.UpdateAppFavoriteRequest; +import com.datadog.api.client.v2.model.UpdateAppProtectionLevelRequest; import com.datadog.api.client.v2.model.UpdateAppRequest; import com.datadog.api.client.v2.model.UpdateAppResponse; +import com.datadog.api.client.v2.model.UpdateAppSelfServiceRequest; +import com.datadog.api.client.v2.model.UpdateAppTagsRequest; +import com.datadog.api.client.v2.model.UpdateAppVersionNameRequest; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -189,6 +196,165 @@ public CompletableFuture> createAppWithHttpInfoAs new GenericType() {}); } + /** + * Create Publish Request. + * + *

See {@link #createPublishRequestWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return PublishAppResponse + * @throws ApiException if fails to make API call + */ + public PublishAppResponse createPublishRequest(UUID appId, CreatePublishRequestRequest body) + throws ApiException { + return createPublishRequestWithHttpInfo(appId, body).getData(); + } + + /** + * Create Publish Request. + * + *

See {@link #createPublishRequestWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture<PublishAppResponse> + */ + public CompletableFuture createPublishRequestAsync( + UUID appId, CreatePublishRequestRequest body) { + return createPublishRequestWithHttpInfoAsync(appId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 appId The ID of the app. (required) + * @param body (required) + * @return ApiResponse<PublishAppResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createPublishRequestWithHttpInfo( + UUID appId, CreatePublishRequestRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling createPublishRequest"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createPublishRequest"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/publish-request" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.createPublishRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create Publish Request. + * + *

See {@link #createPublishRequestWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<PublishAppResponse>> + */ + public CompletableFuture> createPublishRequestWithHttpInfoAsync( + UUID appId, CreatePublishRequestRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appId' when calling createPublishRequest")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createPublishRequest")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/publish-request" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.createPublishRequest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Delete App. * @@ -997,29 +1163,57 @@ public CompletableFuture> listAppsWithHttpInfoAsyn new GenericType() {}); } + /** Manage optional parameters to listAppVersions. */ + public static class ListAppVersionsOptionalParameters { + private Long limit; + private Long page; + + /** + * Set limit. + * + * @param limit The number of versions to return per page. (optional) + * @return ListAppVersionsOptionalParameters + */ + public ListAppVersionsOptionalParameters limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Set page. + * + * @param page The page number to return. (optional) + * @return ListAppVersionsOptionalParameters + */ + public ListAppVersionsOptionalParameters page(Long page) { + this.page = page; + return this; + } + } + /** - * Publish App. + * List App Versions. * - *

See {@link #publishAppWithHttpInfo}. + *

See {@link #listAppVersionsWithHttpInfo}. * - * @param appId The ID of the app to publish. (required) - * @return PublishAppResponse + * @param appId The ID of the app. (required) + * @return ListAppVersionsResponse * @throws ApiException if fails to make API call */ - public PublishAppResponse publishApp(UUID appId) throws ApiException { - return publishAppWithHttpInfo(appId).getData(); + public ListAppVersionsResponse listAppVersions(UUID appId) throws ApiException { + return listAppVersionsWithHttpInfo(appId, new ListAppVersionsOptionalParameters()).getData(); } /** - * Publish App. + * List App Versions. * - *

See {@link #publishAppWithHttpInfoAsync}. + *

See {@link #listAppVersionsWithHttpInfoAsync}. * - * @param appId The ID of the app to publish. (required) - * @return CompletableFuture<PublishAppResponse> + * @param appId The ID of the app. (required) + * @return CompletableFuture<ListAppVersionsResponse> */ - public CompletableFuture publishAppAsync(UUID appId) { - return publishAppWithHttpInfoAsync(appId) + public CompletableFuture listAppVersionsAsync(UUID appId) { + return listAppVersionsWithHttpInfoAsync(appId, new ListAppVersionsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -1027,139 +1221,1100 @@ public CompletableFuture publishAppAsync(UUID appId) { } /** - * Publish an app for use by other users. To ensure the app is accessible to the correct users, - * you also need to set a Restriction Policy on - * the app if a policy does not yet exist. This API requires a registered - * application key. Alternatively, you can configure these permissions in the - * UI. + * List App Versions. * - * @param appId The ID of the app to publish. (required) - * @return ApiResponse<PublishAppResponse> + *

See {@link #listAppVersionsWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param parameters Optional parameters for the request. + * @return ListAppVersionsResponse + * @throws ApiException if fails to make API call + */ + public ListAppVersionsResponse listAppVersions( + UUID appId, ListAppVersionsOptionalParameters parameters) throws ApiException { + return listAppVersionsWithHttpInfo(appId, parameters).getData(); + } + + /** + * List App Versions. + * + *

See {@link #listAppVersionsWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListAppVersionsResponse> + */ + public CompletableFuture listAppVersionsAsync( + UUID appId, ListAppVersionsOptionalParameters parameters) { + return listAppVersionsWithHttpInfoAsync(appId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List the versions of an app. This endpoint is paginated. + * + * @param appId The ID of the app. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListAppVersionsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * * *
Response details
Status Code Description Response Headers
201 Created -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse publishAppWithHttpInfo(UUID appId) throws ApiException { + public ApiResponse listAppVersionsWithHttpInfo( + UUID appId, ListAppVersionsOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException(400, "Missing the required parameter 'appId' when calling publishApp"); + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling listAppVersions"); } + Long limit = parameters.limit; + Long page = parameters.page; // create path and map variables String localVarPath = - "/api/v2/app-builder/apps/{app_id}/deployment" + "/api/v2/app-builder/apps/{app_id}/versions" .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.AppBuilderApi.publishApp", + "v2.AppBuilderApi.listAppVersions", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "POST", + "GET", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Publish App. + * List App Versions. * - *

See {@link #publishAppWithHttpInfo}. + *

See {@link #listAppVersionsWithHttpInfo}. * - * @param appId The ID of the app to publish. (required) - * @return CompletableFuture<ApiResponse<PublishAppResponse>> + * @param appId The ID of the app. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListAppVersionsResponse>> */ - public CompletableFuture> publishAppWithHttpInfoAsync( - UUID appId) { + public CompletableFuture> listAppVersionsWithHttpInfoAsync( + UUID appId, ListAppVersionsOptionalParameters parameters) { Object localVarPostBody = null; // verify the required parameter 'appId' is set if (appId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'appId' when calling publishApp")); + new ApiException( + 400, "Missing the required parameter 'appId' when calling listAppVersions")); return result; } + Long limit = parameters.limit; + Long page = parameters.page; // create path and map variables String localVarPath = - "/api/v2/app-builder/apps/{app_id}/deployment" + "/api/v2/app-builder/apps/{app_id}/versions" .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page", page)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.AppBuilderApi.publishApp", + "v2.AppBuilderApi.listAppVersions", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "GET", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Unpublish App. + * Publish App. * - *

See {@link #unpublishAppWithHttpInfo}. + *

See {@link #publishAppWithHttpInfo}. * - * @param appId The ID of the app to unpublish. (required) - * @return UnpublishAppResponse + * @param appId The ID of the app to publish. (required) + * @return PublishAppResponse * @throws ApiException if fails to make API call */ - public UnpublishAppResponse unpublishApp(UUID appId) throws ApiException { - return unpublishAppWithHttpInfo(appId).getData(); + public PublishAppResponse publishApp(UUID appId) throws ApiException { + return publishAppWithHttpInfo(appId).getData(); } /** - * Unpublish App. + * Publish App. * - *

See {@link #unpublishAppWithHttpInfoAsync}. + *

See {@link #publishAppWithHttpInfoAsync}. * - * @param appId The ID of the app to unpublish. (required) - * @return CompletableFuture<UnpublishAppResponse> + * @param appId The ID of the app to publish. (required) + * @return CompletableFuture<PublishAppResponse> */ - public CompletableFuture unpublishAppAsync(UUID appId) { - return unpublishAppWithHttpInfoAsync(appId) + public CompletableFuture publishAppAsync(UUID appId) { + return publishAppWithHttpInfoAsync(appId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Publish an app for use by other users. To ensure the app is accessible to the correct users, + * you also need to set a Restriction Policy on + * the app if a policy does not yet exist. This API requires a registered + * application key. Alternatively, you can configure these permissions in the + * UI. + * + * @param appId The ID of the app to publish. (required) + * @return ApiResponse<PublishAppResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse publishAppWithHttpInfo(UUID appId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException(400, "Missing the required parameter 'appId' when calling publishApp"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/deployment" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.publishApp", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Publish App. + * + *

See {@link #publishAppWithHttpInfo}. + * + * @param appId The ID of the app to publish. (required) + * @return CompletableFuture<ApiResponse<PublishAppResponse>> + */ + public CompletableFuture> publishAppWithHttpInfoAsync( + UUID appId) { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'appId' when calling publishApp")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/deployment" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.publishApp", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Revert App. + * + *

See {@link #revertAppWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @return UpdateAppResponse + * @throws ApiException if fails to make API call + */ + public UpdateAppResponse revertApp(UUID appId, String version) throws ApiException { + return revertAppWithHttpInfo(appId, version).getData(); + } + + /** + * Revert App. + * + *

See {@link #revertAppWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @return CompletableFuture<UpdateAppResponse> + */ + public CompletableFuture revertAppAsync(UUID appId, String version) { + return revertAppWithHttpInfoAsync(appId, version) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 appId The ID of the app. (required) + * @param version 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. (required) + * @return ApiResponse<UpdateAppResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse revertAppWithHttpInfo(UUID appId, String version) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException(400, "Missing the required parameter 'appId' when calling revertApp"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, "Missing the required parameter 'version' when calling revertApp"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/revert" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "version", version)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.revertApp", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Revert App. + * + *

See {@link #revertAppWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @return CompletableFuture<ApiResponse<UpdateAppResponse>> + */ + public CompletableFuture> revertAppWithHttpInfoAsync( + UUID appId, String version) { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'appId' when calling revertApp")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'version' when calling revertApp")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/revert" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "version", version)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.revertApp", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unpublish App. + * + *

See {@link #unpublishAppWithHttpInfo}. + * + * @param appId The ID of the app to unpublish. (required) + * @return UnpublishAppResponse + * @throws ApiException if fails to make API call + */ + public UnpublishAppResponse unpublishApp(UUID appId) throws ApiException { + return unpublishAppWithHttpInfo(appId).getData(); + } + + /** + * Unpublish App. + * + *

See {@link #unpublishAppWithHttpInfoAsync}. + * + * @param appId The ID of the app to unpublish. (required) + * @return CompletableFuture<UnpublishAppResponse> + */ + public CompletableFuture unpublishAppAsync(UUID appId) { + return unpublishAppWithHttpInfoAsync(appId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of + * a deployment object on the app, with a nil app_version_id ( + * 00000000-0000-0000-0000-000000000000). The app can still be updated and published again + * in the future. This API requires a registered + * application key. Alternatively, you can configure these permissions in the + * UI. + * + * @param appId The ID of the app to unpublish. (required) + * @return ApiResponse<UnpublishAppResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unpublishAppWithHttpInfo(UUID appId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling unpublishApp"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/deployment" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.unpublishApp", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Unpublish App. + * + *

See {@link #unpublishAppWithHttpInfo}. + * + * @param appId The ID of the app to unpublish. (required) + * @return CompletableFuture<ApiResponse<UnpublishAppResponse>> + */ + public CompletableFuture> unpublishAppWithHttpInfoAsync( + UUID appId) { + Object localVarPostBody = null; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appId' when calling unpublishApp")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/deployment" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.unpublishApp", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update App. + * + *

See {@link #updateAppWithHttpInfo}. + * + * @param appId The ID of the app to update. (required) + * @param body (required) + * @return UpdateAppResponse + * @throws ApiException if fails to make API call + */ + public UpdateAppResponse updateApp(UUID appId, UpdateAppRequest body) throws ApiException { + return updateAppWithHttpInfo(appId, body).getData(); + } + + /** + * Update App. + * + *

See {@link #updateAppWithHttpInfoAsync}. + * + * @param appId The ID of the app to update. (required) + * @param body (required) + * @return CompletableFuture<UpdateAppResponse> + */ + public CompletableFuture updateAppAsync(UUID appId, UpdateAppRequest body) { + return updateAppWithHttpInfoAsync(appId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update an existing app. This creates a new version of the app. This API requires a registered + * application key. Alternatively, you can configure these permissions in the + * UI. + * + * @param appId The ID of the app to update. (required) + * @param body (required) + * @return ApiResponse<UpdateAppResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse updateAppWithHttpInfo(UUID appId, UpdateAppRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException(400, "Missing the required parameter 'appId' when calling updateApp"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateApp"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateApp", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update App. + * + *

See {@link #updateAppWithHttpInfo}. + * + * @param appId The ID of the app to update. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<UpdateAppResponse>> + */ + public CompletableFuture> updateAppWithHttpInfoAsync( + UUID appId, UpdateAppRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'appId' when calling updateApp")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling updateApp")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateApp", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update App Favorite Status. + * + *

See {@link #updateAppFavoriteWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateAppFavorite(UUID appId, UpdateAppFavoriteRequest body) throws ApiException { + updateAppFavoriteWithHttpInfo(appId, body); + } + + /** + * Update App Favorite Status. + * + *

See {@link #updateAppFavoriteWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateAppFavoriteAsync(UUID appId, UpdateAppFavoriteRequest body) { + return updateAppFavoriteWithHttpInfoAsync(appId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 endpoint. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateAppFavoriteWithHttpInfo(UUID appId, UpdateAppFavoriteRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling updateAppFavorite"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppFavorite"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/favorite" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateAppFavorite", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update App Favorite Status. + * + *

See {@link #updateAppFavoriteWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateAppFavoriteWithHttpInfoAsync( + UUID appId, UpdateAppFavoriteRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appId' when calling updateAppFavorite")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppFavorite")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/favorite" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateAppFavorite", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update App Self-Service Status. + * + *

See {@link #updateAppSelfServiceWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateAppSelfService(UUID appId, UpdateAppSelfServiceRequest body) + throws ApiException { + updateAppSelfServiceWithHttpInfo(appId, body); + } + + /** + * Update App Self-Service Status. + * + *

See {@link #updateAppSelfServiceWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateAppSelfServiceAsync( + UUID appId, UpdateAppSelfServiceRequest body) { + return updateAppSelfServiceWithHttpInfoAsync(appId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 appId The ID of the app. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateAppSelfServiceWithHttpInfo( + UUID appId, UpdateAppSelfServiceRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling updateAppSelfService"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppSelfService"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/self-service" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateAppSelfService", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update App Self-Service Status. + * + *

See {@link #updateAppSelfServiceWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateAppSelfServiceWithHttpInfoAsync( + UUID appId, UpdateAppSelfServiceRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appId' when calling updateAppSelfService")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppSelfService")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/self-service" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateAppSelfService", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update App Tags. + * + *

See {@link #updateAppTagsWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateAppTags(UUID appId, UpdateAppTagsRequest body) throws ApiException { + updateAppTagsWithHttpInfo(appId, body); + } + + /** + * Update App Tags. + * + *

See {@link #updateAppTagsWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateAppTagsAsync(UUID appId, UpdateAppTagsRequest body) { + return updateAppTagsWithHttpInfoAsync(appId, body) .thenApply( response -> { return response.getData(); @@ -1167,88 +2322,99 @@ public CompletableFuture unpublishAppAsync(UUID appId) { } /** - * Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of - * a deployment object on the app, with a nil app_version_id ( - * 00000000-0000-0000-0000-000000000000). The app can still be updated and published again - * in the future. This API requires a registered - * application key. Alternatively, you can configure these permissions in the - * UI. + * Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not + * present in the request body are removed. * - * @param appId The ID of the app to unpublish. (required) - * @return ApiResponse<UnpublishAppResponse> + * @param appId The ID of the app. (required) + * @param body (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * * *
Response details
Status Code Description Response Headers
200 OK -
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse unpublishAppWithHttpInfo(UUID appId) + public ApiResponse updateAppTagsWithHttpInfo(UUID appId, UpdateAppTagsRequest body) throws ApiException { - Object localVarPostBody = null; + Object localVarPostBody = body; // verify the required parameter 'appId' is set if (appId == null) { throw new ApiException( - 400, "Missing the required parameter 'appId' when calling unpublishApp"); + 400, "Missing the required parameter 'appId' when calling updateAppTags"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppTags"); } // create path and map variables String localVarPath = - "/api/v2/app-builder/apps/{app_id}/deployment" + "/api/v2/app-builder/apps/{app_id}/tags" .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.AppBuilderApi.unpublishApp", + "v2.AppBuilderApi.updateAppTags", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "DELETE", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Unpublish App. + * Update App Tags. * - *

See {@link #unpublishAppWithHttpInfo}. + *

See {@link #updateAppTagsWithHttpInfo}. * - * @param appId The ID of the app to unpublish. (required) - * @return CompletableFuture<ApiResponse<UnpublishAppResponse>> + * @param appId The ID of the app. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> unpublishAppWithHttpInfoAsync( - UUID appId) { - Object localVarPostBody = null; + public CompletableFuture> updateAppTagsWithHttpInfoAsync( + UUID appId, UpdateAppTagsRequest body) { + Object localVarPostBody = body; // verify the required parameter 'appId' is set if (appId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'appId' when calling unpublishApp")); + 400, "Missing the required parameter 'appId' when calling updateAppTags")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppTags")); return result; } // create path and map variables String localVarPath = - "/api/v2/app-builder/apps/{app_id}/deployment" + "/api/v2/app-builder/apps/{app_id}/tags" .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1257,54 +2423,246 @@ public CompletableFuture> unpublishAppWithHttp try { builder = apiClient.createBuilder( - "v2.AppBuilderApi.unpublishApp", + "v2.AppBuilderApi.updateAppTags", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Update App. + * Name App Version. * - *

See {@link #updateAppWithHttpInfo}. + *

See {@link #updateAppVersionNameWithHttpInfo}. * - * @param appId The ID of the app to update. (required) + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void updateAppVersionName(UUID appId, String version, UpdateAppVersionNameRequest body) + throws ApiException { + updateAppVersionNameWithHttpInfo(appId, version, body); + } + + /** + * Name App Version. + * + *

See {@link #updateAppVersionNameWithHttpInfoAsync}. + * + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture updateAppVersionNameAsync( + UUID appId, String version, UpdateAppVersionNameRequest body) { + return updateAppVersionNameWithHttpInfoAsync(appId, version, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Assign a human-readable name to a specific version of an app. The version is selected through + * the version query parameter. + * + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateAppVersionNameWithHttpInfo( + UUID appId, String version, UpdateAppVersionNameRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling updateAppVersionName"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, "Missing the required parameter 'version' when calling updateAppVersionName"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppVersionName"); + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/version-name" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "version", version)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateAppVersionName", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Name App Version. + * + *

See {@link #updateAppVersionNameWithHttpInfo}. + * + * @param appId The ID of the app. (required) + * @param version 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. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> updateAppVersionNameWithHttpInfoAsync( + UUID appId, String version, UpdateAppVersionNameRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'appId' is set + if (appId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'appId' when calling updateAppVersionName")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'version' when calling updateAppVersionName")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAppVersionName")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/app-builder/apps/{app_id}/version-name" + .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "version", version)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AppBuilderApi.updateAppVersionName", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Update App Protection Level. + * + *

See {@link #updateProtectionLevelWithHttpInfo}. + * + * @param appId The ID of the app. (required) * @param body (required) * @return UpdateAppResponse * @throws ApiException if fails to make API call */ - public UpdateAppResponse updateApp(UUID appId, UpdateAppRequest body) throws ApiException { - return updateAppWithHttpInfo(appId, body).getData(); + public UpdateAppResponse updateProtectionLevel(UUID appId, UpdateAppProtectionLevelRequest body) + throws ApiException { + return updateProtectionLevelWithHttpInfo(appId, body).getData(); } /** - * Update App. + * Update App Protection Level. * - *

See {@link #updateAppWithHttpInfoAsync}. + *

See {@link #updateProtectionLevelWithHttpInfoAsync}. * - * @param appId The ID of the app to update. (required) + * @param appId The ID of the app. (required) * @param body (required) * @return CompletableFuture<UpdateAppResponse> */ - public CompletableFuture updateAppAsync(UUID appId, UpdateAppRequest body) { - return updateAppWithHttpInfoAsync(appId, body) + public CompletableFuture updateProtectionLevelAsync( + UUID appId, UpdateAppProtectionLevelRequest body) { + return updateProtectionLevelWithHttpInfoAsync(appId, body) .thenApply( response -> { return response.getData(); @@ -1312,13 +2670,10 @@ public CompletableFuture updateAppAsync(UUID appId, UpdateApp } /** - * Update an existing app. This creates a new version of the app. This API requires a registered - * application key. Alternatively, you can configure these permissions in the - * UI. + * 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 appId The ID of the app to update. (required) + * @param appId The ID of the app. (required) * @param body (required) * @return ApiResponse<UpdateAppResponse> * @throws ApiException if fails to make API call @@ -1329,32 +2684,35 @@ public CompletableFuture updateAppAsync(UUID appId, UpdateApp * 200 OK - * 400 Bad Request - * 403 Forbidden - + * 404 Not Found - * 429 Too many requests - * */ - public ApiResponse updateAppWithHttpInfo(UUID appId, UpdateAppRequest body) - throws ApiException { + public ApiResponse updateProtectionLevelWithHttpInfo( + UUID appId, UpdateAppProtectionLevelRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'appId' is set if (appId == null) { - throw new ApiException(400, "Missing the required parameter 'appId' when calling updateApp"); + throw new ApiException( + 400, "Missing the required parameter 'appId' when calling updateProtectionLevel"); } // verify the required parameter 'body' is set if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateApp"); + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateProtectionLevel"); } // create path and map variables String localVarPath = - "/api/v2/app-builder/apps/{app_id}" + "/api/v2/app-builder/apps/{app_id}/protection-level" .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.AppBuilderApi.updateApp", + "v2.AppBuilderApi.updateProtectionLevel", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1373,23 +2731,24 @@ public ApiResponse updateAppWithHttpInfo(UUID appId, UpdateAp } /** - * Update App. + * Update App Protection Level. * - *

See {@link #updateAppWithHttpInfo}. + *

See {@link #updateProtectionLevelWithHttpInfo}. * - * @param appId The ID of the app to update. (required) + * @param appId The ID of the app. (required) * @param body (required) * @return CompletableFuture<ApiResponse<UpdateAppResponse>> */ - public CompletableFuture> updateAppWithHttpInfoAsync( - UUID appId, UpdateAppRequest body) { + public CompletableFuture> updateProtectionLevelWithHttpInfoAsync( + UUID appId, UpdateAppProtectionLevelRequest body) { Object localVarPostBody = body; // verify the required parameter 'appId' is set if (appId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'appId' when calling updateApp")); + new ApiException( + 400, "Missing the required parameter 'appId' when calling updateProtectionLevel")); return result; } @@ -1397,12 +2756,13 @@ public CompletableFuture> updateAppWithHttpInfoAs if (body == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling updateApp")); + new ApiException( + 400, "Missing the required parameter 'body' when calling updateProtectionLevel")); return result; } // create path and map variables String localVarPath = - "/api/v2/app-builder/apps/{app_id}" + "/api/v2/app-builder/apps/{app_id}/protection-level" .replaceAll("\\{" + "app_id" + "\\}", apiClient.escapeString(appId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1411,7 +2771,7 @@ public CompletableFuture> updateAppWithHttpInfoAs try { builder = apiClient.createBuilder( - "v2.AppBuilderApi.updateApp", + "v2.AppBuilderApi.updateProtectionLevel", localVarPath, new ArrayList(), localVarHeaderParams, diff --git a/src/main/java/com/datadog/api/client/v2/model/AppFavoriteType.java b/src/main/java/com/datadog/api/client/v2/model/AppFavoriteType.java new file mode 100644 index 00000000000..35d96b01712 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppFavoriteType.java @@ -0,0 +1,53 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The favorite resource type. */ +@JsonSerialize(using = AppFavoriteType.AppFavoriteTypeSerializer.class) +public class AppFavoriteType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("favorites")); + + public static final AppFavoriteType FAVORITES = new AppFavoriteType("favorites"); + + AppFavoriteType(String value) { + super(value, allowedValues); + } + + public static class AppFavoriteTypeSerializer extends StdSerializer { + public AppFavoriteTypeSerializer(Class t) { + super(t); + } + + public AppFavoriteTypeSerializer() { + this(null); + } + + @Override + public void serialize(AppFavoriteType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppFavoriteType fromValue(String value) { + return new AppFavoriteType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppProtectionLevel.java b/src/main/java/com/datadog/api/client/v2/model/AppProtectionLevel.java new file mode 100644 index 00000000000..48a14b59ce4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppProtectionLevel.java @@ -0,0 +1,59 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * The publication protection level of the app. approval_required means changes must go + * through an approval workflow before being published. + */ +@JsonSerialize(using = AppProtectionLevel.AppProtectionLevelSerializer.class) +public class AppProtectionLevel extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("direct_publish", "approval_required")); + + public static final AppProtectionLevel DIRECT_PUBLISH = new AppProtectionLevel("direct_publish"); + public static final AppProtectionLevel APPROVAL_REQUIRED = + new AppProtectionLevel("approval_required"); + + AppProtectionLevel(String value) { + super(value, allowedValues); + } + + public static class AppProtectionLevelSerializer extends StdSerializer { + public AppProtectionLevelSerializer(Class t) { + super(t); + } + + public AppProtectionLevelSerializer() { + this(null); + } + + @Override + public void serialize(AppProtectionLevel value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppProtectionLevel fromValue(String value) { + return new AppProtectionLevel(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppProtectionLevelType.java b/src/main/java/com/datadog/api/client/v2/model/AppProtectionLevelType.java new file mode 100644 index 00000000000..dd828e0a587 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppProtectionLevelType.java @@ -0,0 +1,57 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The protection-level resource type. */ +@JsonSerialize(using = AppProtectionLevelType.AppProtectionLevelTypeSerializer.class) +public class AppProtectionLevelType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("protectionLevel")); + + public static final AppProtectionLevelType PROTECTIONLEVEL = + new AppProtectionLevelType("protectionLevel"); + + AppProtectionLevelType(String value) { + super(value, allowedValues); + } + + public static class AppProtectionLevelTypeSerializer + extends StdSerializer { + public AppProtectionLevelTypeSerializer(Class t) { + super(t); + } + + public AppProtectionLevelTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AppProtectionLevelType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppProtectionLevelType fromValue(String value) { + return new AppProtectionLevelType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppSelfServiceType.java b/src/main/java/com/datadog/api/client/v2/model/AppSelfServiceType.java new file mode 100644 index 00000000000..59a97cc7a0f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppSelfServiceType.java @@ -0,0 +1,54 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The self-service resource type. */ +@JsonSerialize(using = AppSelfServiceType.AppSelfServiceTypeSerializer.class) +public class AppSelfServiceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("selfService")); + + public static final AppSelfServiceType SELFSERVICE = new AppSelfServiceType("selfService"); + + AppSelfServiceType(String value) { + super(value, allowedValues); + } + + public static class AppSelfServiceTypeSerializer extends StdSerializer { + public AppSelfServiceTypeSerializer(Class t) { + super(t); + } + + public AppSelfServiceTypeSerializer() { + this(null); + } + + @Override + public void serialize(AppSelfServiceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppSelfServiceType fromValue(String value) { + return new AppSelfServiceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppTagsType.java b/src/main/java/com/datadog/api/client/v2/model/AppTagsType.java new file mode 100644 index 00000000000..3e350f0588a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppTagsType.java @@ -0,0 +1,53 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The tags resource type. */ +@JsonSerialize(using = AppTagsType.AppTagsTypeSerializer.class) +public class AppTagsType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("tags")); + + public static final AppTagsType TAGS = new AppTagsType("tags"); + + AppTagsType(String value) { + super(value, allowedValues); + } + + public static class AppTagsTypeSerializer extends StdSerializer { + public AppTagsTypeSerializer(Class t) { + super(t); + } + + public AppTagsTypeSerializer() { + this(null); + } + + @Override + public void serialize(AppTagsType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppTagsType fromValue(String value) { + return new AppTagsType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppVersion.java b/src/main/java/com/datadog/api/client/v2/model/AppVersion.java new file mode 100644 index 00000000000..56352685258 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppVersion.java @@ -0,0 +1,197 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** A version of an app. */ +@JsonPropertyOrder({ + AppVersion.JSON_PROPERTY_ATTRIBUTES, + AppVersion.JSON_PROPERTY_ID, + AppVersion.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AppVersion { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AppVersionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppVersionType type = AppVersionType.APPVERSIONS; + + public AppVersion attributes(AppVersionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes describing an app version. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppVersionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AppVersionAttributes attributes) { + this.attributes = attributes; + } + + public AppVersion id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the app version. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public AppVersion type(AppVersionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The app-version resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppVersionType getType() { + return type; + } + + public void setType(AppVersionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AppVersion + */ + @JsonAnySetter + public AppVersion putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AppVersion object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppVersion appVersion = (AppVersion) o; + return Objects.equals(this.attributes, appVersion.attributes) + && Objects.equals(this.id, appVersion.id) + && Objects.equals(this.type, appVersion.type) + && Objects.equals(this.additionalProperties, appVersion.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppVersion {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppVersionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AppVersionAttributes.java new file mode 100644 index 00000000000..d69ff470423 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppVersionAttributes.java @@ -0,0 +1,367 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Attributes describing an app version. */ +@JsonPropertyOrder({ + AppVersionAttributes.JSON_PROPERTY_APP_ID, + AppVersionAttributes.JSON_PROPERTY_CREATED_AT, + AppVersionAttributes.JSON_PROPERTY_HAS_EVER_BEEN_PUBLISHED, + AppVersionAttributes.JSON_PROPERTY_NAME, + AppVersionAttributes.JSON_PROPERTY_UPDATED_AT, + AppVersionAttributes.JSON_PROPERTY_USER_ID, + AppVersionAttributes.JSON_PROPERTY_USER_NAME, + AppVersionAttributes.JSON_PROPERTY_USER_UUID, + AppVersionAttributes.JSON_PROPERTY_VERSION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AppVersionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APP_ID = "app_id"; + private UUID appId; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_HAS_EVER_BEEN_PUBLISHED = "has_ever_been_published"; + private Boolean hasEverBeenPublished; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private OffsetDateTime updatedAt; + + public static final String JSON_PROPERTY_USER_ID = "user_id"; + private Long userId; + + public static final String JSON_PROPERTY_USER_NAME = "user_name"; + private String userName; + + public static final String JSON_PROPERTY_USER_UUID = "user_uuid"; + private UUID userUuid; + + public static final String JSON_PROPERTY_VERSION = "version"; + private Long version; + + public AppVersionAttributes appId(UUID appId) { + this.appId = appId; + return this; + } + + /** + * The ID of the app this version belongs to. + * + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAppId() { + return appId; + } + + public void setAppId(UUID appId) { + this.appId = appId; + } + + public AppVersionAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp of when the version was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public AppVersionAttributes hasEverBeenPublished(Boolean hasEverBeenPublished) { + this.hasEverBeenPublished = hasEverBeenPublished; + return this; + } + + /** + * Whether this version has ever been published. + * + * @return hasEverBeenPublished + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_EVER_BEEN_PUBLISHED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasEverBeenPublished() { + return hasEverBeenPublished; + } + + public void setHasEverBeenPublished(Boolean hasEverBeenPublished) { + this.hasEverBeenPublished = hasEverBeenPublished; + } + + public AppVersionAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The optional human-readable name of the version. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AppVersionAttributes updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * Timestamp of when the version was last updated. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + public AppVersionAttributes userId(Long userId) { + this.userId = userId; + return this; + } + + /** + * The ID of the user who created the version. + * + * @return userId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public AppVersionAttributes userName(String userName) { + this.userName = userName; + return this; + } + + /** + * The name (or email) of the user who created the version. + * + * @return userName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public AppVersionAttributes userUuid(UUID userUuid) { + this.userUuid = userUuid; + return this; + } + + /** + * The UUID of the user who created the version. + * + * @return userUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUserUuid() { + return userUuid; + } + + public void setUserUuid(UUID userUuid) { + this.userUuid = userUuid; + } + + public AppVersionAttributes version(Long version) { + this.version = version; + return this; + } + + /** + * The version number of the app, starting at 1. + * + * @return version + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersion() { + return version; + } + + public void setVersion(Long version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AppVersionAttributes + */ + @JsonAnySetter + public AppVersionAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AppVersionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppVersionAttributes appVersionAttributes = (AppVersionAttributes) o; + return Objects.equals(this.appId, appVersionAttributes.appId) + && Objects.equals(this.createdAt, appVersionAttributes.createdAt) + && Objects.equals(this.hasEverBeenPublished, appVersionAttributes.hasEverBeenPublished) + && Objects.equals(this.name, appVersionAttributes.name) + && Objects.equals(this.updatedAt, appVersionAttributes.updatedAt) + && Objects.equals(this.userId, appVersionAttributes.userId) + && Objects.equals(this.userName, appVersionAttributes.userName) + && Objects.equals(this.userUuid, appVersionAttributes.userUuid) + && Objects.equals(this.version, appVersionAttributes.version) + && Objects.equals(this.additionalProperties, appVersionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + appId, + createdAt, + hasEverBeenPublished, + name, + updatedAt, + userId, + userName, + userUuid, + version, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppVersionAttributes {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" hasEverBeenPublished: ") + .append(toIndentedString(hasEverBeenPublished)) + .append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); + sb.append(" userId: ").append(toIndentedString(userId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" userUuid: ").append(toIndentedString(userUuid)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppVersionNameType.java b/src/main/java/com/datadog/api/client/v2/model/AppVersionNameType.java new file mode 100644 index 00000000000..8da84acdbd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppVersionNameType.java @@ -0,0 +1,54 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The version-name resource type. */ +@JsonSerialize(using = AppVersionNameType.AppVersionNameTypeSerializer.class) +public class AppVersionNameType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("versionNames")); + + public static final AppVersionNameType VERSIONNAMES = new AppVersionNameType("versionNames"); + + AppVersionNameType(String value) { + super(value, allowedValues); + } + + public static class AppVersionNameTypeSerializer extends StdSerializer { + public AppVersionNameTypeSerializer(Class t) { + super(t); + } + + public AppVersionNameTypeSerializer() { + this(null); + } + + @Override + public void serialize(AppVersionNameType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppVersionNameType fromValue(String value) { + return new AppVersionNameType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AppVersionType.java b/src/main/java/com/datadog/api/client/v2/model/AppVersionType.java new file mode 100644 index 00000000000..af369256786 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AppVersionType.java @@ -0,0 +1,54 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The app-version resource type. */ +@JsonSerialize(using = AppVersionType.AppVersionTypeSerializer.class) +public class AppVersionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("appVersions")); + + public static final AppVersionType APPVERSIONS = new AppVersionType("appVersions"); + + AppVersionType(String value) { + super(value, allowedValues); + } + + public static class AppVersionTypeSerializer extends StdSerializer { + public AppVersionTypeSerializer(Class t) { + super(t); + } + + public AppVersionTypeSerializer() { + this(null); + } + + @Override + public void serialize(AppVersionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AppVersionType fromValue(String value) { + return new AppVersionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequest.java new file mode 100644 index 00000000000..56e3c3b19e9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequest.java @@ -0,0 +1,140 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A request to ask for approval to publish an app whose protection level is approval_required + * . + */ +@JsonPropertyOrder({CreatePublishRequestRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreatePublishRequestRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreatePublishRequestRequestData data; + + public CreatePublishRequestRequest data(CreatePublishRequestRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating a publish request. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreatePublishRequestRequestData getData() { + return data; + } + + public void setData(CreatePublishRequestRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreatePublishRequestRequest + */ + @JsonAnySetter + public CreatePublishRequestRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreatePublishRequestRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePublishRequestRequest createPublishRequestRequest = (CreatePublishRequestRequest) o; + return Objects.equals(this.data, createPublishRequestRequest.data) + && Objects.equals( + this.additionalProperties, createPublishRequestRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePublishRequestRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequestData.java new file mode 100644 index 00000000000..3f513be526c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequestData.java @@ -0,0 +1,172 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for creating a publish request. */ +@JsonPropertyOrder({ + CreatePublishRequestRequestData.JSON_PROPERTY_ATTRIBUTES, + CreatePublishRequestRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreatePublishRequestRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreatePublishRequestRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private PublishRequestType type = PublishRequestType.PUBLISHREQUEST; + + public CreatePublishRequestRequestData attributes( + CreatePublishRequestRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating a publish request. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreatePublishRequestRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreatePublishRequestRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreatePublishRequestRequestData type(PublishRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The publish-request resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PublishRequestType getType() { + return type; + } + + public void setType(PublishRequestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreatePublishRequestRequestData + */ + @JsonAnySetter + public CreatePublishRequestRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreatePublishRequestRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePublishRequestRequestData createPublishRequestRequestData = + (CreatePublishRequestRequestData) o; + return Objects.equals(this.attributes, createPublishRequestRequestData.attributes) + && Objects.equals(this.type, createPublishRequestRequestData.type) + && Objects.equals( + this.additionalProperties, createPublishRequestRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePublishRequestRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequestDataAttributes.java new file mode 100644 index 00000000000..dfb2b5dfba4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreatePublishRequestRequestDataAttributes.java @@ -0,0 +1,175 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating a publish request. */ +@JsonPropertyOrder({ + CreatePublishRequestRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + CreatePublishRequestRequestDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreatePublishRequestRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public CreatePublishRequestRequestDataAttributes() {} + + @JsonCreator + public CreatePublishRequestRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.title = title; + } + + public CreatePublishRequestRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * An optional description of the changes in this publish request. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreatePublishRequestRequestDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * A short title for the publish request. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreatePublishRequestRequestDataAttributes + */ + @JsonAnySetter + public CreatePublishRequestRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreatePublishRequestRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreatePublishRequestRequestDataAttributes createPublishRequestRequestDataAttributes = + (CreatePublishRequestRequestDataAttributes) o; + return Objects.equals(this.description, createPublishRequestRequestDataAttributes.description) + && Objects.equals(this.title, createPublishRequestRequestDataAttributes.title) + && Objects.equals( + this.additionalProperties, + createPublishRequestRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreatePublishRequestRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListAppVersionsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListAppVersionsResponse.java new file mode 100644 index 00000000000..4533c1ff84f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListAppVersionsResponse.java @@ -0,0 +1,179 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A paginated list of versions for an app. */ +@JsonPropertyOrder({ + ListAppVersionsResponse.JSON_PROPERTY_DATA, + ListAppVersionsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListAppVersionsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private ListAppsResponseMeta meta; + + public ListAppVersionsResponse data(List data) { + this.data = data; + for (AppVersion item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListAppVersionsResponse addDataItem(AppVersion dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of app versions. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListAppVersionsResponse meta(ListAppsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Pagination metadata. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ListAppsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ListAppsResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListAppVersionsResponse + */ + @JsonAnySetter + public ListAppVersionsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListAppVersionsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListAppVersionsResponse listAppVersionsResponse = (ListAppVersionsResponse) o; + return Objects.equals(this.data, listAppVersionsResponse.data) + && Objects.equals(this.meta, listAppVersionsResponse.meta) + && Objects.equals(this.additionalProperties, listAppVersionsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListAppVersionsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PublishRequestType.java b/src/main/java/com/datadog/api/client/v2/model/PublishRequestType.java new file mode 100644 index 00000000000..9b393f925fe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PublishRequestType.java @@ -0,0 +1,54 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The publish-request resource type. */ +@JsonSerialize(using = PublishRequestType.PublishRequestTypeSerializer.class) +public class PublishRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("publishRequest")); + + public static final PublishRequestType PUBLISHREQUEST = new PublishRequestType("publishRequest"); + + PublishRequestType(String value) { + super(value, allowedValues); + } + + public static class PublishRequestTypeSerializer extends StdSerializer { + public PublishRequestTypeSerializer(Class t) { + super(t); + } + + public PublishRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize(PublishRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static PublishRequestType fromValue(String value) { + return new PublishRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequest.java new file mode 100644 index 00000000000..4f31276842a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequest.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request to add or remove an app from the current user's favorites. */ +@JsonPropertyOrder({UpdateAppFavoriteRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppFavoriteRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppFavoriteRequestData data; + + public UpdateAppFavoriteRequest data(UpdateAppFavoriteRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for updating an app's favorite status. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppFavoriteRequestData getData() { + return data; + } + + public void setData(UpdateAppFavoriteRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppFavoriteRequest + */ + @JsonAnySetter + public UpdateAppFavoriteRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppFavoriteRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppFavoriteRequest updateAppFavoriteRequest = (UpdateAppFavoriteRequest) o; + return Objects.equals(this.data, updateAppFavoriteRequest.data) + && Objects.equals(this.additionalProperties, updateAppFavoriteRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppFavoriteRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequestData.java new file mode 100644 index 00000000000..e47e663bad9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequestData.java @@ -0,0 +1,171 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for updating an app's favorite status. */ +@JsonPropertyOrder({ + UpdateAppFavoriteRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppFavoriteRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppFavoriteRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppFavoriteRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppFavoriteType type = AppFavoriteType.FAVORITES; + + public UpdateAppFavoriteRequestData attributes( + UpdateAppFavoriteRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating an app's favorite status. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppFavoriteRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppFavoriteRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppFavoriteRequestData type(AppFavoriteType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The favorite resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppFavoriteType getType() { + return type; + } + + public void setType(AppFavoriteType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppFavoriteRequestData + */ + @JsonAnySetter + public UpdateAppFavoriteRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppFavoriteRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppFavoriteRequestData updateAppFavoriteRequestData = (UpdateAppFavoriteRequestData) o; + return Objects.equals(this.attributes, updateAppFavoriteRequestData.attributes) + && Objects.equals(this.type, updateAppFavoriteRequestData.type) + && Objects.equals( + this.additionalProperties, updateAppFavoriteRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppFavoriteRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequestDataAttributes.java new file mode 100644 index 00000000000..15db9d94d10 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppFavoriteRequestDataAttributes.java @@ -0,0 +1,145 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating an app's favorite status. */ +@JsonPropertyOrder({UpdateAppFavoriteRequestDataAttributes.JSON_PROPERTY_FAVORITE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppFavoriteRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FAVORITE = "favorite"; + private Boolean favorite; + + public UpdateAppFavoriteRequestDataAttributes() {} + + @JsonCreator + public UpdateAppFavoriteRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_FAVORITE) Boolean favorite) { + this.favorite = favorite; + } + + public UpdateAppFavoriteRequestDataAttributes favorite(Boolean favorite) { + this.favorite = favorite; + return this; + } + + /** + * Whether the app should be marked as a favorite for the current user. + * + * @return favorite + */ + @JsonProperty(JSON_PROPERTY_FAVORITE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getFavorite() { + return favorite; + } + + public void setFavorite(Boolean favorite) { + this.favorite = favorite; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppFavoriteRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppFavoriteRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppFavoriteRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppFavoriteRequestDataAttributes updateAppFavoriteRequestDataAttributes = + (UpdateAppFavoriteRequestDataAttributes) o; + return Objects.equals(this.favorite, updateAppFavoriteRequestDataAttributes.favorite) + && Objects.equals( + this.additionalProperties, updateAppFavoriteRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(favorite, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppFavoriteRequestDataAttributes {\n"); + sb.append(" favorite: ").append(toIndentedString(favorite)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequest.java new file mode 100644 index 00000000000..7c9d96c6b3b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequest.java @@ -0,0 +1,138 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request to update an app's publication protection level. */ +@JsonPropertyOrder({UpdateAppProtectionLevelRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppProtectionLevelRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppProtectionLevelRequestData data; + + public UpdateAppProtectionLevelRequest data(UpdateAppProtectionLevelRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for updating an app's publication protection level. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppProtectionLevelRequestData getData() { + return data; + } + + public void setData(UpdateAppProtectionLevelRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppProtectionLevelRequest + */ + @JsonAnySetter + public UpdateAppProtectionLevelRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppProtectionLevelRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppProtectionLevelRequest updateAppProtectionLevelRequest = + (UpdateAppProtectionLevelRequest) o; + return Objects.equals(this.data, updateAppProtectionLevelRequest.data) + && Objects.equals( + this.additionalProperties, updateAppProtectionLevelRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppProtectionLevelRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequestData.java new file mode 100644 index 00000000000..2eb1e5a597d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequestData.java @@ -0,0 +1,172 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for updating an app's publication protection level. */ +@JsonPropertyOrder({ + UpdateAppProtectionLevelRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppProtectionLevelRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppProtectionLevelRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppProtectionLevelRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppProtectionLevelType type = AppProtectionLevelType.PROTECTIONLEVEL; + + public UpdateAppProtectionLevelRequestData attributes( + UpdateAppProtectionLevelRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating an app's publication protection level. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppProtectionLevelRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppProtectionLevelRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppProtectionLevelRequestData type(AppProtectionLevelType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The protection-level resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppProtectionLevelType getType() { + return type; + } + + public void setType(AppProtectionLevelType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppProtectionLevelRequestData + */ + @JsonAnySetter + public UpdateAppProtectionLevelRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppProtectionLevelRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppProtectionLevelRequestData updateAppProtectionLevelRequestData = + (UpdateAppProtectionLevelRequestData) o; + return Objects.equals(this.attributes, updateAppProtectionLevelRequestData.attributes) + && Objects.equals(this.type, updateAppProtectionLevelRequestData.type) + && Objects.equals( + this.additionalProperties, updateAppProtectionLevelRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppProtectionLevelRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequestDataAttributes.java new file mode 100644 index 00000000000..a68f5c13dcb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppProtectionLevelRequestDataAttributes.java @@ -0,0 +1,156 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating an app's publication protection level. */ +@JsonPropertyOrder({UpdateAppProtectionLevelRequestDataAttributes.JSON_PROPERTY_PROTECTION_LEVEL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppProtectionLevelRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PROTECTION_LEVEL = "protectionLevel"; + private AppProtectionLevel protectionLevel; + + public UpdateAppProtectionLevelRequestDataAttributes() {} + + @JsonCreator + public UpdateAppProtectionLevelRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_PROTECTION_LEVEL) + AppProtectionLevel protectionLevel) { + this.protectionLevel = protectionLevel; + this.unparsed |= !protectionLevel.isValid(); + } + + public UpdateAppProtectionLevelRequestDataAttributes protectionLevel( + AppProtectionLevel protectionLevel) { + this.protectionLevel = protectionLevel; + this.unparsed |= !protectionLevel.isValid(); + return this; + } + + /** + * The publication protection level of the app. approval_required means changes must + * go through an approval workflow before being published. + * + * @return protectionLevel + */ + @JsonProperty(JSON_PROPERTY_PROTECTION_LEVEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AppProtectionLevel getProtectionLevel() { + return protectionLevel; + } + + public void setProtectionLevel(AppProtectionLevel protectionLevel) { + if (!protectionLevel.isValid()) { + this.unparsed = true; + } + this.protectionLevel = protectionLevel; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppProtectionLevelRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppProtectionLevelRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppProtectionLevelRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppProtectionLevelRequestDataAttributes updateAppProtectionLevelRequestDataAttributes = + (UpdateAppProtectionLevelRequestDataAttributes) o; + return Objects.equals( + this.protectionLevel, updateAppProtectionLevelRequestDataAttributes.protectionLevel) + && Objects.equals( + this.additionalProperties, + updateAppProtectionLevelRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(protectionLevel, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppProtectionLevelRequestDataAttributes {\n"); + sb.append(" protectionLevel: ").append(toIndentedString(protectionLevel)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequest.java new file mode 100644 index 00000000000..febe1293da8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequest.java @@ -0,0 +1,137 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request to enable or disable self-service for an app. */ +@JsonPropertyOrder({UpdateAppSelfServiceRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppSelfServiceRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppSelfServiceRequestData data; + + public UpdateAppSelfServiceRequest data(UpdateAppSelfServiceRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for updating an app's self-service status. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppSelfServiceRequestData getData() { + return data; + } + + public void setData(UpdateAppSelfServiceRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppSelfServiceRequest + */ + @JsonAnySetter + public UpdateAppSelfServiceRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppSelfServiceRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppSelfServiceRequest updateAppSelfServiceRequest = (UpdateAppSelfServiceRequest) o; + return Objects.equals(this.data, updateAppSelfServiceRequest.data) + && Objects.equals( + this.additionalProperties, updateAppSelfServiceRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppSelfServiceRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequestData.java new file mode 100644 index 00000000000..58cb12eb1c9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequestData.java @@ -0,0 +1,172 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for updating an app's self-service status. */ +@JsonPropertyOrder({ + UpdateAppSelfServiceRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppSelfServiceRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppSelfServiceRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppSelfServiceRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppSelfServiceType type = AppSelfServiceType.SELFSERVICE; + + public UpdateAppSelfServiceRequestData attributes( + UpdateAppSelfServiceRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for updating an app's self-service status. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppSelfServiceRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppSelfServiceRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppSelfServiceRequestData type(AppSelfServiceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The self-service resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppSelfServiceType getType() { + return type; + } + + public void setType(AppSelfServiceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppSelfServiceRequestData + */ + @JsonAnySetter + public UpdateAppSelfServiceRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppSelfServiceRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppSelfServiceRequestData updateAppSelfServiceRequestData = + (UpdateAppSelfServiceRequestData) o; + return Objects.equals(this.attributes, updateAppSelfServiceRequestData.attributes) + && Objects.equals(this.type, updateAppSelfServiceRequestData.type) + && Objects.equals( + this.additionalProperties, updateAppSelfServiceRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppSelfServiceRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequestDataAttributes.java new file mode 100644 index 00000000000..4e29faf00c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppSelfServiceRequestDataAttributes.java @@ -0,0 +1,146 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for updating an app's self-service status. */ +@JsonPropertyOrder({UpdateAppSelfServiceRequestDataAttributes.JSON_PROPERTY_SELF_SERVICE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppSelfServiceRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SELF_SERVICE = "selfService"; + private Boolean selfService; + + public UpdateAppSelfServiceRequestDataAttributes() {} + + @JsonCreator + public UpdateAppSelfServiceRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_SELF_SERVICE) Boolean selfService) { + this.selfService = selfService; + } + + public UpdateAppSelfServiceRequestDataAttributes selfService(Boolean selfService) { + this.selfService = selfService; + return this; + } + + /** + * Whether the app is enabled for self-service. + * + * @return selfService + */ + @JsonProperty(JSON_PROPERTY_SELF_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getSelfService() { + return selfService; + } + + public void setSelfService(Boolean selfService) { + this.selfService = selfService; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppSelfServiceRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppSelfServiceRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppSelfServiceRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppSelfServiceRequestDataAttributes updateAppSelfServiceRequestDataAttributes = + (UpdateAppSelfServiceRequestDataAttributes) o; + return Objects.equals(this.selfService, updateAppSelfServiceRequestDataAttributes.selfService) + && Objects.equals( + this.additionalProperties, + updateAppSelfServiceRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(selfService, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppSelfServiceRequestDataAttributes {\n"); + sb.append(" selfService: ").append(toIndentedString(selfService)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequest.java new file mode 100644 index 00000000000..ba61e0cd44e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequest.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request to replace the tags on an app. */ +@JsonPropertyOrder({UpdateAppTagsRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppTagsRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppTagsRequestData data; + + public UpdateAppTagsRequest data(UpdateAppTagsRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for replacing an app's tags. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppTagsRequestData getData() { + return data; + } + + public void setData(UpdateAppTagsRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppTagsRequest + */ + @JsonAnySetter + public UpdateAppTagsRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppTagsRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppTagsRequest updateAppTagsRequest = (UpdateAppTagsRequest) o; + return Objects.equals(this.data, updateAppTagsRequest.data) + && Objects.equals(this.additionalProperties, updateAppTagsRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppTagsRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequestData.java new file mode 100644 index 00000000000..45e5a9e34cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequestData.java @@ -0,0 +1,169 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for replacing an app's tags. */ +@JsonPropertyOrder({ + UpdateAppTagsRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppTagsRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppTagsRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppTagsRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppTagsType type = AppTagsType.TAGS; + + public UpdateAppTagsRequestData attributes(UpdateAppTagsRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for replacing an app's tags. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppTagsRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppTagsRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppTagsRequestData type(AppTagsType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The tags resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppTagsType getType() { + return type; + } + + public void setType(AppTagsType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppTagsRequestData + */ + @JsonAnySetter + public UpdateAppTagsRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppTagsRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppTagsRequestData updateAppTagsRequestData = (UpdateAppTagsRequestData) o; + return Objects.equals(this.attributes, updateAppTagsRequestData.attributes) + && Objects.equals(this.type, updateAppTagsRequestData.type) + && Objects.equals(this.additionalProperties, updateAppTagsRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppTagsRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequestDataAttributes.java new file mode 100644 index 00000000000..7bf30935fc1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppTagsRequestDataAttributes.java @@ -0,0 +1,153 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for replacing an app's tags. */ +@JsonPropertyOrder({UpdateAppTagsRequestDataAttributes.JSON_PROPERTY_TAGS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppTagsRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public UpdateAppTagsRequestDataAttributes() {} + + @JsonCreator + public UpdateAppTagsRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) { + this.tags = tags; + } + + public UpdateAppTagsRequestDataAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public UpdateAppTagsRequestDataAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * The full list of tags that should be set on the app. Existing tags not present in this list are + * removed. + * + * @return tags + */ + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppTagsRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppTagsRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppTagsRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppTagsRequestDataAttributes updateAppTagsRequestDataAttributes = + (UpdateAppTagsRequestDataAttributes) o; + return Objects.equals(this.tags, updateAppTagsRequestDataAttributes.tags) + && Objects.equals( + this.additionalProperties, updateAppTagsRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppTagsRequestDataAttributes {\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequest.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequest.java new file mode 100644 index 00000000000..41048128764 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequest.java @@ -0,0 +1,137 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A request to assign a human-readable name to a specific app version. */ +@JsonPropertyOrder({UpdateAppVersionNameRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppVersionNameRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateAppVersionNameRequestData data; + + public UpdateAppVersionNameRequest data(UpdateAppVersionNameRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for naming a specific app version. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppVersionNameRequestData getData() { + return data; + } + + public void setData(UpdateAppVersionNameRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppVersionNameRequest + */ + @JsonAnySetter + public UpdateAppVersionNameRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppVersionNameRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppVersionNameRequest updateAppVersionNameRequest = (UpdateAppVersionNameRequest) o; + return Objects.equals(this.data, updateAppVersionNameRequest.data) + && Objects.equals( + this.additionalProperties, updateAppVersionNameRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppVersionNameRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequestData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequestData.java new file mode 100644 index 00000000000..f97960dfeab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequestData.java @@ -0,0 +1,172 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for naming a specific app version. */ +@JsonPropertyOrder({ + UpdateAppVersionNameRequestData.JSON_PROPERTY_ATTRIBUTES, + UpdateAppVersionNameRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppVersionNameRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UpdateAppVersionNameRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AppVersionNameType type = AppVersionNameType.VERSIONNAMES; + + public UpdateAppVersionNameRequestData attributes( + UpdateAppVersionNameRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for naming a specific app version. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateAppVersionNameRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UpdateAppVersionNameRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateAppVersionNameRequestData type(AppVersionNameType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The version-name resource type. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AppVersionNameType getType() { + return type; + } + + public void setType(AppVersionNameType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppVersionNameRequestData + */ + @JsonAnySetter + public UpdateAppVersionNameRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppVersionNameRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppVersionNameRequestData updateAppVersionNameRequestData = + (UpdateAppVersionNameRequestData) o; + return Objects.equals(this.attributes, updateAppVersionNameRequestData.attributes) + && Objects.equals(this.type, updateAppVersionNameRequestData.type) + && Objects.equals( + this.additionalProperties, updateAppVersionNameRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppVersionNameRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequestDataAttributes.java new file mode 100644 index 00000000000..e1b5147db1a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateAppVersionNameRequestDataAttributes.java @@ -0,0 +1,146 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for naming a specific app version. */ +@JsonPropertyOrder({UpdateAppVersionNameRequestDataAttributes.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateAppVersionNameRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public UpdateAppVersionNameRequestDataAttributes() {} + + @JsonCreator + public UpdateAppVersionNameRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public UpdateAppVersionNameRequestDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The name to assign to the app version. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateAppVersionNameRequestDataAttributes + */ + @JsonAnySetter + public UpdateAppVersionNameRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateAppVersionNameRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAppVersionNameRequestDataAttributes updateAppVersionNameRequestDataAttributes = + (UpdateAppVersionNameRequestDataAttributes) o; + return Objects.equals(this.name, updateAppVersionNameRequestDataAttributes.name) + && Objects.equals( + this.additionalProperties, + updateAppVersionNameRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAppVersionNameRequestDataAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/app_builder.feature b/src/test/resources/com/datadog/api/client/v2/api/app_builder.feature index 1ef2502e807..a61d55f15e7 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/app_builder.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index d5a8323e270..eab901e5b6e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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": {