diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 9466f691bd40..8f404467bc29 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3257,6 +3257,7 @@ components: - incident_analytics - product_analytics - on_call_events + - errors example: "logs" type: string x-enum-varnames: @@ -3273,6 +3274,7 @@ components: - INCIDENT_ANALYTICS - PRODUCT_ANALYTICS - ON_CALL_EVENTS + - ERRORS FormulaAndFunctionMetricAggregation: description: The aggregation methods available for metrics queries. enum: diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c354fca49e31..39623cac69e0 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -312,6 +312,54 @@ components: required: false schema: type: string + CommitmentsCommitmentType: + description: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + in: query + name: commitmentType + required: false + schema: + $ref: "#/components/schemas/CommitmentsCommitmentType" + CommitmentsEnd: + description: End of the query time range in Unix milliseconds. + example: 1696118400000 + in: query + name: end + required: true + schema: + format: int64 + type: integer + CommitmentsFilterBy: + description: Optional filter expression to narrow down results. + in: query + name: filterBy + required: false + schema: + type: string + CommitmentsProduct: + description: Cloud product identifier (for example, ec2, rds, virtualmachines). + example: ec2 + in: query + name: product + required: true + schema: + type: string + CommitmentsProvider: + description: Cloud provider for commitment programs (aws or azure). + example: aws + in: query + name: provider + required: true + schema: + $ref: "#/components/schemas/CommitmentsProvider" + CommitmentsStart: + description: Start of the query time range in Unix milliseconds. + example: 1693526400000 + in: query + name: start + required: true + schema: + format: int64 + type: integer ConfluentAccountID: description: Confluent Account ID. in: path @@ -4627,6 +4675,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: @@ -4687,6 +4744,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: @@ -4698,6 +4774,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: @@ -4709,6 +4803,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: @@ -14016,6 +14184,623 @@ components: type: string x-enum-varnames: - CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST + CommitmentsAwsEC2RICommitment: + description: AWS EC2 Reserved Instance commitment details. + properties: + availability_zone: + description: The availability zone of the reservation. + example: us-east-1a + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The EC2 instance type. + example: m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + offering_class: + description: The offering class of the Reserved Instance. + example: standard + type: string + operating_system: + description: The operating system of the Reserved Instance. + example: Linux + type: string + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - instance_type + - offering_class + - operating_system + - purchase_option + - region + type: object + CommitmentsAwsElasticacheRICommitment: + description: AWS ElastiCache Reserved Instance commitment details. + properties: + cache_engine: + description: The cache engine type of the Reserved Instance. + example: Redis + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The ElastiCache instance type. + example: cache.m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - cache_engine + - commitment_id + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsRDSRICommitment: + description: AWS RDS Reserved Instance commitment details. + properties: + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + database_engine: + description: The database engine of the Reserved Instance. + example: MySQL + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The RDS instance type. + example: db.m5.xlarge + type: string + is_multi_az: + description: Whether the Reserved Instance is Multi-AZ. + example: false + type: boolean + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - database_engine + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsSPCommitment: + description: AWS Savings Plan commitment details. + properties: + commitment_id: + description: The unique identifier of the Savings Plan. + example: arn:aws:savingsplans::123456789:savingsplan/abc123 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 1.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + purchase_option: + description: The payment option for the Savings Plan. + example: All Upfront + type: string + savings_plan_type: + description: The Savings Plan type. + example: ComputeSavingsPlans + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - purchase_option + - savings_plan_type + type: object + CommitmentsAzureComputeSPCommitment: + description: Azure Compute Savings Plan commitment details. + properties: + benefit_name: + description: The display name of the Azure Savings Plan. + example: my-compute-savings-plan + type: string + commitment_id: + description: The unique identifier of the Savings Plan. + example: /subscriptions/abc123/providers/Microsoft.BillingBenefits/savingsPlanOrders/xyz789 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 2.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + type: object + CommitmentsAzureVMRICommitment: + description: Azure Virtual Machine Reserved Instance commitment details. + properties: + benefit_name: + description: The display name of the Azure reservation. + example: my-vm-reservation + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: /subscriptions/abc123/providers/Microsoft.Capacity/reservationOrders/xyz789 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The Azure VM instance type. + example: Standard_D4s_v3 + type: string + meter_sub_category: + description: The Azure meter sub-category for the reservation. + example: D4s v3 + type: string + region: + description: The Azure region of the Reserved Instance. + example: eastus + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + status: + $ref: "#/components/schemas/CommitmentsAzureVMRIStatus" + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + - instance_type + - meter_sub_category + - region + - status + type: object + CommitmentsAzureVMRIStatus: + description: Status of an Azure VM Reserved Instance. + enum: + - running + - expired + - cancelled + example: running + type: string + x-enum-varnames: + - RUNNING + - EXPIRED + - CANCELLED + CommitmentsCommitmentType: + description: Type of commitment. ri for Reserved Instances, sp for Savings Plans. + enum: + - ri + - sp + example: ri + type: string + x-enum-varnames: + - RESERVED_INSTANCES + - SAVINGS_PLANS + CommitmentsCoverageScalarResponse: + description: Response containing scalar coverage metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsCoverageTimeseriesResponse: + description: Response containing timeseries coverage metrics for cloud commitment programs. + properties: + cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + hours: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - cost + - hours + type: object + CommitmentsListItem: + description: A commitment item, which varies based on the provider, product, and commitment type. + oneOf: + - $ref: "#/components/schemas/CommitmentsAwsEC2RICommitment" + - $ref: "#/components/schemas/CommitmentsAwsRDSRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsElasticacheRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsSPCommitment" + - $ref: "#/components/schemas/CommitmentsAzureVMRICommitment" + - $ref: "#/components/schemas/CommitmentsAzureComputeSPCommitment" + CommitmentsListItems: + description: Array of commitment items. + example: + - commitment_id: ri-0123456789abcdef0 + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + items: + $ref: "#/components/schemas/CommitmentsListItem" + type: array + CommitmentsListMeta: + description: Metadata for a commitments list response. + properties: + committed_spend_unit: + $ref: "#/components/schemas/CommitmentsUnit" + type: object + CommitmentsListResponse: + description: Response containing a list of cloud commitment details. + properties: + commitments: + $ref: "#/components/schemas/CommitmentsListItems" + meta: + $ref: "#/components/schemas/CommitmentsListMeta" + required: + - commitments + type: object + CommitmentsOnDemandHotspotsScalarMeta: + description: Metadata for the on-demand hot-spots scalar response. + properties: + on_demand_filters: + description: Active on-demand filters applied to the response. + example: "region:us-east-1" + type: string + required: + - on_demand_filters + type: object + CommitmentsOnDemandHotspotsScalarResponse: + description: Response containing scalar on-demand hot-spots data for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + meta: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarMeta" + total: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + - total + type: object + CommitmentsProvider: + description: Cloud provider for commitment programs. + enum: + - aws + - azure + example: aws + type: string + x-enum-varnames: + - AWS + - AZURE + CommitmentsSavingsScalarResponse: + description: Response containing scalar savings metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsSavingsTimeseriesResponse: + description: Response containing timeseries savings metrics for cloud commitment programs. + properties: + actual_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + effective_savings_rate: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + on_demand_equivalent_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + realized_savings: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - actual_cost + - effective_savings_rate + - on_demand_equivalent_cost + - realized_savings + type: object + CommitmentsScalarColumn: + description: A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. + properties: + meta: + $ref: "#/components/schemas/CommitmentsScalarColumnMeta" + name: + description: The column name. + example: utilization + type: string + type: + $ref: "#/components/schemas/CommitmentsScalarColumnType" + values: + $ref: "#/components/schemas/CommitmentsScalarColumnValueItems" + required: + - name + - type + - values + type: object + CommitmentsScalarColumnMeta: + description: Metadata for a scalar column, including unit information. + properties: + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - unit + type: object + CommitmentsScalarColumnType: + description: The column type. "group" for dimension columns, "number" for metric columns. + enum: + - group + - number + example: group + type: string + x-enum-varnames: + - GROUP + - NUMBER + CommitmentsScalarColumnValueItems: + description: Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + example: + - 0.85 + - 0.72 + items: {} + type: array + CommitmentsScalarColumns: + description: Array of scalar columns in the response. + items: + $ref: "#/components/schemas/CommitmentsScalarColumn" + type: array + CommitmentsTimeseriesMetric: + description: A timeseries metric containing timestamps, series values, and optional unit metadata. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object + CommitmentsTimeseriesSeries: + additionalProperties: + $ref: "#/components/schemas/CommitmentsTimeseriesValues" + description: Timeseries data as a map of series names to their corresponding value arrays. + type: object + CommitmentsTimeseriesValues: + description: A series of numeric values for a timeseries metric. + items: + format: double + type: number + type: array + CommitmentsTimestamps: + description: Unix timestamps in seconds for the timeseries data points. + example: + - 1693526400 + - 1693612800 + items: + format: int64 + type: integer + type: array + CommitmentsUnit: + description: Unit metadata for a numeric metric. + properties: + family: + description: The unit family (for example, percentage or money). + example: percentage + type: string + id: + description: The unit identifier. + example: 17 + format: int64 + type: integer + name: + description: The unit name (for example, percent or dollar). + example: percent + type: string + plural: + description: The plural form of the unit name. + example: percent + type: string + scale_factor: + description: The scale factor for the unit. + example: 1 + format: double + type: number + short_name: + description: The abbreviated unit name (for example, % or $). + example: "%" + type: string + required: + - family + - id + - name + - plural + - scale_factor + - short_name + type: object + CommitmentsUtilizationScalarProductBreakdown: + description: Array of per-product utilization breakdown entries. + items: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdownEntry" + type: array + CommitmentsUtilizationScalarProductBreakdownEntry: + description: Per-product utilization data in a scalar utilization response. + properties: + product: + description: The cloud product name. + example: ec2 + type: string + utilization: + description: The utilization percentage for the product. + example: 0.85 + format: double + type: number + required: + - product + - utilization + type: object + CommitmentsUtilizationScalarResponse: + description: Response containing scalar utilization metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + product_breakdown: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdown" + required: + - columns + type: object + CommitmentsUtilizationTimeseriesResponse: + description: Response containing timeseries utilization metrics for cloud commitment programs. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object CompletionCondition: description: The definition of `CompletionCondition` object. properties: @@ -17950,6 +18735,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: @@ -41463,6 +42282,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: @@ -57275,6 +58105,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: @@ -80811,6 +81650,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: @@ -80970,6 +81865,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: @@ -90077,6 +91065,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: + "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 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: + "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 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 @@ -97220,6 +98736,545 @@ paths: summary: List budgets tags: - Cloud Cost Management + /api/v2/cost/commitments/commitment-list: + get: + description: Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. + operationId: GetCommitmentsCommitmentList + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + commitments: + - commitment_id: ri-0123456789abcdef0 + expiration_date: "2025-12-31T00:00:00Z" + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + start_date: "2023-01-01T00:00:00Z" + term_length: 1 + utilization: 0.85 + schema: + $ref: "#/components/schemas/CommitmentsListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments list + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/coverage/scalar: + get: + description: Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. + operationId: GetCommitmentsCoverageScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: hours_coverage + type: number + values: + - 0.78 + schema: + $ref: "#/components/schemas/CommitmentsCoverageScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/coverage/timeseries: + get: + description: Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + operationId: GetCommitmentsCoverageTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + cost: + series: + on_demand_only: + - 1000.0 + - 900.0 + ri: + - 3600.0 + - 3700.0 + sp: + - 400.0 + - 400.0 + spot_only: + - 50.0 + - 50.0 + times: + - 1693526400 + - 1693612800 + hours: + series: + on_demand_only: + - 500.0 + - 450.0 + ri: + - 1800.0 + - 1850.0 + sp: + - 200.0 + - 200.0 + spot_only: + - 100.0 + - 100.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsCoverageTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/on-demand-hot-spots/scalar: + get: + description: Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. + operationId: GetCommitmentsOnDemandHotspotsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + total: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + schema: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments on-demand hot spots (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/savings/scalar: + get: + description: Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. + operationId: GetCommitmentsSavingsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: realized_savings + type: number + values: + - 2500.0 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: effective_savings_rate + type: number + values: + - 0.33 + schema: + $ref: "#/components/schemas/CommitmentsSavingsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/savings/timeseries: + get: + description: Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. + operationId: GetCommitmentsSavingsTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + actual_cost: + series: + total: + - 5000.0 + - 5200.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + effective_savings_rate: + series: + total: + - 0.33 + - 0.33 + times: + - 1693526400 + - 1693612800 + on_demand_equivalent_cost: + series: + total: + - 7500.0 + - 7800.0 + times: + - 1693526400 + - 1693612800 + realized_savings: + series: + total: + - 2500.0 + - 2600.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsSavingsTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/utilization/scalar: + get: + description: Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. + operationId: GetCommitmentsUtilizationScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - - rds + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: utilization + type: number + values: + - 0.85 + - 0.72 + schema: + $ref: "#/components/schemas/CommitmentsUtilizationScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/utilization/timeseries: + get: + description: Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. + operationId: GetCommitmentsUtilizationTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + series: + unused: + - 750.0 + - 600.0 + used: + - 4250.0 + - 4400.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + schema: + $ref: "#/components/schemas/CommitmentsUtilizationTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/custom_costs: get: description: List the Custom Costs files. diff --git a/examples/v2/app-builder/CreatePublishRequest.rb b/examples/v2/app-builder/CreatePublishRequest.rb new file mode 100644 index 000000000000..e41f678d5721 --- /dev/null +++ b/examples/v2/app-builder/CreatePublishRequest.rb @@ -0,0 +1,15 @@ +# Create Publish Request returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::CreatePublishRequestRequest.new({ + data: DatadogAPIClient::V2::CreatePublishRequestRequestData.new({ + attributes: DatadogAPIClient::V2::CreatePublishRequestRequestDataAttributes.new({ + description: "Adds new dashboard widgets and a few bug fixes.", + title: "Release v1.2 to production", + }), + type: DatadogAPIClient::V2::PublishRequestType::PUBLISHREQUEST, + }), +}) +p api_instance.create_publish_request("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/ListAppVersions.rb b/examples/v2/app-builder/ListAppVersions.rb new file mode 100644 index 000000000000..1c53dd590e11 --- /dev/null +++ b/examples/v2/app-builder/ListAppVersions.rb @@ -0,0 +1,5 @@ +# List App Versions returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.list_app_versions("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/app-builder/RevertApp.rb b/examples/v2/app-builder/RevertApp.rb new file mode 100644 index 000000000000..3c0650a918bd --- /dev/null +++ b/examples/v2/app-builder/RevertApp.rb @@ -0,0 +1,5 @@ +# Revert App returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new +p api_instance.revert_app("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "version") diff --git a/examples/v2/app-builder/UpdateAppFavorite.rb b/examples/v2/app-builder/UpdateAppFavorite.rb new file mode 100644 index 000000000000..13d3ed6442fc --- /dev/null +++ b/examples/v2/app-builder/UpdateAppFavorite.rb @@ -0,0 +1,14 @@ +# Update App Favorite Status returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppFavoriteRequest.new({ + data: DatadogAPIClient::V2::UpdateAppFavoriteRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppFavoriteRequestDataAttributes.new({ + favorite: true, + }), + type: DatadogAPIClient::V2::AppFavoriteType::FAVORITES, + }), +}) +api_instance.update_app_favorite("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/UpdateAppSelfService.rb b/examples/v2/app-builder/UpdateAppSelfService.rb new file mode 100644 index 000000000000..ea0308cb9039 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppSelfService.rb @@ -0,0 +1,14 @@ +# Update App Self-Service Status returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppSelfServiceRequest.new({ + data: DatadogAPIClient::V2::UpdateAppSelfServiceRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppSelfServiceRequestDataAttributes.new({ + self_service: true, + }), + type: DatadogAPIClient::V2::AppSelfServiceType::SELFSERVICE, + }), +}) +api_instance.update_app_self_service("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/UpdateAppTags.rb b/examples/v2/app-builder/UpdateAppTags.rb new file mode 100644 index 000000000000..04d8ec88dbab --- /dev/null +++ b/examples/v2/app-builder/UpdateAppTags.rb @@ -0,0 +1,17 @@ +# Update App Tags returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppTagsRequest.new({ + data: DatadogAPIClient::V2::UpdateAppTagsRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppTagsRequestDataAttributes.new({ + tags: [ + "team:platform", + "service:ops", + ], + }), + type: DatadogAPIClient::V2::AppTagsType::TAGS, + }), +}) +api_instance.update_app_tags("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/app-builder/UpdateAppVersionName.rb b/examples/v2/app-builder/UpdateAppVersionName.rb new file mode 100644 index 000000000000..b321d09ad329 --- /dev/null +++ b/examples/v2/app-builder/UpdateAppVersionName.rb @@ -0,0 +1,14 @@ +# Name App Version returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppVersionNameRequest.new({ + data: DatadogAPIClient::V2::UpdateAppVersionNameRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppVersionNameRequestDataAttributes.new({ + name: "v1.2.0 - bug fix release", + }), + type: DatadogAPIClient::V2::AppVersionNameType::VERSIONNAMES, + }), +}) +api_instance.update_app_version_name("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "version", body) diff --git a/examples/v2/app-builder/UpdateProtectionLevel.rb b/examples/v2/app-builder/UpdateProtectionLevel.rb new file mode 100644 index 000000000000..877c217e4443 --- /dev/null +++ b/examples/v2/app-builder/UpdateProtectionLevel.rb @@ -0,0 +1,14 @@ +# Update App Protection Level returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AppBuilderAPI.new + +body = DatadogAPIClient::V2::UpdateAppProtectionLevelRequest.new({ + data: DatadogAPIClient::V2::UpdateAppProtectionLevelRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateAppProtectionLevelRequestDataAttributes.new({ + protection_level: DatadogAPIClient::V2::AppProtectionLevel::APPROVAL_REQUIRED, + }), + type: DatadogAPIClient::V2::AppProtectionLevelType::PROTECTIONLEVEL, + }), +}) +p api_instance.update_protection_level("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.rb b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.rb new file mode 100644 index 000000000000..7803eb52da2f --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.rb @@ -0,0 +1,8 @@ +# Get commitments list returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_commitment_list".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_commitment_list(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.rb b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.rb new file mode 100644 index 000000000000..9d1c536c5256 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.rb @@ -0,0 +1,8 @@ +# Get commitments coverage (scalar) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_coverage_scalar".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_coverage_scalar(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.rb b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.rb new file mode 100644 index 000000000000..b29227270344 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.rb @@ -0,0 +1,8 @@ +# Get commitments coverage (timeseries) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_coverage_timeseries".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_coverage_timeseries(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.rb b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.rb new file mode 100644 index 000000000000..4b30d49b2953 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.rb @@ -0,0 +1,8 @@ +# Get commitments on-demand hot spots (scalar) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_on_demand_hotspots_scalar".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_on_demand_hotspots_scalar(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.rb b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.rb new file mode 100644 index 000000000000..11d489e6ac5c --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.rb @@ -0,0 +1,8 @@ +# Get commitments savings (scalar) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_savings_scalar".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_savings_scalar(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.rb b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.rb new file mode 100644 index 000000000000..a955933a626e --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.rb @@ -0,0 +1,8 @@ +# Get commitments savings (timeseries) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_savings_timeseries".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_savings_timeseries(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.rb b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.rb new file mode 100644 index 000000000000..c9e2c1902150 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.rb @@ -0,0 +1,8 @@ +# Get commitments utilization (scalar) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_utilization_scalar".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_utilization_scalar(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.rb b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.rb new file mode 100644 index 000000000000..2b3d230afdae --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.rb @@ -0,0 +1,8 @@ +# Get commitments utilization (timeseries) returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_commitments_utilization_timeseries".to_sym] = true +end +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.get_commitments_utilization_timeseries(CommitmentsProvider::AWS, "product", 9223372036854775807, 9223372036854775807) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 327230032135..e0af6c74bf75 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1355,6 +1355,40 @@ "v2.PublishApp" => { "app_id" => "UUID", }, + "v2.UpdateAppFavorite" => { + "app_id" => "UUID", + "body" => "UpdateAppFavoriteRequest", + }, + "v2.UpdateProtectionLevel" => { + "app_id" => "UUID", + "body" => "UpdateAppProtectionLevelRequest", + }, + "v2.CreatePublishRequest" => { + "app_id" => "UUID", + "body" => "CreatePublishRequestRequest", + }, + "v2.RevertApp" => { + "app_id" => "UUID", + "version" => "String", + }, + "v2.UpdateAppSelfService" => { + "app_id" => "UUID", + "body" => "UpdateAppSelfServiceRequest", + }, + "v2.UpdateAppTags" => { + "app_id" => "UUID", + "body" => "UpdateAppTagsRequest", + }, + "v2.UpdateAppVersionName" => { + "app_id" => "UUID", + "version" => "String", + "body" => "UpdateAppVersionNameRequest", + }, + "v2.ListAppVersions" => { + "app_id" => "UUID", + "limit" => "Integer", + "page" => "Integer", + }, "v2.ListAuditLogs" => { "filter_query" => "String", "filter_from" => "Time", @@ -2180,6 +2214,65 @@ "v2.GetBudget" => { "budget_id" => "String", }, + "v2.GetCommitmentsCommitmentList" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + "commitment_type" => "CommitmentsCommitmentType", + }, + "v2.GetCommitmentsCoverageScalar" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + }, + "v2.GetCommitmentsCoverageTimeseries" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + }, + "v2.GetCommitmentsOnDemandHotspotsScalar" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + }, + "v2.GetCommitmentsSavingsScalar" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + }, + "v2.GetCommitmentsSavingsTimeseries" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + }, + "v2.GetCommitmentsUtilizationScalar" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + "commitment_type" => "CommitmentsCommitmentType", + }, + "v2.GetCommitmentsUtilizationTimeseries" => { + "provider" => "CommitmentsProvider", + "product" => "String", + "start" => "Integer", + "_end" => "Integer", + "filter_by" => "String", + "commitment_type" => "CommitmentsCommitmentType", + }, "v2.ListCustomCostsFiles" => { "page_number" => "Integer", "page_size" => "Integer", diff --git a/features/v2/app_builder.feature b/features/v2/app_builder.feature index 1ef2502e807c..bbc0caf196fd 100644 --- a/features/v2/app_builder.feature +++ b/features/v2/app_builder.feature @@ -27,6 +27,30 @@ Feature: App Builder Then the response status is 201 Created And the response "data.type" is equal to "appDefinitions" + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Bad Request" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Created" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Create Publish Request returns "Not Found" response + Given new "CreatePublishRequest" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Adds new dashboard widgets and a few bug fixes.", "title": "Release v1.2 to production"}, "type": "publishRequest"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend Scenario: Delete App returns "Bad Request" response Given new "DeleteApp" request @@ -115,6 +139,27 @@ Feature: App Builder And the response "data.id" has the same value as "app.data.id" And the response "data.type" is equal to "appDefinitions" + @generated @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "Bad Request" response + Given new "ListAppVersions" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "Not Found" response + Given new "ListAppVersions" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List App Versions returns "OK" response + Given new "ListAppVersions" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend Scenario: List Apps returns "Bad Request" response Given new "ListApps" request @@ -127,6 +172,33 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "Bad Request" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "No Content" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Name App Version returns "Not Found" response + Given new "UpdateAppVersionName" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "v1.2.0 - bug fix release"}, "type": "versionNames"}} + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/app-builder-backend Scenario: Publish App returns "Bad Request" response Given new "PublishApp" request @@ -149,6 +221,30 @@ Feature: App Builder When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "Bad Request" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "Not Found" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Revert App returns "OK" response + Given new "RevertApp" request + And request contains "app_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/app-builder-backend Scenario: Unpublish App returns "Bad Request" response Given new "UnpublishApp" request @@ -171,6 +267,102 @@ Feature: App Builder When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "Bad Request" response + Given new "UpdateAppFavorite" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"favorite": true}, "type": "favorites"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Favorite Status returns "No Content" 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 204 No Content + + @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 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 "No Content" 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 204 No Content + + @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 Tags returns "Bad Request" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "No Content" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Update App Tags returns "Not Found" response + Given new "UpdateAppTags" request + And request contains "app_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"tags": ["team:platform", "service:ops"]}, "type": "tags"}} + When the request is sent + Then the response status is 404 Not Found + @skip-typescript @team:DataDog/app-builder-backend Scenario: Update App returns "Bad Request" response Given new "UpdateApp" request diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index d06acba8d826..76cb7c1d63ec 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -294,6 +294,182 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "Bad Request" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "OK" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "OK" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments list returns "Bad Request" response + Given operation "GetCommitmentsCommitmentList" enabled + And new "GetCommitmentsCommitmentList" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments list returns "OK" response + Given operation "GetCommitmentsCommitmentList" enabled + And new "GetCommitmentsCommitmentList" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "Bad Request" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "OK" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "Bad Request" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "OK" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "OK" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "OK" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "OK" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" request + And request contains "provider" parameter from "REPLACE.ME" + And request contains "product" parameter from "REPLACE.ME" + And request contains "start" parameter from "REPLACE.ME" + And request contains "end" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 35b117222c31..7a5941a2c04d 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -632,6 +632,61 @@ "type": "idempotent" } }, + "UpdateAppFavorite": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateProtectionLevel": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "CreatePublishRequest": { + "tag": "App Builder", + "undo": { + "operationId": "DeleteApp", + "parameters": [ + { + "name": "app_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RevertApp": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppSelfService": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppTags": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "UpdateAppVersionName": { + "tag": "App Builder", + "undo": { + "type": "idempotent" + } + }, + "ListAppVersions": { + "tag": "App Builder", + "undo": { + "type": "safe" + } + }, "ListApplicationKeys": { "tag": "Key Management", "undo": { @@ -1428,6 +1483,54 @@ "type": "safe" } }, + "GetCommitmentsCommitmentList": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsOnDemandHotspotsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCustomCostsFiles": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index f82dd5b795de..3a758c49609b 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -294,6 +294,14 @@ def initialize "v2.get_code_coverage_branch_summary": false, "v2.get_code_coverage_commit_summary": false, "v2.get_rule_based_view": false, + "v2.get_commitments_commitment_list": false, + "v2.get_commitments_coverage_scalar": false, + "v2.get_commitments_coverage_timeseries": false, + "v2.get_commitments_on_demand_hotspots_scalar": false, + "v2.get_commitments_savings_scalar": false, + "v2.get_commitments_savings_timeseries": false, + "v2.get_commitments_utilization_scalar": false, + "v2.get_commitments_utilization_timeseries": false, "v2.get_cost_anomaly": false, "v2.list_cost_anomalies": false, "v2.create_dashboard_secure_embed": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 45ad6b34a48b..9c4f484bec99 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1215,6 +1215,7 @@ def overrides "v2.app_builder_event_type" => "AppBuilderEventType", "v2.app_definition_type" => "AppDefinitionType", "v2.app_deployment_type" => "AppDeploymentType", + "v2.app_favorite_type" => "AppFavoriteType", "v2.app_key_registration_data" => "AppKeyRegistrationData", "v2.app_key_registration_data_type" => "AppKeyRegistrationDataType", "v2.application_key_create_attributes" => "ApplicationKeyCreateAttributes", @@ -1272,9 +1273,17 @@ def overrides "v2.application_security_waf_exclusion_filter_update_data" => "ApplicationSecurityWafExclusionFilterUpdateData", "v2.application_security_waf_exclusion_filter_update_request" => "ApplicationSecurityWafExclusionFilterUpdateRequest", "v2.app_meta" => "AppMeta", + "v2.app_protection_level" => "AppProtectionLevel", + "v2.app_protection_level_type" => "AppProtectionLevelType", "v2.app_relationship" => "AppRelationship", + "v2.app_self_service_type" => "AppSelfServiceType", "v2.apps_sort_field" => "AppsSortField", + "v2.app_tags_type" => "AppTagsType", "v2.app_trigger_wrapper" => "AppTriggerWrapper", + "v2.app_version" => "AppVersion", + "v2.app_version_attributes" => "AppVersionAttributes", + "v2.app_version_name_type" => "AppVersionNameType", + "v2.app_version_type" => "AppVersionType", "v2.arbitrary_cost_upsert_request" => "ArbitraryCostUpsertRequest", "v2.arbitrary_cost_upsert_request_data" => "ArbitraryCostUpsertRequestData", "v2.arbitrary_cost_upsert_request_data_attributes" => "ArbitraryCostUpsertRequestDataAttributes", @@ -1883,6 +1892,32 @@ def overrides "v2.commit_coverage_summary_request_attributes" => "CommitCoverageSummaryRequestAttributes", "v2.commit_coverage_summary_request_data" => "CommitCoverageSummaryRequestData", "v2.commit_coverage_summary_request_type" => "CommitCoverageSummaryRequestType", + "v2.commitments_aws_ec2_ri_commitment" => "CommitmentsAwsEC2RICommitment", + "v2.commitments_aws_elasticache_ri_commitment" => "CommitmentsAwsElasticacheRICommitment", + "v2.commitments_aws_rdsri_commitment" => "CommitmentsAwsRDSRICommitment", + "v2.commitments_aws_sp_commitment" => "CommitmentsAwsSPCommitment", + "v2.commitments_azure_compute_sp_commitment" => "CommitmentsAzureComputeSPCommitment", + "v2.commitments_azure_vmri_commitment" => "CommitmentsAzureVMRICommitment", + "v2.commitments_azure_vmri_status" => "CommitmentsAzureVMRIStatus", + "v2.commitments_commitment_type" => "CommitmentsCommitmentType", + "v2.commitments_coverage_scalar_response" => "CommitmentsCoverageScalarResponse", + "v2.commitments_coverage_timeseries_response" => "CommitmentsCoverageTimeseriesResponse", + "v2.commitments_list_item" => "CommitmentsListItem", + "v2.commitments_list_meta" => "CommitmentsListMeta", + "v2.commitments_list_response" => "CommitmentsListResponse", + "v2.commitments_on_demand_hotspots_scalar_meta" => "CommitmentsOnDemandHotspotsScalarMeta", + "v2.commitments_on_demand_hotspots_scalar_response" => "CommitmentsOnDemandHotspotsScalarResponse", + "v2.commitments_provider" => "CommitmentsProvider", + "v2.commitments_savings_scalar_response" => "CommitmentsSavingsScalarResponse", + "v2.commitments_savings_timeseries_response" => "CommitmentsSavingsTimeseriesResponse", + "v2.commitments_scalar_column" => "CommitmentsScalarColumn", + "v2.commitments_scalar_column_meta" => "CommitmentsScalarColumnMeta", + "v2.commitments_scalar_column_type" => "CommitmentsScalarColumnType", + "v2.commitments_timeseries_metric" => "CommitmentsTimeseriesMetric", + "v2.commitments_unit" => "CommitmentsUnit", + "v2.commitments_utilization_scalar_product_breakdown_entry" => "CommitmentsUtilizationScalarProductBreakdownEntry", + "v2.commitments_utilization_scalar_response" => "CommitmentsUtilizationScalarResponse", + "v2.commitments_utilization_timeseries_response" => "CommitmentsUtilizationTimeseriesResponse", "v2.completion_condition" => "CompletionCondition", "v2.completion_condition_operator" => "CompletionConditionOperator", "v2.completion_gate" => "CompletionGate", @@ -2128,6 +2163,9 @@ def overrides "v2.create_page_response_data" => "CreatePageResponseData", "v2.create_page_response_data_type" => "CreatePageResponseDataType", "v2.create_phone_notification_channel_config" => "CreatePhoneNotificationChannelConfig", + "v2.create_publish_request_request" => "CreatePublishRequestRequest", + "v2.create_publish_request_request_data" => "CreatePublishRequestRequestData", + "v2.create_publish_request_request_data_attributes" => "CreatePublishRequestRequestDataAttributes", "v2.create_rule_request" => "CreateRuleRequest", "v2.create_rule_request_data" => "CreateRuleRequestData", "v2.create_rule_response" => "CreateRuleResponse", @@ -3474,6 +3512,7 @@ def overrides "v2.list_apps_response_data_items_relationships" => "ListAppsResponseDataItemsRelationships", "v2.list_apps_response_meta" => "ListAppsResponseMeta", "v2.list_apps_response_meta_page" => "ListAppsResponseMetaPage", + "v2.list_app_versions_response" => "ListAppVersionsResponse", "v2.list_assets_sbo_ms_response" => "ListAssetsSBOMsResponse", "v2.list_campaigns_response" => "ListCampaignsResponse", "v2.list_connections_response" => "ListConnectionsResponse", @@ -4669,6 +4708,7 @@ def overrides "v2.project_update_attributes" => "ProjectUpdateAttributes", "v2.project_update_request" => "ProjectUpdateRequest", "v2.publish_app_response" => "PublishAppResponse", + "v2.publish_request_type" => "PublishRequestType", "v2.put_apps_datastore_item_response_array" => "PutAppsDatastoreItemResponseArray", "v2.put_apps_datastore_item_response_data" => "PutAppsDatastoreItemResponseData", "v2.put_incident_notification_rule_request" => "PutIncidentNotificationRuleRequest", @@ -6149,6 +6189,12 @@ def overrides "v2.unpublish_app_response" => "UnpublishAppResponse", "v2.update_action_connection_request" => "UpdateActionConnectionRequest", "v2.update_action_connection_response" => "UpdateActionConnectionResponse", + "v2.update_app_favorite_request" => "UpdateAppFavoriteRequest", + "v2.update_app_favorite_request_data" => "UpdateAppFavoriteRequestData", + "v2.update_app_favorite_request_data_attributes" => "UpdateAppFavoriteRequestDataAttributes", + "v2.update_app_protection_level_request" => "UpdateAppProtectionLevelRequest", + "v2.update_app_protection_level_request_data" => "UpdateAppProtectionLevelRequestData", + "v2.update_app_protection_level_request_data_attributes" => "UpdateAppProtectionLevelRequestDataAttributes", "v2.update_app_request" => "UpdateAppRequest", "v2.update_app_request_data" => "UpdateAppRequestData", "v2.update_app_request_data_attributes" => "UpdateAppRequestDataAttributes", @@ -6163,6 +6209,15 @@ def overrides "v2.update_apps_datastore_request" => "UpdateAppsDatastoreRequest", "v2.update_apps_datastore_request_data" => "UpdateAppsDatastoreRequestData", "v2.update_apps_datastore_request_data_attributes" => "UpdateAppsDatastoreRequestDataAttributes", + "v2.update_app_self_service_request" => "UpdateAppSelfServiceRequest", + "v2.update_app_self_service_request_data" => "UpdateAppSelfServiceRequestData", + "v2.update_app_self_service_request_data_attributes" => "UpdateAppSelfServiceRequestDataAttributes", + "v2.update_app_tags_request" => "UpdateAppTagsRequest", + "v2.update_app_tags_request_data" => "UpdateAppTagsRequestData", + "v2.update_app_tags_request_data_attributes" => "UpdateAppTagsRequestDataAttributes", + "v2.update_app_version_name_request" => "UpdateAppVersionNameRequest", + "v2.update_app_version_name_request_data" => "UpdateAppVersionNameRequestData", + "v2.update_app_version_name_request_data_attributes" => "UpdateAppVersionNameRequestDataAttributes", "v2.update_campaign_request" => "UpdateCampaignRequest", "v2.update_campaign_request_attributes" => "UpdateCampaignRequestAttributes", "v2.update_campaign_request_data" => "UpdateCampaignRequestData", diff --git a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb index 579e4dd1b2c1..4ada1bf0fac1 100644 --- a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb +++ b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb @@ -34,5 +34,6 @@ class FormulaAndFunctionEventsDataSource INCIDENT_ANALYTICS = "incident_analytics".freeze PRODUCT_ANALYTICS = "product_analytics".freeze ON_CALL_EVENTS = "on_call_events".freeze + ERRORS = "errors".freeze end end diff --git a/lib/datadog_api_client/v2/api/app_builder_api.rb b/lib/datadog_api_client/v2/api/app_builder_api.rb index b8b9468b48bf..00b73ec0b2cb 100644 --- a/lib/datadog_api_client/v2/api/app_builder_api.rb +++ b/lib/datadog_api_client/v2/api/app_builder_api.rb @@ -90,6 +90,78 @@ def create_app_with_http_info(body, opts = {}) return data, status_code, headers end + # Create Publish Request. + # + # @see #create_publish_request_with_http_info + def create_publish_request(app_id, body, opts = {}) + data, _status_code, _headers = create_publish_request_with_http_info(app_id, body, opts) + data + end + + # Create Publish Request. + # + # Create a publish request to ask for approval to publish an app whose protection level is `approval_required`. Publishing happens automatically once the request is approved by a user with the appropriate permissions. + # + # @param app_id [UUID] The ID of the app. + # @param body [CreatePublishRequestRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PublishAppResponse, Integer, Hash)>] PublishAppResponse data, response status code and response headers + def create_publish_request_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.create_publish_request ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.create_publish_request" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AppBuilderAPI.create_publish_request" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/publish-request'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'PublishAppResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_publish_request, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#create_publish_request\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete App. # # @see #delete_app_with_http_info @@ -371,6 +443,75 @@ def list_apps_with_http_info(opts = {}) return data, status_code, headers end + # List App Versions. + # + # @see #list_app_versions_with_http_info + def list_app_versions(app_id, opts = {}) + data, _status_code, _headers = list_app_versions_with_http_info(app_id, opts) + data + end + + # List App Versions. + # + # List the versions of an app. This endpoint is paginated. + # + # @param app_id [UUID] The ID of the app. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :limit The number of versions to return per page. + # @option opts [Integer] :page The page number to return. + # @return [Array<(ListAppVersionsResponse, Integer, Hash)>] ListAppVersionsResponse data, response status code and response headers + def list_app_versions_with_http_info(app_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.list_app_versions ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.list_app_versions" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/versions'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListAppVersionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_app_versions, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#list_app_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Publish App. # # @see #publish_app_with_http_info @@ -436,6 +577,77 @@ def publish_app_with_http_info(app_id, opts = {}) return data, status_code, headers end + # Revert App. + # + # @see #revert_app_with_http_info + def revert_app(app_id, version, opts = {}) + data, _status_code, _headers = revert_app_with_http_info(app_id, version, opts) + data + end + + # Revert App. + # + # Revert an app to a previous version. The version to revert to is selected through the `version` query parameter. The reverted version becomes the new latest version of the app. + # + # @param app_id [UUID] The ID of the app. + # @param version [String] The version number of the app to revert to. Cannot be `latest`. The special value `deployed` can be used to revert to the currently published version. + # @param opts [Hash] the optional parameters + # @return [Array<(UpdateAppResponse, Integer, Hash)>] UpdateAppResponse data, response status code and response headers + def revert_app_with_http_info(app_id, version, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.revert_app ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.revert_app" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling AppBuilderAPI.revert_app" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/revert'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = version + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UpdateAppResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :revert_app, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#revert_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Unpublish App. # # @see #unpublish_app_with_http_info @@ -572,5 +784,371 @@ def update_app_with_http_info(app_id, body, opts = {}) end return data, status_code, headers end + + # Update App Favorite Status. + # + # @see #update_app_favorite_with_http_info + def update_app_favorite(app_id, body, opts = {}) + update_app_favorite_with_http_info(app_id, body, opts) + nil + end + + # Update App Favorite Status. + # + # Add or remove an app from the current user's favorites. Favorited apps can be filtered for using the `filter[favorite]` query parameter on the [List Apps](https://docs.datadoghq.com/api/latest/app-builder/#list-apps) endpoint. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppFavoriteRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_favorite_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_favorite ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_favorite" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AppBuilderAPI.update_app_favorite" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/favorite'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_app_favorite, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#update_app_favorite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update App Self-Service Status. + # + # @see #update_app_self_service_with_http_info + def update_app_self_service(app_id, body, opts = {}) + update_app_self_service_with_http_info(app_id, body, opts) + nil + end + + # Update App Self-Service Status. + # + # Enable or disable self-service for an app. Self-service apps can be discovered and run by users in your organization without explicit access being granted. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppSelfServiceRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_self_service_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_self_service ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_self_service" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AppBuilderAPI.update_app_self_service" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/self-service'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_app_self_service, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#update_app_self_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update App Tags. + # + # @see #update_app_tags_with_http_info + def update_app_tags(app_id, body, opts = {}) + update_app_tags_with_http_info(app_id, body, opts) + nil + end + + # Update App Tags. + # + # Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not present in the request body are removed. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppTagsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_tags_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_tags ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_tags" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AppBuilderAPI.update_app_tags" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/tags'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_app_tags, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#update_app_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Name App Version. + # + # @see #update_app_version_name_with_http_info + def update_app_version_name(app_id, version, body, opts = {}) + update_app_version_name_with_http_info(app_id, version, body, opts) + nil + end + + # Name App Version. + # + # Assign a human-readable name to a specific version of an app. The version is selected through the `version` query parameter. + # + # @param app_id [UUID] The ID of the app. + # @param version [String] The version number of the app to name. The special values `latest` and `deployed` can also be used to target the latest or currently published version. + # @param body [UpdateAppVersionNameRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_app_version_name_with_http_info(app_id, version, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_app_version_name ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_app_version_name" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling AppBuilderAPI.update_app_version_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AppBuilderAPI.update_app_version_name" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/version-name'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'version'] = version + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_app_version_name, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#update_app_version_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update App Protection Level. + # + # @see #update_protection_level_with_http_info + def update_protection_level(app_id, body, opts = {}) + data, _status_code, _headers = update_protection_level_with_http_info(app_id, body, opts) + data + end + + # Update App Protection Level. + # + # Update the publication protection level of an app. When set to `approval_required`, future publishes must go through an approval workflow before going live. + # + # @param app_id [UUID] The ID of the app. + # @param body [UpdateAppProtectionLevelRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(UpdateAppResponse, Integer, Hash)>] UpdateAppResponse data, response status code and response headers + def update_protection_level_with_http_info(app_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AppBuilderAPI.update_protection_level ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling AppBuilderAPI.update_protection_level" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AppBuilderAPI.update_protection_level" + end + # resource path + local_var_path = '/api/v2/app-builder/apps/{app_id}/protection-level'.sub('{app_id}', CGI.escape(app_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'UpdateAppResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_protection_level, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AppBuilderAPI#update_protection_level\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 2a8f0b28274e..2bf010d7e35e 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -890,6 +890,800 @@ def get_budget_with_http_info(budget_id, opts = {}) return data, status_code, headers end + # Get commitments list. + # + # @see #get_commitments_commitment_list_with_http_info + def get_commitments_commitment_list(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_commitment_list_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments list. + # + # Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @option opts [CommitmentsCommitmentType] :commitment_type Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + # @return [Array<(CommitmentsListResponse, Integer, Hash)>] CommitmentsListResponse data, response status code and response headers + def get_commitments_commitment_list_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_commitment_list".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_commitment_list") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_commitment_list")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_commitment_list ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_commitment_list" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_commitment_list" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_commitment_list" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_commitment_list" + end + allowable_values = ['ri', 'sp'] + if @api_client.config.client_side_validation && opts[:'commitment_type'] && !allowable_values.include?(opts[:'commitment_type']) + fail ArgumentError, "invalid value for \"commitment_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/cost/commitments/commitment-list' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + query_params[:'commitmentType'] = opts[:'commitment_type'] if !opts[:'commitment_type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_commitment_list, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_commitment_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments coverage (scalar). + # + # @see #get_commitments_coverage_scalar_with_http_info + def get_commitments_coverage_scalar(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_coverage_scalar_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments coverage (scalar). + # + # Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @return [Array<(CommitmentsCoverageScalarResponse, Integer, Hash)>] CommitmentsCoverageScalarResponse data, response status code and response headers + def get_commitments_coverage_scalar_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_coverage_scalar".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_coverage_scalar") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_coverage_scalar")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_coverage_scalar ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_coverage_scalar" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_coverage_scalar" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_coverage_scalar" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_coverage_scalar" + end + # resource path + local_var_path = '/api/v2/cost/commitments/coverage/scalar' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsCoverageScalarResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_coverage_scalar, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_coverage_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments coverage (timeseries). + # + # @see #get_commitments_coverage_timeseries_with_http_info + def get_commitments_coverage_timeseries(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_coverage_timeseries_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments coverage (timeseries). + # + # Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @return [Array<(CommitmentsCoverageTimeseriesResponse, Integer, Hash)>] CommitmentsCoverageTimeseriesResponse data, response status code and response headers + def get_commitments_coverage_timeseries_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_coverage_timeseries".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_coverage_timeseries") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_coverage_timeseries")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_coverage_timeseries ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_coverage_timeseries" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_coverage_timeseries" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_coverage_timeseries" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_coverage_timeseries" + end + # resource path + local_var_path = '/api/v2/cost/commitments/coverage/timeseries' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsCoverageTimeseriesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_coverage_timeseries, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_coverage_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments on-demand hot spots (scalar). + # + # @see #get_commitments_on_demand_hotspots_scalar_with_http_info + def get_commitments_on_demand_hotspots_scalar(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_on_demand_hotspots_scalar_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments on-demand hot spots (scalar). + # + # Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @return [Array<(CommitmentsOnDemandHotspotsScalarResponse, Integer, Hash)>] CommitmentsOnDemandHotspotsScalarResponse data, response status code and response headers + def get_commitments_on_demand_hotspots_scalar_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_on_demand_hotspots_scalar".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_on_demand_hotspots_scalar") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_on_demand_hotspots_scalar")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_on_demand_hotspots_scalar ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_on_demand_hotspots_scalar" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_on_demand_hotspots_scalar" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_on_demand_hotspots_scalar" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_on_demand_hotspots_scalar" + end + # resource path + local_var_path = '/api/v2/cost/commitments/on-demand-hot-spots/scalar' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsOnDemandHotspotsScalarResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_on_demand_hotspots_scalar, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_on_demand_hotspots_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments savings (scalar). + # + # @see #get_commitments_savings_scalar_with_http_info + def get_commitments_savings_scalar(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_savings_scalar_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments savings (scalar). + # + # Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @return [Array<(CommitmentsSavingsScalarResponse, Integer, Hash)>] CommitmentsSavingsScalarResponse data, response status code and response headers + def get_commitments_savings_scalar_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_savings_scalar".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_savings_scalar") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_savings_scalar")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_savings_scalar ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_savings_scalar" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_savings_scalar" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_savings_scalar" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_savings_scalar" + end + # resource path + local_var_path = '/api/v2/cost/commitments/savings/scalar' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsSavingsScalarResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_savings_scalar, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_savings_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments savings (timeseries). + # + # @see #get_commitments_savings_timeseries_with_http_info + def get_commitments_savings_timeseries(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_savings_timeseries_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments savings (timeseries). + # + # Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @return [Array<(CommitmentsSavingsTimeseriesResponse, Integer, Hash)>] CommitmentsSavingsTimeseriesResponse data, response status code and response headers + def get_commitments_savings_timeseries_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_savings_timeseries".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_savings_timeseries") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_savings_timeseries")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_savings_timeseries ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_savings_timeseries" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_savings_timeseries" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_savings_timeseries" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_savings_timeseries" + end + # resource path + local_var_path = '/api/v2/cost/commitments/savings/timeseries' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsSavingsTimeseriesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_savings_timeseries, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_savings_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments utilization (scalar). + # + # @see #get_commitments_utilization_scalar_with_http_info + def get_commitments_utilization_scalar(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_utilization_scalar_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments utilization (scalar). + # + # Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @option opts [CommitmentsCommitmentType] :commitment_type Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + # @return [Array<(CommitmentsUtilizationScalarResponse, Integer, Hash)>] CommitmentsUtilizationScalarResponse data, response status code and response headers + def get_commitments_utilization_scalar_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_utilization_scalar".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_utilization_scalar") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_utilization_scalar")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_utilization_scalar ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_utilization_scalar" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_utilization_scalar" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_utilization_scalar" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_utilization_scalar" + end + allowable_values = ['ri', 'sp'] + if @api_client.config.client_side_validation && opts[:'commitment_type'] && !allowable_values.include?(opts[:'commitment_type']) + fail ArgumentError, "invalid value for \"commitment_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/cost/commitments/utilization/scalar' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + query_params[:'commitmentType'] = opts[:'commitment_type'] if !opts[:'commitment_type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsUtilizationScalarResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_utilization_scalar, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_utilization_scalar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get commitments utilization (timeseries). + # + # @see #get_commitments_utilization_timeseries_with_http_info + def get_commitments_utilization_timeseries(provider, product, start, _end, opts = {}) + data, _status_code, _headers = get_commitments_utilization_timeseries_with_http_info(provider, product, start, _end, opts) + data + end + + # Get commitments utilization (timeseries). + # + # Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. + # + # @param provider [CommitmentsProvider] Cloud provider for commitment programs (aws or azure). + # @param product [String] Cloud product identifier (for example, ec2, rds, virtualmachines). + # @param start [Integer] Start of the query time range in Unix milliseconds. + # @param _end [Integer] End of the query time range in Unix milliseconds. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_by Optional filter expression to narrow down results. + # @option opts [CommitmentsCommitmentType] :commitment_type Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + # @return [Array<(CommitmentsUtilizationTimeseriesResponse, Integer, Hash)>] CommitmentsUtilizationTimeseriesResponse data, response status code and response headers + def get_commitments_utilization_timeseries_with_http_info(provider, product, start, _end, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_commitments_utilization_timeseries".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_commitments_utilization_timeseries") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_commitments_utilization_timeseries")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.get_commitments_utilization_timeseries ...' + end + # verify the required parameter 'provider' is set + if @api_client.config.client_side_validation && provider.nil? + fail ArgumentError, "Missing the required parameter 'provider' when calling CloudCostManagementAPI.get_commitments_utilization_timeseries" + end + # verify enum value + allowable_values = ['aws', 'azure'] + if @api_client.config.client_side_validation && !allowable_values.include?(provider) + fail ArgumentError, "invalid value for \"provider\", must be one of #{allowable_values}" + end + # verify the required parameter 'product' is set + if @api_client.config.client_side_validation && product.nil? + fail ArgumentError, "Missing the required parameter 'product' when calling CloudCostManagementAPI.get_commitments_utilization_timeseries" + end + # verify the required parameter 'start' is set + if @api_client.config.client_side_validation && start.nil? + fail ArgumentError, "Missing the required parameter 'start' when calling CloudCostManagementAPI.get_commitments_utilization_timeseries" + end + # verify the required parameter '_end' is set + if @api_client.config.client_side_validation && _end.nil? + fail ArgumentError, "Missing the required parameter '_end' when calling CloudCostManagementAPI.get_commitments_utilization_timeseries" + end + allowable_values = ['ri', 'sp'] + if @api_client.config.client_side_validation && opts[:'commitment_type'] && !allowable_values.include?(opts[:'commitment_type']) + fail ArgumentError, "invalid value for \"commitment_type\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/cost/commitments/utilization/timeseries' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'provider'] = provider + query_params[:'product'] = product + query_params[:'start'] = start + query_params[:'end'] = _end + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + query_params[:'commitmentType'] = opts[:'commitment_type'] if !opts[:'commitment_type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CommitmentsUtilizationTimeseriesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_commitments_utilization_timeseries, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#get_commitments_utilization_timeseries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get cost anomaly. # # @see #get_cost_anomaly_with_http_info diff --git a/lib/datadog_api_client/v2/models/app_favorite_type.rb b/lib/datadog_api_client/v2/models/app_favorite_type.rb new file mode 100644 index 000000000000..8d533114ad30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_favorite_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The favorite resource type. + class AppFavoriteType + include BaseEnumModel + + FAVORITES = "favorites".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_protection_level.rb b/lib/datadog_api_client/v2/models/app_protection_level.rb new file mode 100644 index 000000000000..62b0ecc3678e --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_protection_level.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + class AppProtectionLevel + include BaseEnumModel + + DIRECT_PUBLISH = "direct_publish".freeze + APPROVAL_REQUIRED = "approval_required".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_protection_level_type.rb b/lib/datadog_api_client/v2/models/app_protection_level_type.rb new file mode 100644 index 000000000000..34d0bf657492 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_protection_level_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The protection-level resource type. + class AppProtectionLevelType + include BaseEnumModel + + PROTECTIONLEVEL = "protectionLevel".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_self_service_type.rb b/lib/datadog_api_client/v2/models/app_self_service_type.rb new file mode 100644 index 000000000000..d1ac3547c6ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_self_service_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The self-service resource type. + class AppSelfServiceType + include BaseEnumModel + + SELFSERVICE = "selfService".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_tags_type.rb b/lib/datadog_api_client/v2/models/app_tags_type.rb new file mode 100644 index 000000000000..00a3a0eca05d --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_tags_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The tags resource type. + class AppTagsType + include BaseEnumModel + + TAGS = "tags".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_version.rb b/lib/datadog_api_client/v2/models/app_version.rb new file mode 100644 index 000000000000..2decf602950f --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A version of an app. + class AppVersion + include BaseGenericModel + + # Attributes describing an app version. + attr_accessor :attributes + + # The ID of the app version. + attr_accessor :id + + # The app-version resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AppVersionAttributes', + :'id' => :'UUID', + :'type' => :'AppVersionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AppVersion` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/app_version_attributes.rb b/lib/datadog_api_client/v2/models/app_version_attributes.rb new file mode 100644 index 000000000000..0ac2e1be6c12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version_attributes.rb @@ -0,0 +1,185 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes describing an app version. + class AppVersionAttributes + include BaseGenericModel + + # The ID of the app this version belongs to. + attr_accessor :app_id + + # Timestamp of when the version was created. + attr_accessor :created_at + + # Whether this version has ever been published. + attr_accessor :has_ever_been_published + + # The optional human-readable name of the version. + attr_accessor :name + + # Timestamp of when the version was last updated. + attr_accessor :updated_at + + # The ID of the user who created the version. + attr_accessor :user_id + + # The name (or email) of the user who created the version. + attr_accessor :user_name + + # The UUID of the user who created the version. + attr_accessor :user_uuid + + # The version number of the app, starting at 1. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'app_id' => :'app_id', + :'created_at' => :'created_at', + :'has_ever_been_published' => :'has_ever_been_published', + :'name' => :'name', + :'updated_at' => :'updated_at', + :'user_id' => :'user_id', + :'user_name' => :'user_name', + :'user_uuid' => :'user_uuid', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'app_id' => :'UUID', + :'created_at' => :'Time', + :'has_ever_been_published' => :'Boolean', + :'name' => :'String', + :'updated_at' => :'Time', + :'user_id' => :'Integer', + :'user_name' => :'String', + :'user_uuid' => :'UUID', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AppVersionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'app_id') + self.app_id = attributes[:'app_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'has_ever_been_published') + self.has_ever_been_published = attributes[:'has_ever_been_published'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'user_name') + self.user_name = attributes[:'user_name'] + end + + if attributes.key?(:'user_uuid') + self.user_uuid = attributes[:'user_uuid'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + app_id == o.app_id && + created_at == o.created_at && + has_ever_been_published == o.has_ever_been_published && + name == o.name && + updated_at == o.updated_at && + user_id == o.user_id && + user_name == o.user_name && + user_uuid == o.user_uuid && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [app_id, created_at, has_ever_been_published, name, updated_at, user_id, user_name, user_uuid, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/app_version_name_type.rb b/lib/datadog_api_client/v2/models/app_version_name_type.rb new file mode 100644 index 000000000000..926842a6703a --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version_name_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The version-name resource type. + class AppVersionNameType + include BaseEnumModel + + VERSIONNAMES = "versionNames".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/app_version_type.rb b/lib/datadog_api_client/v2/models/app_version_type.rb new file mode 100644 index 000000000000..57b337b1e970 --- /dev/null +++ b/lib/datadog_api_client/v2/models/app_version_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The app-version resource type. + class AppVersionType + include BaseEnumModel + + APPVERSIONS = "appVersions".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_aws_ec2_ri_commitment.rb b/lib/datadog_api_client/v2/models/commitments_aws_ec2_ri_commitment.rb new file mode 100644 index 000000000000..e7cc57d3ca36 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_aws_ec2_ri_commitment.rb @@ -0,0 +1,298 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS EC2 Reserved Instance commitment details. + class CommitmentsAwsEC2RICommitment + include BaseGenericModel + + # The availability zone of the reservation. + attr_accessor :availability_zone + + # The unique identifier of the Reserved Instance. + attr_reader :commitment_id + + # The expiration date of the commitment. + attr_accessor :expiration_date + + # The EC2 instance type. + attr_reader :instance_type + + # The number of Normalized Capacity Units. + attr_accessor :number_of_nfus + + # The number of reserved instances. + attr_accessor :number_of_reservations + + # The offering class of the Reserved Instance. + attr_reader :offering_class + + # The operating system of the Reserved Instance. + attr_reader :operating_system + + # The payment option for the Reserved Instance. + attr_reader :purchase_option + + # The AWS region of the Reserved Instance. + attr_reader :region + + # The start date of the commitment. + attr_accessor :start_date + + # The term length in years. + attr_accessor :term_length + + # The utilization percentage of the commitment. + attr_accessor :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'availability_zone' => :'availability_zone', + :'commitment_id' => :'commitment_id', + :'expiration_date' => :'expiration_date', + :'instance_type' => :'instance_type', + :'number_of_nfus' => :'number_of_nfus', + :'number_of_reservations' => :'number_of_reservations', + :'offering_class' => :'offering_class', + :'operating_system' => :'operating_system', + :'purchase_option' => :'purchase_option', + :'region' => :'region', + :'start_date' => :'start_date', + :'term_length' => :'term_length', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'availability_zone' => :'String', + :'commitment_id' => :'String', + :'expiration_date' => :'String', + :'instance_type' => :'String', + :'number_of_nfus' => :'Float', + :'number_of_reservations' => :'Float', + :'offering_class' => :'String', + :'operating_system' => :'String', + :'purchase_option' => :'String', + :'region' => :'String', + :'start_date' => :'String', + :'term_length' => :'Float', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsAwsEC2RICommitment` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'availability_zone') + self.availability_zone = attributes[:'availability_zone'] + end + + if attributes.key?(:'commitment_id') + self.commitment_id = attributes[:'commitment_id'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'instance_type') + self.instance_type = attributes[:'instance_type'] + end + + if attributes.key?(:'number_of_nfus') + self.number_of_nfus = attributes[:'number_of_nfus'] + end + + if attributes.key?(:'number_of_reservations') + self.number_of_reservations = attributes[:'number_of_reservations'] + end + + if attributes.key?(:'offering_class') + self.offering_class = attributes[:'offering_class'] + end + + if attributes.key?(:'operating_system') + self.operating_system = attributes[:'operating_system'] + end + + if attributes.key?(:'purchase_option') + self.purchase_option = attributes[:'purchase_option'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'term_length') + self.term_length = attributes[:'term_length'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @commitment_id.nil? + return false if @instance_type.nil? + return false if @offering_class.nil? + return false if @operating_system.nil? + return false if @purchase_option.nil? + return false if @region.nil? + true + end + + # Custom attribute writer method with validation + # @param commitment_id [Object] Object to be assigned + # @!visibility private + def commitment_id=(commitment_id) + if commitment_id.nil? + fail ArgumentError, 'invalid value for "commitment_id", commitment_id cannot be nil.' + end + @commitment_id = commitment_id + end + + # Custom attribute writer method with validation + # @param instance_type [Object] Object to be assigned + # @!visibility private + def instance_type=(instance_type) + if instance_type.nil? + fail ArgumentError, 'invalid value for "instance_type", instance_type cannot be nil.' + end + @instance_type = instance_type + end + + # Custom attribute writer method with validation + # @param offering_class [Object] Object to be assigned + # @!visibility private + def offering_class=(offering_class) + if offering_class.nil? + fail ArgumentError, 'invalid value for "offering_class", offering_class cannot be nil.' + end + @offering_class = offering_class + end + + # Custom attribute writer method with validation + # @param operating_system [Object] Object to be assigned + # @!visibility private + def operating_system=(operating_system) + if operating_system.nil? + fail ArgumentError, 'invalid value for "operating_system", operating_system cannot be nil.' + end + @operating_system = operating_system + end + + # Custom attribute writer method with validation + # @param purchase_option [Object] Object to be assigned + # @!visibility private + def purchase_option=(purchase_option) + if purchase_option.nil? + fail ArgumentError, 'invalid value for "purchase_option", purchase_option cannot be nil.' + end + @purchase_option = purchase_option + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + availability_zone == o.availability_zone && + commitment_id == o.commitment_id && + expiration_date == o.expiration_date && + instance_type == o.instance_type && + number_of_nfus == o.number_of_nfus && + number_of_reservations == o.number_of_reservations && + offering_class == o.offering_class && + operating_system == o.operating_system && + purchase_option == o.purchase_option && + region == o.region && + start_date == o.start_date && + term_length == o.term_length && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [availability_zone, commitment_id, expiration_date, instance_type, number_of_nfus, number_of_reservations, offering_class, operating_system, purchase_option, region, start_date, term_length, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_aws_elasticache_ri_commitment.rb b/lib/datadog_api_client/v2/models/commitments_aws_elasticache_ri_commitment.rb new file mode 100644 index 000000000000..61806d5a2061 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_aws_elasticache_ri_commitment.rb @@ -0,0 +1,267 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS ElastiCache Reserved Instance commitment details. + class CommitmentsAwsElasticacheRICommitment + include BaseGenericModel + + # The cache engine type of the Reserved Instance. + attr_reader :cache_engine + + # The unique identifier of the Reserved Instance. + attr_reader :commitment_id + + # The expiration date of the commitment. + attr_accessor :expiration_date + + # The ElastiCache instance type. + attr_reader :instance_type + + # The number of Normalized Capacity Units. + attr_accessor :number_of_nfus + + # The number of reserved instances. + attr_accessor :number_of_reservations + + # The payment option for the Reserved Instance. + attr_reader :purchase_option + + # The AWS region of the Reserved Instance. + attr_reader :region + + # The start date of the commitment. + attr_accessor :start_date + + # The term length in years. + attr_accessor :term_length + + # The utilization percentage of the commitment. + attr_accessor :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cache_engine' => :'cache_engine', + :'commitment_id' => :'commitment_id', + :'expiration_date' => :'expiration_date', + :'instance_type' => :'instance_type', + :'number_of_nfus' => :'number_of_nfus', + :'number_of_reservations' => :'number_of_reservations', + :'purchase_option' => :'purchase_option', + :'region' => :'region', + :'start_date' => :'start_date', + :'term_length' => :'term_length', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cache_engine' => :'String', + :'commitment_id' => :'String', + :'expiration_date' => :'String', + :'instance_type' => :'String', + :'number_of_nfus' => :'Float', + :'number_of_reservations' => :'Float', + :'purchase_option' => :'String', + :'region' => :'String', + :'start_date' => :'String', + :'term_length' => :'Float', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsAwsElasticacheRICommitment` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cache_engine') + self.cache_engine = attributes[:'cache_engine'] + end + + if attributes.key?(:'commitment_id') + self.commitment_id = attributes[:'commitment_id'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'instance_type') + self.instance_type = attributes[:'instance_type'] + end + + if attributes.key?(:'number_of_nfus') + self.number_of_nfus = attributes[:'number_of_nfus'] + end + + if attributes.key?(:'number_of_reservations') + self.number_of_reservations = attributes[:'number_of_reservations'] + end + + if attributes.key?(:'purchase_option') + self.purchase_option = attributes[:'purchase_option'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'term_length') + self.term_length = attributes[:'term_length'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @cache_engine.nil? + return false if @commitment_id.nil? + return false if @instance_type.nil? + return false if @purchase_option.nil? + return false if @region.nil? + true + end + + # Custom attribute writer method with validation + # @param cache_engine [Object] Object to be assigned + # @!visibility private + def cache_engine=(cache_engine) + if cache_engine.nil? + fail ArgumentError, 'invalid value for "cache_engine", cache_engine cannot be nil.' + end + @cache_engine = cache_engine + end + + # Custom attribute writer method with validation + # @param commitment_id [Object] Object to be assigned + # @!visibility private + def commitment_id=(commitment_id) + if commitment_id.nil? + fail ArgumentError, 'invalid value for "commitment_id", commitment_id cannot be nil.' + end + @commitment_id = commitment_id + end + + # Custom attribute writer method with validation + # @param instance_type [Object] Object to be assigned + # @!visibility private + def instance_type=(instance_type) + if instance_type.nil? + fail ArgumentError, 'invalid value for "instance_type", instance_type cannot be nil.' + end + @instance_type = instance_type + end + + # Custom attribute writer method with validation + # @param purchase_option [Object] Object to be assigned + # @!visibility private + def purchase_option=(purchase_option) + if purchase_option.nil? + fail ArgumentError, 'invalid value for "purchase_option", purchase_option cannot be nil.' + end + @purchase_option = purchase_option + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cache_engine == o.cache_engine && + commitment_id == o.commitment_id && + expiration_date == o.expiration_date && + instance_type == o.instance_type && + number_of_nfus == o.number_of_nfus && + number_of_reservations == o.number_of_reservations && + purchase_option == o.purchase_option && + region == o.region && + start_date == o.start_date && + term_length == o.term_length && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cache_engine, commitment_id, expiration_date, instance_type, number_of_nfus, number_of_reservations, purchase_option, region, start_date, term_length, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_aws_rdsri_commitment.rb b/lib/datadog_api_client/v2/models/commitments_aws_rdsri_commitment.rb new file mode 100644 index 000000000000..fe9f88447e77 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_aws_rdsri_commitment.rb @@ -0,0 +1,277 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS RDS Reserved Instance commitment details. + class CommitmentsAwsRDSRICommitment + include BaseGenericModel + + # The unique identifier of the Reserved Instance. + attr_reader :commitment_id + + # The database engine of the Reserved Instance. + attr_reader :database_engine + + # The expiration date of the commitment. + attr_accessor :expiration_date + + # The RDS instance type. + attr_reader :instance_type + + # Whether the Reserved Instance is Multi-AZ. + attr_accessor :is_multi_az + + # The number of Normalized Capacity Units. + attr_accessor :number_of_nfus + + # The number of reserved instances. + attr_accessor :number_of_reservations + + # The payment option for the Reserved Instance. + attr_reader :purchase_option + + # The AWS region of the Reserved Instance. + attr_reader :region + + # The start date of the commitment. + attr_accessor :start_date + + # The term length in years. + attr_accessor :term_length + + # The utilization percentage of the commitment. + attr_accessor :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commitment_id' => :'commitment_id', + :'database_engine' => :'database_engine', + :'expiration_date' => :'expiration_date', + :'instance_type' => :'instance_type', + :'is_multi_az' => :'is_multi_az', + :'number_of_nfus' => :'number_of_nfus', + :'number_of_reservations' => :'number_of_reservations', + :'purchase_option' => :'purchase_option', + :'region' => :'region', + :'start_date' => :'start_date', + :'term_length' => :'term_length', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commitment_id' => :'String', + :'database_engine' => :'String', + :'expiration_date' => :'String', + :'instance_type' => :'String', + :'is_multi_az' => :'Boolean', + :'number_of_nfus' => :'Float', + :'number_of_reservations' => :'Float', + :'purchase_option' => :'String', + :'region' => :'String', + :'start_date' => :'String', + :'term_length' => :'Float', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsAwsRDSRICommitment` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'commitment_id') + self.commitment_id = attributes[:'commitment_id'] + end + + if attributes.key?(:'database_engine') + self.database_engine = attributes[:'database_engine'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'instance_type') + self.instance_type = attributes[:'instance_type'] + end + + if attributes.key?(:'is_multi_az') + self.is_multi_az = attributes[:'is_multi_az'] + end + + if attributes.key?(:'number_of_nfus') + self.number_of_nfus = attributes[:'number_of_nfus'] + end + + if attributes.key?(:'number_of_reservations') + self.number_of_reservations = attributes[:'number_of_reservations'] + end + + if attributes.key?(:'purchase_option') + self.purchase_option = attributes[:'purchase_option'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'term_length') + self.term_length = attributes[:'term_length'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @commitment_id.nil? + return false if @database_engine.nil? + return false if @instance_type.nil? + return false if @purchase_option.nil? + return false if @region.nil? + true + end + + # Custom attribute writer method with validation + # @param commitment_id [Object] Object to be assigned + # @!visibility private + def commitment_id=(commitment_id) + if commitment_id.nil? + fail ArgumentError, 'invalid value for "commitment_id", commitment_id cannot be nil.' + end + @commitment_id = commitment_id + end + + # Custom attribute writer method with validation + # @param database_engine [Object] Object to be assigned + # @!visibility private + def database_engine=(database_engine) + if database_engine.nil? + fail ArgumentError, 'invalid value for "database_engine", database_engine cannot be nil.' + end + @database_engine = database_engine + end + + # Custom attribute writer method with validation + # @param instance_type [Object] Object to be assigned + # @!visibility private + def instance_type=(instance_type) + if instance_type.nil? + fail ArgumentError, 'invalid value for "instance_type", instance_type cannot be nil.' + end + @instance_type = instance_type + end + + # Custom attribute writer method with validation + # @param purchase_option [Object] Object to be assigned + # @!visibility private + def purchase_option=(purchase_option) + if purchase_option.nil? + fail ArgumentError, 'invalid value for "purchase_option", purchase_option cannot be nil.' + end + @purchase_option = purchase_option + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + commitment_id == o.commitment_id && + database_engine == o.database_engine && + expiration_date == o.expiration_date && + instance_type == o.instance_type && + is_multi_az == o.is_multi_az && + number_of_nfus == o.number_of_nfus && + number_of_reservations == o.number_of_reservations && + purchase_option == o.purchase_option && + region == o.region && + start_date == o.start_date && + term_length == o.term_length && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commitment_id, database_engine, expiration_date, instance_type, is_multi_az, number_of_nfus, number_of_reservations, purchase_option, region, start_date, term_length, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_aws_sp_commitment.rb b/lib/datadog_api_client/v2/models/commitments_aws_sp_commitment.rb new file mode 100644 index 000000000000..d44186087151 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_aws_sp_commitment.rb @@ -0,0 +1,215 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AWS Savings Plan commitment details. + class CommitmentsAwsSPCommitment + include BaseGenericModel + + # The unique identifier of the Savings Plan. + attr_reader :commitment_id + + # The hourly committed spend for the Savings Plan. + attr_accessor :committed_spend_per_hour + + # The expiration date of the commitment. + attr_accessor :expiration_date + + # The payment option for the Savings Plan. + attr_reader :purchase_option + + # The Savings Plan type. + attr_reader :savings_plan_type + + # The start date of the commitment. + attr_accessor :start_date + + # The term length in years. + attr_accessor :term_length + + # The utilization percentage of the commitment. + attr_accessor :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commitment_id' => :'commitment_id', + :'committed_spend_per_hour' => :'committed_spend_per_hour', + :'expiration_date' => :'expiration_date', + :'purchase_option' => :'purchase_option', + :'savings_plan_type' => :'savings_plan_type', + :'start_date' => :'start_date', + :'term_length' => :'term_length', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commitment_id' => :'String', + :'committed_spend_per_hour' => :'Float', + :'expiration_date' => :'String', + :'purchase_option' => :'String', + :'savings_plan_type' => :'String', + :'start_date' => :'String', + :'term_length' => :'Float', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsAwsSPCommitment` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'commitment_id') + self.commitment_id = attributes[:'commitment_id'] + end + + if attributes.key?(:'committed_spend_per_hour') + self.committed_spend_per_hour = attributes[:'committed_spend_per_hour'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'purchase_option') + self.purchase_option = attributes[:'purchase_option'] + end + + if attributes.key?(:'savings_plan_type') + self.savings_plan_type = attributes[:'savings_plan_type'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'term_length') + self.term_length = attributes[:'term_length'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @commitment_id.nil? + return false if @purchase_option.nil? + return false if @savings_plan_type.nil? + true + end + + # Custom attribute writer method with validation + # @param commitment_id [Object] Object to be assigned + # @!visibility private + def commitment_id=(commitment_id) + if commitment_id.nil? + fail ArgumentError, 'invalid value for "commitment_id", commitment_id cannot be nil.' + end + @commitment_id = commitment_id + end + + # Custom attribute writer method with validation + # @param purchase_option [Object] Object to be assigned + # @!visibility private + def purchase_option=(purchase_option) + if purchase_option.nil? + fail ArgumentError, 'invalid value for "purchase_option", purchase_option cannot be nil.' + end + @purchase_option = purchase_option + end + + # Custom attribute writer method with validation + # @param savings_plan_type [Object] Object to be assigned + # @!visibility private + def savings_plan_type=(savings_plan_type) + if savings_plan_type.nil? + fail ArgumentError, 'invalid value for "savings_plan_type", savings_plan_type cannot be nil.' + end + @savings_plan_type = savings_plan_type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + commitment_id == o.commitment_id && + committed_spend_per_hour == o.committed_spend_per_hour && + expiration_date == o.expiration_date && + purchase_option == o.purchase_option && + savings_plan_type == o.savings_plan_type && + start_date == o.start_date && + term_length == o.term_length && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commitment_id, committed_spend_per_hour, expiration_date, purchase_option, savings_plan_type, start_date, term_length, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_azure_compute_sp_commitment.rb b/lib/datadog_api_client/v2/models/commitments_azure_compute_sp_commitment.rb new file mode 100644 index 000000000000..c93602974794 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_azure_compute_sp_commitment.rb @@ -0,0 +1,194 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Azure Compute Savings Plan commitment details. + class CommitmentsAzureComputeSPCommitment + include BaseGenericModel + + # The display name of the Azure Savings Plan. + attr_reader :benefit_name + + # The unique identifier of the Savings Plan. + attr_reader :commitment_id + + # The hourly committed spend for the Savings Plan. + attr_accessor :committed_spend_per_hour + + # The expiration date of the commitment. + attr_accessor :expiration_date + + # The start date of the commitment. + attr_accessor :start_date + + # The term length in years. + attr_accessor :term_length + + # The utilization percentage of the commitment. + attr_accessor :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'benefit_name' => :'benefit_name', + :'commitment_id' => :'commitment_id', + :'committed_spend_per_hour' => :'committed_spend_per_hour', + :'expiration_date' => :'expiration_date', + :'start_date' => :'start_date', + :'term_length' => :'term_length', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'benefit_name' => :'String', + :'commitment_id' => :'String', + :'committed_spend_per_hour' => :'Float', + :'expiration_date' => :'String', + :'start_date' => :'String', + :'term_length' => :'Float', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsAzureComputeSPCommitment` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'benefit_name') + self.benefit_name = attributes[:'benefit_name'] + end + + if attributes.key?(:'commitment_id') + self.commitment_id = attributes[:'commitment_id'] + end + + if attributes.key?(:'committed_spend_per_hour') + self.committed_spend_per_hour = attributes[:'committed_spend_per_hour'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'term_length') + self.term_length = attributes[:'term_length'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @benefit_name.nil? + return false if @commitment_id.nil? + true + end + + # Custom attribute writer method with validation + # @param benefit_name [Object] Object to be assigned + # @!visibility private + def benefit_name=(benefit_name) + if benefit_name.nil? + fail ArgumentError, 'invalid value for "benefit_name", benefit_name cannot be nil.' + end + @benefit_name = benefit_name + end + + # Custom attribute writer method with validation + # @param commitment_id [Object] Object to be assigned + # @!visibility private + def commitment_id=(commitment_id) + if commitment_id.nil? + fail ArgumentError, 'invalid value for "commitment_id", commitment_id cannot be nil.' + end + @commitment_id = commitment_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + benefit_name == o.benefit_name && + commitment_id == o.commitment_id && + committed_spend_per_hour == o.committed_spend_per_hour && + expiration_date == o.expiration_date && + start_date == o.start_date && + term_length == o.term_length && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [benefit_name, commitment_id, committed_spend_per_hour, expiration_date, start_date, term_length, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_azure_vmri_commitment.rb b/lib/datadog_api_client/v2/models/commitments_azure_vmri_commitment.rb new file mode 100644 index 000000000000..522a4cffab17 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_azure_vmri_commitment.rb @@ -0,0 +1,268 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Azure Virtual Machine Reserved Instance commitment details. + class CommitmentsAzureVMRICommitment + include BaseGenericModel + + # The display name of the Azure reservation. + attr_reader :benefit_name + + # The unique identifier of the Reserved Instance. + attr_reader :commitment_id + + # The expiration date of the commitment. + attr_accessor :expiration_date + + # The Azure VM instance type. + attr_reader :instance_type + + # The Azure meter sub-category for the reservation. + attr_reader :meter_sub_category + + # The Azure region of the Reserved Instance. + attr_reader :region + + # The start date of the commitment. + attr_accessor :start_date + + # Status of an Azure VM Reserved Instance. + attr_reader :status + + # The term length in years. + attr_accessor :term_length + + # The utilization percentage of the commitment. + attr_accessor :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'benefit_name' => :'benefit_name', + :'commitment_id' => :'commitment_id', + :'expiration_date' => :'expiration_date', + :'instance_type' => :'instance_type', + :'meter_sub_category' => :'meter_sub_category', + :'region' => :'region', + :'start_date' => :'start_date', + :'status' => :'status', + :'term_length' => :'term_length', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'benefit_name' => :'String', + :'commitment_id' => :'String', + :'expiration_date' => :'String', + :'instance_type' => :'String', + :'meter_sub_category' => :'String', + :'region' => :'String', + :'start_date' => :'String', + :'status' => :'CommitmentsAzureVMRIStatus', + :'term_length' => :'Float', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsAzureVMRICommitment` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'benefit_name') + self.benefit_name = attributes[:'benefit_name'] + end + + if attributes.key?(:'commitment_id') + self.commitment_id = attributes[:'commitment_id'] + end + + if attributes.key?(:'expiration_date') + self.expiration_date = attributes[:'expiration_date'] + end + + if attributes.key?(:'instance_type') + self.instance_type = attributes[:'instance_type'] + end + + if attributes.key?(:'meter_sub_category') + self.meter_sub_category = attributes[:'meter_sub_category'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'term_length') + self.term_length = attributes[:'term_length'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @benefit_name.nil? + return false if @commitment_id.nil? + return false if @instance_type.nil? + return false if @meter_sub_category.nil? + return false if @region.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param benefit_name [Object] Object to be assigned + # @!visibility private + def benefit_name=(benefit_name) + if benefit_name.nil? + fail ArgumentError, 'invalid value for "benefit_name", benefit_name cannot be nil.' + end + @benefit_name = benefit_name + end + + # Custom attribute writer method with validation + # @param commitment_id [Object] Object to be assigned + # @!visibility private + def commitment_id=(commitment_id) + if commitment_id.nil? + fail ArgumentError, 'invalid value for "commitment_id", commitment_id cannot be nil.' + end + @commitment_id = commitment_id + end + + # Custom attribute writer method with validation + # @param instance_type [Object] Object to be assigned + # @!visibility private + def instance_type=(instance_type) + if instance_type.nil? + fail ArgumentError, 'invalid value for "instance_type", instance_type cannot be nil.' + end + @instance_type = instance_type + end + + # Custom attribute writer method with validation + # @param meter_sub_category [Object] Object to be assigned + # @!visibility private + def meter_sub_category=(meter_sub_category) + if meter_sub_category.nil? + fail ArgumentError, 'invalid value for "meter_sub_category", meter_sub_category cannot be nil.' + end + @meter_sub_category = meter_sub_category + end + + # Custom attribute writer method with validation + # @param region [Object] Object to be assigned + # @!visibility private + def region=(region) + if region.nil? + fail ArgumentError, 'invalid value for "region", region cannot be nil.' + end + @region = region + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + benefit_name == o.benefit_name && + commitment_id == o.commitment_id && + expiration_date == o.expiration_date && + instance_type == o.instance_type && + meter_sub_category == o.meter_sub_category && + region == o.region && + start_date == o.start_date && + status == o.status && + term_length == o.term_length && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [benefit_name, commitment_id, expiration_date, instance_type, meter_sub_category, region, start_date, status, term_length, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_azure_vmri_status.rb b/lib/datadog_api_client/v2/models/commitments_azure_vmri_status.rb new file mode 100644 index 000000000000..650794f60f86 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_azure_vmri_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Status of an Azure VM Reserved Instance. + class CommitmentsAzureVMRIStatus + include BaseEnumModel + + RUNNING = "running".freeze + EXPIRED = "expired".freeze + CANCELLED = "cancelled".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_commitment_type.rb b/lib/datadog_api_client/v2/models/commitments_commitment_type.rb new file mode 100644 index 000000000000..da84a2a8158c --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_commitment_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of commitment. ri for Reserved Instances, sp for Savings Plans. + class CommitmentsCommitmentType + include BaseEnumModel + + RESERVED_INSTANCES = "ri".freeze + SAVINGS_PLANS = "sp".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_coverage_scalar_response.rb b/lib/datadog_api_client/v2/models/commitments_coverage_scalar_response.rb new file mode 100644 index 000000000000..847a4f7e8392 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_coverage_scalar_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing scalar coverage metrics for cloud commitment programs. + class CommitmentsCoverageScalarResponse + include BaseGenericModel + + # Array of scalar columns in the response. + attr_reader :columns + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsCoverageScalarResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @columns.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_coverage_timeseries_response.rb b/lib/datadog_api_client/v2/models/commitments_coverage_timeseries_response.rb new file mode 100644 index 000000000000..41b771f068b2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_coverage_timeseries_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing timeseries coverage metrics for cloud commitment programs. + class CommitmentsCoverageTimeseriesResponse + include BaseGenericModel + + # A timeseries metric containing timestamps, series values, and optional unit metadata. + attr_reader :cost + + # A timeseries metric containing timestamps, series values, and optional unit metadata. + attr_reader :hours + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cost' => :'cost', + :'hours' => :'hours' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cost' => :'CommitmentsTimeseriesMetric', + :'hours' => :'CommitmentsTimeseriesMetric' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsCoverageTimeseriesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'cost') + self.cost = attributes[:'cost'] + end + + if attributes.key?(:'hours') + self.hours = attributes[:'hours'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @cost.nil? + return false if @hours.nil? + true + end + + # Custom attribute writer method with validation + # @param cost [Object] Object to be assigned + # @!visibility private + def cost=(cost) + if cost.nil? + fail ArgumentError, 'invalid value for "cost", cost cannot be nil.' + end + @cost = cost + end + + # Custom attribute writer method with validation + # @param hours [Object] Object to be assigned + # @!visibility private + def hours=(hours) + if hours.nil? + fail ArgumentError, 'invalid value for "hours", hours cannot be nil.' + end + @hours = hours + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cost == o.cost && + hours == o.hours && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cost, hours, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_list_item.rb b/lib/datadog_api_client/v2/models/commitments_list_item.rb new file mode 100644 index 000000000000..78c87e594493 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_list_item.rb @@ -0,0 +1,67 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A commitment item, which varies based on the provider, product, and commitment type. + module CommitmentsListItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CommitmentsAwsEC2RICommitment', + :'CommitmentsAwsRDSRICommitment', + :'CommitmentsAwsElasticacheRICommitment', + :'CommitmentsAwsSPCommitment', + :'CommitmentsAzureVMRICommitment', + :'CommitmentsAzureComputeSPCommitment' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_list_meta.rb b/lib/datadog_api_client/v2/models/commitments_list_meta.rb new file mode 100644 index 000000000000..96b5dc583515 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_list_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for a commitments list response. + class CommitmentsListMeta + include BaseGenericModel + + # Unit metadata for a numeric metric. + attr_accessor :committed_spend_unit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'committed_spend_unit' => :'committed_spend_unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'committed_spend_unit' => :'CommitmentsUnit' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsListMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'committed_spend_unit') + self.committed_spend_unit = attributes[:'committed_spend_unit'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + committed_spend_unit == o.committed_spend_unit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [committed_spend_unit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_list_response.rb b/lib/datadog_api_client/v2/models/commitments_list_response.rb new file mode 100644 index 000000000000..709647768609 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_list_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of cloud commitment details. + class CommitmentsListResponse + include BaseGenericModel + + # Array of commitment items. + attr_reader :commitments + + # Metadata for a commitments list response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'commitments' => :'commitments', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'commitments' => :'Array', + :'meta' => :'CommitmentsListMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'commitments') + if (value = attributes[:'commitments']).is_a?(Array) + self.commitments = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @commitments.nil? + true + end + + # Custom attribute writer method with validation + # @param commitments [Object] Object to be assigned + # @!visibility private + def commitments=(commitments) + if commitments.nil? + fail ArgumentError, 'invalid value for "commitments", commitments cannot be nil.' + end + @commitments = commitments + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + commitments == o.commitments && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [commitments, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_on_demand_hotspots_scalar_meta.rb b/lib/datadog_api_client/v2/models/commitments_on_demand_hotspots_scalar_meta.rb new file mode 100644 index 000000000000..02054b3c0c21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_on_demand_hotspots_scalar_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for the on-demand hot-spots scalar response. + class CommitmentsOnDemandHotspotsScalarMeta + include BaseGenericModel + + # Active on-demand filters applied to the response. + attr_reader :on_demand_filters + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'on_demand_filters' => :'on_demand_filters' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'on_demand_filters' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsOnDemandHotspotsScalarMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'on_demand_filters') + self.on_demand_filters = attributes[:'on_demand_filters'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @on_demand_filters.nil? + true + end + + # Custom attribute writer method with validation + # @param on_demand_filters [Object] Object to be assigned + # @!visibility private + def on_demand_filters=(on_demand_filters) + if on_demand_filters.nil? + fail ArgumentError, 'invalid value for "on_demand_filters", on_demand_filters cannot be nil.' + end + @on_demand_filters = on_demand_filters + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + on_demand_filters == o.on_demand_filters && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [on_demand_filters, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_on_demand_hotspots_scalar_response.rb b/lib/datadog_api_client/v2/models/commitments_on_demand_hotspots_scalar_response.rb new file mode 100644 index 000000000000..06426e1cc6cf --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_on_demand_hotspots_scalar_response.rb @@ -0,0 +1,158 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing scalar on-demand hot-spots data for cloud commitment programs. + class CommitmentsOnDemandHotspotsScalarResponse + include BaseGenericModel + + # Array of scalar columns in the response. + attr_reader :columns + + # Metadata for the on-demand hot-spots scalar response. + attr_accessor :meta + + # Array of scalar columns in the response. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'meta' => :'meta', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'meta' => :'CommitmentsOnDemandHotspotsScalarMeta', + :'total' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsOnDemandHotspotsScalarResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'total') + if (value = attributes[:'total']).is_a?(Array) + self.total = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @columns.nil? + return false if @total.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + meta == o.meta && + total == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, meta, total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_provider.rb b/lib/datadog_api_client/v2/models/commitments_provider.rb new file mode 100644 index 000000000000..d1ce97be8212 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_provider.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Cloud provider for commitment programs. + class CommitmentsProvider + include BaseEnumModel + + AWS = "aws".freeze + AZURE = "azure".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_savings_scalar_response.rb b/lib/datadog_api_client/v2/models/commitments_savings_scalar_response.rb new file mode 100644 index 000000000000..77f8e52029d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_savings_scalar_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing scalar savings metrics for cloud commitment programs. + class CommitmentsSavingsScalarResponse + include BaseGenericModel + + # Array of scalar columns in the response. + attr_reader :columns + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsSavingsScalarResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @columns.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_savings_timeseries_response.rb b/lib/datadog_api_client/v2/models/commitments_savings_timeseries_response.rb new file mode 100644 index 000000000000..90f166cb3e38 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_savings_timeseries_response.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing timeseries savings metrics for cloud commitment programs. + class CommitmentsSavingsTimeseriesResponse + include BaseGenericModel + + # A timeseries metric containing timestamps, series values, and optional unit metadata. + attr_reader :actual_cost + + # A timeseries metric containing timestamps, series values, and optional unit metadata. + attr_reader :effective_savings_rate + + # A timeseries metric containing timestamps, series values, and optional unit metadata. + attr_reader :on_demand_equivalent_cost + + # A timeseries metric containing timestamps, series values, and optional unit metadata. + attr_reader :realized_savings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'actual_cost' => :'actual_cost', + :'effective_savings_rate' => :'effective_savings_rate', + :'on_demand_equivalent_cost' => :'on_demand_equivalent_cost', + :'realized_savings' => :'realized_savings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'actual_cost' => :'CommitmentsTimeseriesMetric', + :'effective_savings_rate' => :'CommitmentsTimeseriesMetric', + :'on_demand_equivalent_cost' => :'CommitmentsTimeseriesMetric', + :'realized_savings' => :'CommitmentsTimeseriesMetric' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsSavingsTimeseriesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'actual_cost') + self.actual_cost = attributes[:'actual_cost'] + end + + if attributes.key?(:'effective_savings_rate') + self.effective_savings_rate = attributes[:'effective_savings_rate'] + end + + if attributes.key?(:'on_demand_equivalent_cost') + self.on_demand_equivalent_cost = attributes[:'on_demand_equivalent_cost'] + end + + if attributes.key?(:'realized_savings') + self.realized_savings = attributes[:'realized_savings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @actual_cost.nil? + return false if @effective_savings_rate.nil? + return false if @on_demand_equivalent_cost.nil? + return false if @realized_savings.nil? + true + end + + # Custom attribute writer method with validation + # @param actual_cost [Object] Object to be assigned + # @!visibility private + def actual_cost=(actual_cost) + if actual_cost.nil? + fail ArgumentError, 'invalid value for "actual_cost", actual_cost cannot be nil.' + end + @actual_cost = actual_cost + end + + # Custom attribute writer method with validation + # @param effective_savings_rate [Object] Object to be assigned + # @!visibility private + def effective_savings_rate=(effective_savings_rate) + if effective_savings_rate.nil? + fail ArgumentError, 'invalid value for "effective_savings_rate", effective_savings_rate cannot be nil.' + end + @effective_savings_rate = effective_savings_rate + end + + # Custom attribute writer method with validation + # @param on_demand_equivalent_cost [Object] Object to be assigned + # @!visibility private + def on_demand_equivalent_cost=(on_demand_equivalent_cost) + if on_demand_equivalent_cost.nil? + fail ArgumentError, 'invalid value for "on_demand_equivalent_cost", on_demand_equivalent_cost cannot be nil.' + end + @on_demand_equivalent_cost = on_demand_equivalent_cost + end + + # Custom attribute writer method with validation + # @param realized_savings [Object] Object to be assigned + # @!visibility private + def realized_savings=(realized_savings) + if realized_savings.nil? + fail ArgumentError, 'invalid value for "realized_savings", realized_savings cannot be nil.' + end + @realized_savings = realized_savings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + actual_cost == o.actual_cost && + effective_savings_rate == o.effective_savings_rate && + on_demand_equivalent_cost == o.on_demand_equivalent_cost && + realized_savings == o.realized_savings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [actual_cost, effective_savings_rate, on_demand_equivalent_cost, realized_savings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_scalar_column.rb b/lib/datadog_api_client/v2/models/commitments_scalar_column.rb new file mode 100644 index 000000000000..730b21d364a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_scalar_column.rb @@ -0,0 +1,177 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. + class CommitmentsScalarColumn + include BaseGenericModel + + # Metadata for a scalar column, including unit information. + attr_accessor :meta + + # The column name. + attr_reader :name + + # The column type. "group" for dimension columns, "number" for metric columns. + attr_reader :type + + # Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + attr_reader :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'meta' => :'meta', + :'name' => :'name', + :'type' => :'type', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'meta' => :'CommitmentsScalarColumnMeta', + :'name' => :'String', + :'type' => :'CommitmentsScalarColumnType', + :'values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsScalarColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @type.nil? + return false if @values.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + meta == o.meta && + name == o.name && + type == o.type && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [meta, name, type, values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_scalar_column_meta.rb b/lib/datadog_api_client/v2/models/commitments_scalar_column_meta.rb new file mode 100644 index 000000000000..179d944ada37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_scalar_column_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for a scalar column, including unit information. + class CommitmentsScalarColumnMeta + include BaseGenericModel + + # Unit metadata for a numeric metric. + attr_reader :unit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'unit' => :'CommitmentsUnit' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsScalarColumnMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'unit') + self.unit = attributes[:'unit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @unit.nil? + true + end + + # Custom attribute writer method with validation + # @param unit [Object] Object to be assigned + # @!visibility private + def unit=(unit) + if unit.nil? + fail ArgumentError, 'invalid value for "unit", unit cannot be nil.' + end + @unit = unit + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unit == o.unit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [unit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_scalar_column_type.rb b/lib/datadog_api_client/v2/models/commitments_scalar_column_type.rb new file mode 100644 index 000000000000..244c5ba679d6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_scalar_column_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The column type. "group" for dimension columns, "number" for metric columns. + class CommitmentsScalarColumnType + include BaseEnumModel + + GROUP = "group".freeze + NUMBER = "number".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_timeseries_metric.rb b/lib/datadog_api_client/v2/models/commitments_timeseries_metric.rb new file mode 100644 index 000000000000..3eb5307bc980 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_timeseries_metric.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A timeseries metric containing timestamps, series values, and optional unit metadata. + class CommitmentsTimeseriesMetric + include BaseGenericModel + + # Timeseries data as a map of series names to their corresponding value arrays. + attr_reader :series + + # Unix timestamps in seconds for the timeseries data points. + attr_reader :times + + # Unit metadata for a numeric metric. + attr_accessor :unit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'series' => :'series', + :'times' => :'times', + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'series' => :'Hash>', + :'times' => :'Array', + :'unit' => :'CommitmentsUnit' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsTimeseriesMetric` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'series') + self.series = attributes[:'series'] + end + + if attributes.key?(:'times') + if (value = attributes[:'times']).is_a?(Array) + self.times = value + end + end + + if attributes.key?(:'unit') + self.unit = attributes[:'unit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @series.nil? + return false if @times.nil? + true + end + + # Custom attribute writer method with validation + # @param series [Object] Object to be assigned + # @!visibility private + def series=(series) + if series.nil? + fail ArgumentError, 'invalid value for "series", series cannot be nil.' + end + @series = series + end + + # Custom attribute writer method with validation + # @param times [Object] Object to be assigned + # @!visibility private + def times=(times) + if times.nil? + fail ArgumentError, 'invalid value for "times", times cannot be nil.' + end + @times = times + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + series == o.series && + times == o.times && + unit == o.unit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [series, times, unit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_unit.rb b/lib/datadog_api_client/v2/models/commitments_unit.rb new file mode 100644 index 000000000000..c1c3617b560d --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_unit.rb @@ -0,0 +1,228 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Unit metadata for a numeric metric. + class CommitmentsUnit + include BaseGenericModel + + # The unit family (for example, percentage or money). + attr_reader :family + + # The unit identifier. + attr_reader :id + + # The unit name (for example, percent or dollar). + attr_reader :name + + # The plural form of the unit name. + attr_reader :plural + + # The scale factor for the unit. + attr_reader :scale_factor + + # The abbreviated unit name (for example, % or $). + attr_reader :short_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'family' => :'family', + :'id' => :'id', + :'name' => :'name', + :'plural' => :'plural', + :'scale_factor' => :'scale_factor', + :'short_name' => :'short_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'family' => :'String', + :'id' => :'Integer', + :'name' => :'String', + :'plural' => :'String', + :'scale_factor' => :'Float', + :'short_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsUnit` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'family') + self.family = attributes[:'family'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'plural') + self.plural = attributes[:'plural'] + end + + if attributes.key?(:'scale_factor') + self.scale_factor = attributes[:'scale_factor'] + end + + if attributes.key?(:'short_name') + self.short_name = attributes[:'short_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @family.nil? + return false if @id.nil? + return false if @name.nil? + return false if @plural.nil? + return false if @scale_factor.nil? + return false if @short_name.nil? + true + end + + # Custom attribute writer method with validation + # @param family [Object] Object to be assigned + # @!visibility private + def family=(family) + if family.nil? + fail ArgumentError, 'invalid value for "family", family cannot be nil.' + end + @family = family + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param plural [Object] Object to be assigned + # @!visibility private + def plural=(plural) + if plural.nil? + fail ArgumentError, 'invalid value for "plural", plural cannot be nil.' + end + @plural = plural + end + + # Custom attribute writer method with validation + # @param scale_factor [Object] Object to be assigned + # @!visibility private + def scale_factor=(scale_factor) + if scale_factor.nil? + fail ArgumentError, 'invalid value for "scale_factor", scale_factor cannot be nil.' + end + @scale_factor = scale_factor + end + + # Custom attribute writer method with validation + # @param short_name [Object] Object to be assigned + # @!visibility private + def short_name=(short_name) + if short_name.nil? + fail ArgumentError, 'invalid value for "short_name", short_name cannot be nil.' + end + @short_name = short_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + family == o.family && + id == o.id && + name == o.name && + plural == o.plural && + scale_factor == o.scale_factor && + short_name == o.short_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [family, id, name, plural, scale_factor, short_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_utilization_scalar_product_breakdown_entry.rb b/lib/datadog_api_client/v2/models/commitments_utilization_scalar_product_breakdown_entry.rb new file mode 100644 index 000000000000..17eb11e82bf8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_utilization_scalar_product_breakdown_entry.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Per-product utilization data in a scalar utilization response. + class CommitmentsUtilizationScalarProductBreakdownEntry + include BaseGenericModel + + # The cloud product name. + attr_reader :product + + # The utilization percentage for the product. + attr_reader :utilization + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'product' => :'product', + :'utilization' => :'utilization' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'product' => :'String', + :'utilization' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsUtilizationScalarProductBreakdownEntry` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'product') + self.product = attributes[:'product'] + end + + if attributes.key?(:'utilization') + self.utilization = attributes[:'utilization'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @product.nil? + return false if @utilization.nil? + true + end + + # Custom attribute writer method with validation + # @param product [Object] Object to be assigned + # @!visibility private + def product=(product) + if product.nil? + fail ArgumentError, 'invalid value for "product", product cannot be nil.' + end + @product = product + end + + # Custom attribute writer method with validation + # @param utilization [Object] Object to be assigned + # @!visibility private + def utilization=(utilization) + if utilization.nil? + fail ArgumentError, 'invalid value for "utilization", utilization cannot be nil.' + end + @utilization = utilization + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + product == o.product && + utilization == o.utilization && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [product, utilization, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_utilization_scalar_response.rb b/lib/datadog_api_client/v2/models/commitments_utilization_scalar_response.rb new file mode 100644 index 000000000000..60c49bcb5193 --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_utilization_scalar_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing scalar utilization metrics for cloud commitment programs. + class CommitmentsUtilizationScalarResponse + include BaseGenericModel + + # Array of scalar columns in the response. + attr_reader :columns + + # Array of per-product utilization breakdown entries. + attr_accessor :product_breakdown + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'product_breakdown' => :'product_breakdown' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'product_breakdown' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsUtilizationScalarResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'product_breakdown') + if (value = attributes[:'product_breakdown']).is_a?(Array) + self.product_breakdown = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @columns.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + product_breakdown == o.product_breakdown && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, product_breakdown, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/commitments_utilization_timeseries_response.rb b/lib/datadog_api_client/v2/models/commitments_utilization_timeseries_response.rb new file mode 100644 index 000000000000..2601504b869b --- /dev/null +++ b/lib/datadog_api_client/v2/models/commitments_utilization_timeseries_response.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing timeseries utilization metrics for cloud commitment programs. + class CommitmentsUtilizationTimeseriesResponse + include BaseGenericModel + + # Timeseries data as a map of series names to their corresponding value arrays. + attr_reader :series + + # Unix timestamps in seconds for the timeseries data points. + attr_reader :times + + # Unit metadata for a numeric metric. + attr_accessor :unit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'series' => :'series', + :'times' => :'times', + :'unit' => :'unit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'series' => :'Hash>', + :'times' => :'Array', + :'unit' => :'CommitmentsUnit' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CommitmentsUtilizationTimeseriesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'series') + self.series = attributes[:'series'] + end + + if attributes.key?(:'times') + if (value = attributes[:'times']).is_a?(Array) + self.times = value + end + end + + if attributes.key?(:'unit') + self.unit = attributes[:'unit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @series.nil? + return false if @times.nil? + true + end + + # Custom attribute writer method with validation + # @param series [Object] Object to be assigned + # @!visibility private + def series=(series) + if series.nil? + fail ArgumentError, 'invalid value for "series", series cannot be nil.' + end + @series = series + end + + # Custom attribute writer method with validation + # @param times [Object] Object to be assigned + # @!visibility private + def times=(times) + if times.nil? + fail ArgumentError, 'invalid value for "times", times cannot be nil.' + end + @times = times + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + series == o.series && + times == o.times && + unit == o.unit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [series, times, unit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_publish_request_request.rb b/lib/datadog_api_client/v2/models/create_publish_request_request.rb new file mode 100644 index 000000000000..a8eb0571ffa4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_publish_request_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to ask for approval to publish an app whose protection level is `approval_required`. + class CreatePublishRequestRequest + include BaseGenericModel + + # Data for creating a publish request. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreatePublishRequestRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreatePublishRequestRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_publish_request_request_data.rb b/lib/datadog_api_client/v2/models/create_publish_request_request_data.rb new file mode 100644 index 000000000000..098e2c787290 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_publish_request_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating a publish request. + class CreatePublishRequestRequestData + include BaseGenericModel + + # Attributes for creating a publish request. + attr_accessor :attributes + + # The publish-request resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreatePublishRequestRequestDataAttributes', + :'type' => :'PublishRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreatePublishRequestRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_publish_request_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_publish_request_request_data_attributes.rb new file mode 100644 index 000000000000..46e6e006ec21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_publish_request_request_data_attributes.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a publish request. + class CreatePublishRequestRequestDataAttributes + include BaseGenericModel + + # An optional description of the changes in this publish request. + attr_accessor :description + + # A short title for the publish request. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreatePublishRequestRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_app_versions_response.rb b/lib/datadog_api_client/v2/models/list_app_versions_response.rb new file mode 100644 index 000000000000..f45a6faf35a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_app_versions_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A paginated list of versions for an app. + class ListAppVersionsResponse + include BaseGenericModel + + # The list of app versions. + attr_accessor :data + + # Pagination metadata. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'ListAppsResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListAppVersionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/publish_request_type.rb b/lib/datadog_api_client/v2/models/publish_request_type.rb new file mode 100644 index 000000000000..1b0a2e144e1e --- /dev/null +++ b/lib/datadog_api_client/v2/models/publish_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The publish-request resource type. + class PublishRequestType + include BaseEnumModel + + PUBLISHREQUEST = "publishRequest".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_favorite_request.rb b/lib/datadog_api_client/v2/models/update_app_favorite_request.rb new file mode 100644 index 000000000000..c8f0c704bcbd --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_favorite_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to add or remove an app from the current user's favorites. + class UpdateAppFavoriteRequest + include BaseGenericModel + + # Data for updating an app's favorite status. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateAppFavoriteRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppFavoriteRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_favorite_request_data.rb b/lib/datadog_api_client/v2/models/update_app_favorite_request_data.rb new file mode 100644 index 000000000000..a1adf5faedec --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_favorite_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for updating an app's favorite status. + class UpdateAppFavoriteRequestData + include BaseGenericModel + + # Attributes for updating an app's favorite status. + attr_accessor :attributes + + # The favorite resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateAppFavoriteRequestDataAttributes', + :'type' => :'AppFavoriteType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppFavoriteRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_favorite_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_favorite_request_data_attributes.rb new file mode 100644 index 000000000000..ee37d7adbd32 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_favorite_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an app's favorite status. + class UpdateAppFavoriteRequestDataAttributes + include BaseGenericModel + + # Whether the app should be marked as a favorite for the current user. + attr_reader :favorite + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'favorite' => :'favorite' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'favorite' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppFavoriteRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'favorite') + self.favorite = attributes[:'favorite'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @favorite.nil? + true + end + + # Custom attribute writer method with validation + # @param favorite [Object] Object to be assigned + # @!visibility private + def favorite=(favorite) + if favorite.nil? + fail ArgumentError, 'invalid value for "favorite", favorite cannot be nil.' + end + @favorite = favorite + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + favorite == o.favorite && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [favorite, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_protection_level_request.rb b/lib/datadog_api_client/v2/models/update_app_protection_level_request.rb new file mode 100644 index 000000000000..a4ccd3d21132 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_protection_level_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to update an app's publication protection level. + class UpdateAppProtectionLevelRequest + include BaseGenericModel + + # Data for updating an app's publication protection level. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateAppProtectionLevelRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppProtectionLevelRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_protection_level_request_data.rb b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data.rb new file mode 100644 index 000000000000..3e6815ae1e10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for updating an app's publication protection level. + class UpdateAppProtectionLevelRequestData + include BaseGenericModel + + # Attributes for updating an app's publication protection level. + attr_accessor :attributes + + # The protection-level resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateAppProtectionLevelRequestDataAttributes', + :'type' => :'AppProtectionLevelType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppProtectionLevelRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_protection_level_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data_attributes.rb new file mode 100644 index 000000000000..f184036b0999 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_protection_level_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an app's publication protection level. + class UpdateAppProtectionLevelRequestDataAttributes + include BaseGenericModel + + # The publication protection level of the app. `approval_required` means changes must go through an approval workflow before being published. + attr_reader :protection_level + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'protection_level' => :'protectionLevel' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'protection_level' => :'AppProtectionLevel' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppProtectionLevelRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'protection_level') + self.protection_level = attributes[:'protection_level'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @protection_level.nil? + true + end + + # Custom attribute writer method with validation + # @param protection_level [Object] Object to be assigned + # @!visibility private + def protection_level=(protection_level) + if protection_level.nil? + fail ArgumentError, 'invalid value for "protection_level", protection_level cannot be nil.' + end + @protection_level = protection_level + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + protection_level == o.protection_level && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [protection_level, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_self_service_request.rb b/lib/datadog_api_client/v2/models/update_app_self_service_request.rb new file mode 100644 index 000000000000..07bfb8239568 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_self_service_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to enable or disable self-service for an app. + class UpdateAppSelfServiceRequest + include BaseGenericModel + + # Data for updating an app's self-service status. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateAppSelfServiceRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppSelfServiceRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_self_service_request_data.rb b/lib/datadog_api_client/v2/models/update_app_self_service_request_data.rb new file mode 100644 index 000000000000..d3fb07b0cb92 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_self_service_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for updating an app's self-service status. + class UpdateAppSelfServiceRequestData + include BaseGenericModel + + # Attributes for updating an app's self-service status. + attr_accessor :attributes + + # The self-service resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateAppSelfServiceRequestDataAttributes', + :'type' => :'AppSelfServiceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppSelfServiceRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_self_service_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_self_service_request_data_attributes.rb new file mode 100644 index 000000000000..306b33b0cb7d --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_self_service_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an app's self-service status. + class UpdateAppSelfServiceRequestDataAttributes + include BaseGenericModel + + # Whether the app is enabled for self-service. + attr_reader :self_service + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'self_service' => :'selfService' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'self_service' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppSelfServiceRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'self_service') + self.self_service = attributes[:'self_service'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @self_service.nil? + true + end + + # Custom attribute writer method with validation + # @param self_service [Object] Object to be assigned + # @!visibility private + def self_service=(self_service) + if self_service.nil? + fail ArgumentError, 'invalid value for "self_service", self_service cannot be nil.' + end + @self_service = self_service + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + self_service == o.self_service && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [self_service, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_tags_request.rb b/lib/datadog_api_client/v2/models/update_app_tags_request.rb new file mode 100644 index 000000000000..8eff4e23c5a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_tags_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to replace the tags on an app. + class UpdateAppTagsRequest + include BaseGenericModel + + # Data for replacing an app's tags. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateAppTagsRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppTagsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_tags_request_data.rb b/lib/datadog_api_client/v2/models/update_app_tags_request_data.rb new file mode 100644 index 000000000000..c94df12a60fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_tags_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for replacing an app's tags. + class UpdateAppTagsRequestData + include BaseGenericModel + + # Attributes for replacing an app's tags. + attr_accessor :attributes + + # The tags resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateAppTagsRequestDataAttributes', + :'type' => :'AppTagsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppTagsRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_tags_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_tags_request_data_attributes.rb new file mode 100644 index 000000000000..11a7cd1d1005 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_tags_request_data_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for replacing an app's tags. + class UpdateAppTagsRequestDataAttributes + include BaseGenericModel + + # The full list of tags that should be set on the app. Existing tags not present in this list are removed. + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppTagsRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @tags.nil? + true + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_version_name_request.rb b/lib/datadog_api_client/v2/models/update_app_version_name_request.rb new file mode 100644 index 000000000000..a3e19fcbb0e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_version_name_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A request to assign a human-readable name to a specific app version. + class UpdateAppVersionNameRequest + include BaseGenericModel + + # Data for naming a specific app version. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateAppVersionNameRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppVersionNameRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_version_name_request_data.rb b/lib/datadog_api_client/v2/models/update_app_version_name_request_data.rb new file mode 100644 index 000000000000..9ecb2d346d9c --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_version_name_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for naming a specific app version. + class UpdateAppVersionNameRequestData + include BaseGenericModel + + # Attributes for naming a specific app version. + attr_accessor :attributes + + # The version-name resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'UpdateAppVersionNameRequestDataAttributes', + :'type' => :'AppVersionNameType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppVersionNameRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_app_version_name_request_data_attributes.rb b/lib/datadog_api_client/v2/models/update_app_version_name_request_data_attributes.rb new file mode 100644 index 000000000000..1978da593fca --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_app_version_name_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for naming a specific app version. + class UpdateAppVersionNameRequestDataAttributes + include BaseGenericModel + + # The name to assign to the app version. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateAppVersionNameRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, additional_properties].hash + end + end +end