diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 170293cea7..d02d5dd803 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15282,6 +15282,85 @@ components: id: $ref: '#/components/schemas/ApiID' type: object + CreateOrUpdateWidgetRequestAttributes: + properties: + definition: + $ref: '#/components/schemas/Definition' + description: The widget definition including type, title, and configuration. + tags: + description: User-defined tags for organizing the widget. + items: + type: string + nullable: true + title: Tags + type: array + required: + - definition + title: CreateOrUpdateWidgetRequestAttributes + type: object + CreateOrUpdateWidgetRequestJSONAPIRequestDocument: + properties: + data: + $ref: '#/components/schemas/CreateOrUpdateWidgetRequestResourceObjectRequest' + errors: + items: + $ref: '#/components/schemas/WidgetErrorInput' + nullable: true + title: Errors + type: array + included: + items: + $ref: '#/components/schemas/WidgetResourceObjectInput' + nullable: true + title: Included + type: array + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + required: + - data + title: CreateOrUpdateWidgetRequestJSONAPIRequestDocument + type: object + CreateOrUpdateWidgetRequestResourceObjectRequest: + properties: + attributes: + $ref: '#/components/schemas/CreateOrUpdateWidgetRequestAttributes' + id: + nullable: true + title: Id + type: string + lid: + nullable: true + title: Lid + type: string + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + relationships: + additionalProperties: + $ref: '#/components/schemas/WidgetRelationshipObjectInput' + nullable: true + title: Relationships + type: object + type: + example: '' + title: Type + type: string + required: + - type + - attributes + title: CreateOrUpdateWidgetRequestResourceObjectRequest + type: object CreatePageRequest: description: Full request to trigger an On-Call Page. example: @@ -19930,6 +20009,38 @@ components: example: 1722439510282 format: int64 type: integer + Definition: + additionalProperties: {} + description: The definition of a widget, including its type and configuration. + example: + requests: + - queries: + - data_source: metrics + name: query1 + query: avg:system.cpu.user{*} + response_format: timeseries + time: + type: live + unit: day + value: 30 + title: My Timeseries Widget + type: timeseries + properties: + title: + description: The display title of the widget. + example: L + maxLength: 100 + minLength: 1 + title: Title + type: string + type: + $ref: '#/components/schemas/WidgetType' + description: The type of the widget (for example, cloud_cost_summary, query_table). + required: + - type + - title + title: Definition + type: object Degradation: properties: data: @@ -22861,6 +22972,39 @@ components: - retryStrategy - fallbackStepName type: object + ErrorLinks: + properties: + about: + $ref: '#/components/schemas/ErrorLinksAbout' + required: + - about + title: ErrorLinks + type: object + ErrorLinksAbout: + example: '' + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: About + ErrorSource: + description: 'An object containing references to the primary source of the error. + + See: https://jsonapi.org/format/#error-objects' + properties: + header: + nullable: true + title: Header + type: string + parameter: + nullable: true + title: Parameter + type: string + pointer: + nullable: true + title: Pointer + type: string + title: ErrorSource + type: object Escalation: description: Represents an escalation policy step. properties: @@ -33961,6 +34105,10 @@ components: - name - type type: object + JSONAPIAttributes: + properties: {} + title: JSONAPIAttributes + type: object JSONAPIErrorItem: description: API error response body properties: @@ -34938,6 +35086,46 @@ components: required: - name type: object + LinkObject: + description: 'A JSON:API "link object" + + See: https://jsonapi.org/format/#auto-id--link-objects' + properties: + describedby: + nullable: true + title: Describedby + type: string + href: + example: '' + title: Href + type: string + hreflang: + items: + type: string + nullable: true + title: Hreflang + type: array + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + rel: + nullable: true + title: Rel + type: string + title: + nullable: true + title: Title + type: string + type: + nullable: true + title: Type + type: string + required: + - href + title: LinkObject + type: object Links: description: The JSON:API links related to pagination. properties: @@ -34966,6 +35154,55 @@ components: - first - last type: object + LinksDescribedBy: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: Describedby + type: object + LinksFirst: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: First + type: object + LinksLast: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: Last + type: object + LinksNext: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: Next + type: object + LinksPrev: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: Prev + type: object + LinksRelated: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: Related + type: object + LinksSelf: + nullable: true + oneOf: + - type: string + - $ref: '#/components/schemas/LinkObject' + title: Self + type: object ListAPIsResponse: description: Response for `ListAPIs`. properties: @@ -50013,6 +50250,15 @@ components: description: Relationship type. type: string type: object + RelationshipObjectOutputData: + nullable: true + oneOf: + - $ref: '#/components/schemas/ResourceIdentifierObject' + - items: + $ref: '#/components/schemas/ResourceIdentifierObject' + type: array + title: Data + type: object RelationshipToIncident: description: Relationship to incident. properties: @@ -50792,6 +51038,49 @@ components: type: string x-enum-varnames: - CSM_RESOURCE_FILTER + ResourceIdentifierObject: + description: 'A JSON:API "resource identifier object" + + See: https://jsonapi.org/format/#document-resource-identifier-objects' + properties: + id: + example: '' + title: Id + type: string + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + type: + example: '' + title: Type + type: string + required: + - type + - id + title: ResourceIdentifierObject + type: object + ResourceObjectInputAttributes: + nullable: true + oneOf: + - $ref: '#/components/schemas/ResourceObjectInputAttributesOneOf' + - $ref: '#/components/schemas/JSONAPIAttributes' + title: Attributes + type: object + ResourceObjectInputAttributesOneOf: + additionalProperties: {} + type: object + ResourceObjectOutputAttributes: + nullable: true + oneOf: + - $ref: '#/components/schemas/ResourceObjectOutputAttributesOneOf' + - $ref: '#/components/schemas/JSONAPIAttributes' + title: Attributes + type: object + ResourceObjectOutputAttributesOneOf: + additionalProperties: {} + type: object ResponseMetaAttributes: description: Object describing meta attributes of response. properties: @@ -70025,6 +70314,81 @@ components: - FRIDAY - SATURDAY - SUNDAY + WidgetErrorInput: + description: 'A JSON:API "error object". + + See: https://jsonapi.org/format/1.0/#error-objects' + properties: + code: + nullable: true + title: Code + type: string + detail: + nullable: true + title: Detail + type: string + id: + nullable: true + title: Id + type: string + links: + $ref: '#/components/schemas/ErrorLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + source: + $ref: '#/components/schemas/ErrorSource' + nullable: true + status: + nullable: true + title: Status + type: string + title: + nullable: true + title: Title + type: string + title: Error + type: object + WidgetExperienceType: + description: Widget experience types that differentiate between the products + using the specific widget. + enum: + - ccm_reports + - logs_reports + - csv_reports + - product_analytics + example: ccm_reports + title: WidgetExperienceType + type: string + x-enum-varnames: + - CCM_REPORTS + - LOGS_REPORTS + - CSV_REPORTS + - PRODUCT_ANALYTICS + WidgetLinks: + description: 'A JSON:API "links" member + + See: https://jsonapi.org/format/#document-links' + properties: + describedBy: + $ref: '#/components/schemas/LinksDescribedBy' + first: + $ref: '#/components/schemas/LinksFirst' + last: + $ref: '#/components/schemas/LinksLast' + next: + $ref: '#/components/schemas/LinksNext' + prev: + $ref: '#/components/schemas/LinksPrev' + related: + $ref: '#/components/schemas/LinksRelated' + self: + $ref: '#/components/schemas/LinksSelf' + title: Links + type: object WidgetLiveSpan: description: The available timeframes depend on the widget you are using. enum: @@ -70061,6 +70425,287 @@ components: - PAST_SIX_MONTHS - PAST_ONE_YEAR - ALERT + WidgetRelationshipObjectInput: + description: 'A JSON:API "relationship object". + + See: https://jsonapi.org/format/#document-resource-object-relationships + + + (When including relationships in models, you probably want Relationship, not + this.)' + properties: + data: + $ref: '#/components/schemas/RelationshipObjectOutputData' + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + title: RelationshipObject + type: object + WidgetRelationshipObjectOutput: + description: 'A JSON:API "relationship object". + + See: https://jsonapi.org/format/#document-resource-object-relationships + + + (When including relationships in models, you probably want Relationship, not + this.)' + properties: + data: + $ref: '#/components/schemas/RelationshipObjectOutputData' + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + title: RelationshipObject + type: object + WidgetResourceObjectInput: + description: 'A JSON:API resource object. + + See: https://jsonapi.org/format/#document-resource-objects' + properties: + attributes: + $ref: '#/components/schemas/ResourceObjectInputAttributes' + id: + example: '' + title: Id + type: string + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + relationships: + additionalProperties: + $ref: '#/components/schemas/WidgetRelationshipObjectInput' + nullable: true + title: Relationships + type: object + type: + example: '' + title: Type + type: string + required: + - id + - type + title: ResourceObject + type: object + WidgetResourceObjectOutput: + description: 'A JSON:API resource object. + + See: https://jsonapi.org/format/#document-resource-objects' + properties: + attributes: + $ref: '#/components/schemas/ResourceObjectOutputAttributes' + id: + example: '' + title: Id + type: string + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + relationships: + additionalProperties: + $ref: '#/components/schemas/WidgetRelationshipObjectOutput' + nullable: true + title: Relationships + type: object + type: + example: '' + title: Type + type: string + required: + - id + - type + title: ResourceObject + type: object + WidgetSchemaAttributes: + properties: + created_at: + description: ISO 8601 timestamp of when the widget was created. + example: '' + title: Created At + type: string + definition: + $ref: '#/components/schemas/Definition' + description: The widget definition including type, title, and configuration. + is_favorited: + deprecated: true + description: 'Deprecated: this field is not functional and always returns + False.' + example: false + title: Is Favorited + type: boolean + modified_at: + description: ISO 8601 timestamp of when the widget was last modified. + example: '' + title: Modified At + type: string + tags: + description: User-defined tags for organizing widgets. + example: + - '' + items: + type: string + nullable: true + title: Tags + type: array + required: + - definition + - tags + - is_favorited + - created_at + - modified_at + title: WidgetSchemaAttributes + type: object + WidgetSchemaJSONAPIDocument: + properties: + data: + $ref: '#/components/schemas/WidgetSchemaResource' + errors: + items: + $ref: '#/components/schemas/WidgetErrorInput' + nullable: true + title: Errors + type: array + included: + items: + $ref: '#/components/schemas/WidgetResourceObjectOutput' + nullable: true + title: Included + type: array + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + required: + - data + title: WidgetSchemaJSONAPIDocument + type: object + WidgetSchemaJSONAPIListDocument: + properties: + data: + items: + $ref: '#/components/schemas/WidgetSchemaResource' + title: Data + type: array + errors: + items: + $ref: '#/components/schemas/WidgetErrorInput' + nullable: true + title: Errors + type: array + included: + items: + $ref: '#/components/schemas/WidgetResourceObjectOutput' + nullable: true + title: Included + type: array + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + required: + - data + title: WidgetSchemaJSONAPIListDocument + type: object + WidgetSchemaResource: + properties: + attributes: + $ref: '#/components/schemas/WidgetSchemaAttributes' + id: + example: '' + title: Id + type: string + links: + $ref: '#/components/schemas/WidgetLinks' + nullable: true + meta: + additionalProperties: {} + nullable: true + title: Meta + type: object + relationships: + additionalProperties: + $ref: '#/components/schemas/WidgetRelationshipObjectOutput' + nullable: true + title: Relationships + type: object + type: + example: '' + title: Type + type: string + required: + - id + - type + - attributes + title: WidgetSchemaResource + type: object + WidgetType: + description: 'Widget types that are allowed to be stored as individual records + in the ''widget'' PG table. + + + This is not a complete list of dashboards/notebooks widget types.' + enum: + - bar_chart + - change + - cloud_cost_summary + - cohort + - funnel + - geomap + - list_stream + - query_table + - query_value + - retention_curve + - sankey + - sunburst + - timeseries + - toplist + - treemap + example: bar_chart + title: WidgetType + type: string + x-enum-varnames: + - BAR_CHART + - CHANGE + - CLOUD_COST_SUMMARY + - COHORT + - FUNNEL + - GEOMAP + - LIST_STREAM + - QUERY_TABLE + - QUERY_VALUE + - RETENTION_CURVE + - SANKEY + - SUNBURST + - TIMESERIES + - TOPLIST + - TREEMAP WorkflowData: description: Data related to the workflow. properties: @@ -106812,6 +107457,172 @@ paths: operator: OR permissions: - teams_read + /api/v2/widgets/{experience_type}: + get: + description: Search and list widgets for a given experience type. Supports filtering + by widget type, creator, title, and tags, as well as sorting and pagination. + operationId: SearchWidgetsApiV2WidgetsExperienceTypeGet + parameters: + - description: The experience type for the widget. + example: ccm_reports + in: path + name: experience_type + required: true + schema: + $ref: '#/components/schemas/WidgetExperienceType' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WidgetSchemaJSONAPIListDocument' + description: Successful Response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Search widgets + tags: + - Widgets + post: + description: Create a new widget for a given experience type. + operationId: CreateWidgetApiV2WidgetsExperienceTypePost + parameters: + - description: The experience type for the widget. + example: ccm_reports + in: path + name: experience_type + required: true + schema: + $ref: '#/components/schemas/WidgetExperienceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrUpdateWidgetRequestJSONAPIRequestDocument' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WidgetSchemaJSONAPIDocument' + description: Successful Response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a widget + tags: + - Widgets + /api/v2/widgets/{experience_type}/{uuid}: + delete: + description: Soft-delete a widget by its UUID for a given experience type. + operationId: DeleteWidgetApiV2WidgetsExperienceTypeUuidDelete + parameters: + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + title: Uuid + type: string + - description: The experience type for the widget. + example: ccm_reports + in: path + name: experience_type + required: true + schema: + $ref: '#/components/schemas/WidgetExperienceType' + responses: + '204': + description: Successful Response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a widget + tags: + - Widgets + get: + description: Retrieve a widget by its UUID for a given experience type. + operationId: GetWidgetApiV2WidgetsExperienceTypeUuidGet + parameters: + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + title: Uuid + type: string + - description: The experience type for the widget. + example: ccm_reports + in: path + name: experience_type + required: true + schema: + $ref: '#/components/schemas/WidgetExperienceType' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WidgetSchemaJSONAPIDocument' + description: Successful Response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a widget + tags: + - Widgets + put: + description: Update a widget by its UUID for a given experience type. This performs + a full replacement of the widget definition. + operationId: UpdateWidgetApiV2WidgetsExperienceTypeUuidPut + parameters: + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + title: Uuid + type: string + - description: The experience type for the widget. + example: ccm_reports + in: path + name: experience_type + required: true + schema: + $ref: '#/components/schemas/WidgetExperienceType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOrUpdateWidgetRequestJSONAPIRequestDocument' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WidgetSchemaJSONAPIDocument' + description: Successful Response + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a widget + tags: + - Widgets /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires @@ -107847,6 +108658,8 @@ tags: externalDocs: url: https://docs.datadoghq.com/account_management/users name: Users +- description: Auto-generated tag Widgets + name: Widgets - description: Datadog Workflow Automation allows you to automate your end-to-end processes by connecting Datadog with the rest of your tech stack. Build workflows to auto-remediate your alerts, streamline your incident and security processes, diff --git a/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 941ac65308..cdbc6057dd 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -711,6 +711,13 @@ datadog\_api\_client.v2.api.users\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.widgets\_api module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.widgets_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.workflow\_automation\_api module ------------------------------------------------------------ diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 67db73c7f0..4f979adbb9 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -6220,6 +6220,27 @@ datadog\_api\_client.v2.model.create\_open\_api\_response\_data module :members: :show-inheritance: +datadog\_api\_client.v2.model.create\_or\_update\_widget\_request\_attributes module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.create_or_update_widget_request_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_or\_update\_widget\_request\_jsonapi\_request\_document module +---------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_or_update_widget_request_jsonapi_request_document + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.create\_or\_update\_widget\_request\_resource\_object\_request module +--------------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.create_or_update_widget_request_resource_object_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.create\_page\_request module ---------------------------------------------------------- @@ -7837,6 +7858,13 @@ datadog\_api\_client.v2.model.datastore\_trigger\_wrapper module :members: :show-inheritance: +datadog\_api\_client.v2.model.definition module +----------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.definition + :members: + :show-inheritance: + datadog\_api\_client.v2.model.degradation module ------------------------------------------------ @@ -9517,6 +9545,27 @@ datadog\_api\_client.v2.model.error\_handler module :members: :show-inheritance: +datadog\_api\_client.v2.model.error\_links module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.error_links + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.error\_links\_about module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.error_links_about + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.error\_source module +-------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.error_source + :members: + :show-inheritance: + datadog\_api\_client.v2.model.escalation module ----------------------------------------------- @@ -14767,6 +14816,13 @@ datadog\_api\_client.v2.model.json\_patch\_operation\_op module :members: :show-inheritance: +datadog\_api\_client.v2.model.jsonapi\_attributes module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.jsonapi_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.jsonapi\_error\_item module --------------------------------------------------------- @@ -14970,6 +15026,13 @@ datadog\_api\_client.v2.model.library module :members: :show-inheritance: +datadog\_api\_client.v2.model.link\_object module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.link_object + :members: + :show-inheritance: + datadog\_api\_client.v2.model.links module ------------------------------------------ @@ -14977,6 +15040,55 @@ datadog\_api\_client.v2.model.links module :members: :show-inheritance: +datadog\_api\_client.v2.model.links\_described\_by module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.links_described_by + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.links\_first module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.links_first + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.links\_last module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.links_last + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.links\_next module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.links_next + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.links\_prev module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.links_prev + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.links\_related module +--------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.links_related + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.links\_self module +------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.links_self + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_apis\_response module --------------------------------------------------------- @@ -21375,6 +21487,13 @@ datadog\_api\_client.v2.model.relationship\_item module :members: :show-inheritance: +datadog\_api\_client.v2.model.relationship\_object\_output\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.relationship_object_output_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.relationship\_to\_incident module --------------------------------------------------------------- @@ -21858,6 +21977,41 @@ datadog\_api\_client.v2.model.resource\_filter\_request\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.resource\_identifier\_object module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resource_identifier_object + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resource\_object\_input\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.resource_object_input_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resource\_object\_input\_attributes\_one\_of module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resource_object_input_attributes_one_of + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resource\_object\_output\_attributes module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resource_object_output_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.resource\_object\_output\_attributes\_one\_of module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.resource_object_output_attributes_one_of + :members: + :show-inheritance: + datadog\_api\_client.v2.model.response\_meta\_attributes module --------------------------------------------------------------- @@ -30769,6 +30923,27 @@ datadog\_api\_client.v2.model.weekday module :members: :show-inheritance: +datadog\_api\_client.v2.model.widget\_error\_input module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_error_input + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_experience\_type module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_experience_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_links module +-------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_links + :members: + :show-inheritance: + datadog\_api\_client.v2.model.widget\_live\_span module ------------------------------------------------------- @@ -30776,6 +30951,69 @@ datadog\_api\_client.v2.model.widget\_live\_span module :members: :show-inheritance: +datadog\_api\_client.v2.model.widget\_relationship\_object\_input module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.widget_relationship_object_input + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_relationship\_object\_output module +------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_relationship_object_output + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_resource\_object\_input module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_resource_object_input + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_resource\_object\_output module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_resource_object_output + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_schema\_attributes module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_schema_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_schema\_jsonapi\_document module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_schema_jsonapi_document + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_schema\_jsonapi\_list\_document module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_schema_jsonapi_list_document + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_schema\_resource module +------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_schema_resource + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.widget\_type module +------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.widget_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.workflow\_data module --------------------------------------------------- diff --git a/examples/v2/widgets/CreateWidgetApiV2WidgetsExperienceTypePost.py b/examples/v2/widgets/CreateWidgetApiV2WidgetsExperienceTypePost.py new file mode 100644 index 0000000000..c484dc0445 --- /dev/null +++ b/examples/v2/widgets/CreateWidgetApiV2WidgetsExperienceTypePost.py @@ -0,0 +1,114 @@ +""" +Create a widget returns "Successful Response" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.widgets_api import WidgetsApi +from datadog_api_client.v2.model.create_or_update_widget_request_attributes import CreateOrUpdateWidgetRequestAttributes +from datadog_api_client.v2.model.create_or_update_widget_request_jsonapi_request_document import ( + CreateOrUpdateWidgetRequestJSONAPIRequestDocument, +) +from datadog_api_client.v2.model.create_or_update_widget_request_resource_object_request import ( + CreateOrUpdateWidgetRequestResourceObjectRequest, +) +from datadog_api_client.v2.model.definition import Definition +from datadog_api_client.v2.model.error_links import ErrorLinks +from datadog_api_client.v2.model.error_source import ErrorSource +from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType +from datadog_api_client.v2.model.widget_links import WidgetLinks +from datadog_api_client.v2.model.widget_resource_object_input import WidgetResourceObjectInput +from datadog_api_client.v2.model.widget_type import WidgetType + +body = CreateOrUpdateWidgetRequestJSONAPIRequestDocument( + data=CreateOrUpdateWidgetRequestResourceObjectRequest( + attributes=CreateOrUpdateWidgetRequestAttributes( + definition=Definition( + requests=[ + dict( + [ + ( + "queries", + "[{'data_source': 'metrics', 'name': 'query1', 'query': 'avg:system.cpu.user{*}'}]", + ), + ("response_format", "timeseries"), + ] + ), + ], + time=dict([("type", "live"), ("unit", "day"), ("value", "30")]), + title="My Timeseries Widget", + type=WidgetType.TIMESERIES, + ), + tags=[], + ), + id=None, + lid=None, + links=WidgetLinks( + described_by=None, + first=None, + last=None, + next=None, + prev=None, + related=None, + self=None, + ), + meta=None, + relationships=None, + type="", + ), + errors=[ + WidgetErrorInput( + code=None, + detail=None, + id=None, + links=ErrorLinks( + about="", + ), + meta=None, + source=ErrorSource( + header=None, + parameter=None, + pointer=None, + ), + status=None, + title=None, + ), + ], + included=[ + WidgetResourceObjectInput( + attributes=None, + id="", + links=WidgetLinks( + described_by=None, + first=None, + last=None, + next=None, + prev=None, + related=None, + self=None, + ), + meta=None, + relationships=None, + type="", + ), + ], + links=WidgetLinks( + described_by=None, + first=None, + last=None, + next=None, + prev=None, + related=None, + self=None, + ), + meta=None, +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = WidgetsApi(api_client) + response = api_instance.create_widget_api_v2_widgets_experience_type_post( + experience_type=WidgetExperienceType.CCM_REPORTS, body=body + ) + + print(response) diff --git a/examples/v2/widgets/DeleteWidgetApiV2WidgetsExperienceTypeUuidDelete.py b/examples/v2/widgets/DeleteWidgetApiV2WidgetsExperienceTypeUuidDelete.py new file mode 100644 index 0000000000..0f522922b1 --- /dev/null +++ b/examples/v2/widgets/DeleteWidgetApiV2WidgetsExperienceTypeUuidDelete.py @@ -0,0 +1,16 @@ +""" +Delete a widget returns "Successful Response" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.widgets_api import WidgetsApi +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType +from uuid import UUID + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = WidgetsApi(api_client) + api_instance.delete_widget_api_v2_widgets_experience_type_uuid_delete( + uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + experience_type=WidgetExperienceType.CCM_REPORTS, + ) diff --git a/examples/v2/widgets/GetWidgetApiV2WidgetsExperienceTypeUuidGet.py b/examples/v2/widgets/GetWidgetApiV2WidgetsExperienceTypeUuidGet.py new file mode 100644 index 0000000000..bfdecb4fa9 --- /dev/null +++ b/examples/v2/widgets/GetWidgetApiV2WidgetsExperienceTypeUuidGet.py @@ -0,0 +1,18 @@ +""" +Get a widget returns "Successful Response" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.widgets_api import WidgetsApi +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType +from uuid import UUID + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = WidgetsApi(api_client) + response = api_instance.get_widget_api_v2_widgets_experience_type_uuid_get( + uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + experience_type=WidgetExperienceType.CCM_REPORTS, + ) + + print(response) diff --git a/examples/v2/widgets/SearchWidgetsApiV2WidgetsExperienceTypeGet.py b/examples/v2/widgets/SearchWidgetsApiV2WidgetsExperienceTypeGet.py new file mode 100644 index 0000000000..be04bead98 --- /dev/null +++ b/examples/v2/widgets/SearchWidgetsApiV2WidgetsExperienceTypeGet.py @@ -0,0 +1,16 @@ +""" +Search widgets returns "Successful Response" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.widgets_api import WidgetsApi +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = WidgetsApi(api_client) + response = api_instance.search_widgets_api_v2_widgets_experience_type_get( + experience_type=WidgetExperienceType.CCM_REPORTS, + ) + + print(response) diff --git a/examples/v2/widgets/UpdateWidgetApiV2WidgetsExperienceTypeUuidPut.py b/examples/v2/widgets/UpdateWidgetApiV2WidgetsExperienceTypeUuidPut.py new file mode 100644 index 0000000000..b0e159f7ed --- /dev/null +++ b/examples/v2/widgets/UpdateWidgetApiV2WidgetsExperienceTypeUuidPut.py @@ -0,0 +1,115 @@ +""" +Update a widget returns "Successful Response" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.widgets_api import WidgetsApi +from datadog_api_client.v2.model.create_or_update_widget_request_attributes import CreateOrUpdateWidgetRequestAttributes +from datadog_api_client.v2.model.create_or_update_widget_request_jsonapi_request_document import ( + CreateOrUpdateWidgetRequestJSONAPIRequestDocument, +) +from datadog_api_client.v2.model.create_or_update_widget_request_resource_object_request import ( + CreateOrUpdateWidgetRequestResourceObjectRequest, +) +from datadog_api_client.v2.model.definition import Definition +from datadog_api_client.v2.model.error_links import ErrorLinks +from datadog_api_client.v2.model.error_source import ErrorSource +from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType +from datadog_api_client.v2.model.widget_links import WidgetLinks +from datadog_api_client.v2.model.widget_resource_object_input import WidgetResourceObjectInput +from datadog_api_client.v2.model.widget_type import WidgetType +from uuid import UUID + +body = CreateOrUpdateWidgetRequestJSONAPIRequestDocument( + data=CreateOrUpdateWidgetRequestResourceObjectRequest( + attributes=CreateOrUpdateWidgetRequestAttributes( + definition=Definition( + requests=[ + dict( + [ + ( + "queries", + "[{'data_source': 'metrics', 'name': 'query1', 'query': 'avg:system.cpu.user{*}'}]", + ), + ("response_format", "timeseries"), + ] + ), + ], + time=dict([("type", "live"), ("unit", "day"), ("value", "30")]), + title="My Timeseries Widget", + type=WidgetType.TIMESERIES, + ), + tags=[], + ), + id=None, + lid=None, + links=WidgetLinks( + described_by=None, + first=None, + last=None, + next=None, + prev=None, + related=None, + self=None, + ), + meta=None, + relationships=None, + type="", + ), + errors=[ + WidgetErrorInput( + code=None, + detail=None, + id=None, + links=ErrorLinks( + about="", + ), + meta=None, + source=ErrorSource( + header=None, + parameter=None, + pointer=None, + ), + status=None, + title=None, + ), + ], + included=[ + WidgetResourceObjectInput( + attributes=None, + id="", + links=WidgetLinks( + described_by=None, + first=None, + last=None, + next=None, + prev=None, + related=None, + self=None, + ), + meta=None, + relationships=None, + type="", + ), + ], + links=WidgetLinks( + described_by=None, + first=None, + last=None, + next=None, + prev=None, + related=None, + self=None, + ), + meta=None, +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = WidgetsApi(api_client) + response = api_instance.update_widget_api_v2_widgets_experience_type_uuid_put( + uuid=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), experience_type=WidgetExperienceType.CCM_REPORTS, body=body + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/widgets_api.py b/src/datadog_api_client/v2/api/widgets_api.py new file mode 100644 index 0000000000..ab5332a6d5 --- /dev/null +++ b/src/datadog_api_client/v2/api/widgets_api.py @@ -0,0 +1,276 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UUID, +) +from datadog_api_client.v2.model.widget_schema_jsonapi_list_document import WidgetSchemaJSONAPIListDocument +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType +from datadog_api_client.v2.model.widget_schema_jsonapi_document import WidgetSchemaJSONAPIDocument +from datadog_api_client.v2.model.create_or_update_widget_request_jsonapi_request_document import ( + CreateOrUpdateWidgetRequestJSONAPIRequestDocument, +) + + +class WidgetsApi: + """ + Auto-generated tag Widgets + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_widget_api_v2_widgets_experience_type_post_endpoint = _Endpoint( + settings={ + "response_type": (WidgetSchemaJSONAPIDocument,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/widgets/{experience_type}", + "operation_id": "create_widget_api_v2_widgets_experience_type_post", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "experience_type": { + "required": True, + "openapi_types": (WidgetExperienceType,), + "attribute": "experience_type", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CreateOrUpdateWidgetRequestJSONAPIRequestDocument,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_widget_api_v2_widgets_experience_type_uuid_delete_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/widgets/{experience_type}/{uuid}", + "operation_id": "delete_widget_api_v2_widgets_experience_type_uuid_delete", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "uuid": { + "required": True, + "openapi_types": (UUID,), + "attribute": "uuid", + "location": "path", + }, + "experience_type": { + "required": True, + "openapi_types": (WidgetExperienceType,), + "attribute": "experience_type", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._get_widget_api_v2_widgets_experience_type_uuid_get_endpoint = _Endpoint( + settings={ + "response_type": (WidgetSchemaJSONAPIDocument,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/widgets/{experience_type}/{uuid}", + "operation_id": "get_widget_api_v2_widgets_experience_type_uuid_get", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "uuid": { + "required": True, + "openapi_types": (UUID,), + "attribute": "uuid", + "location": "path", + }, + "experience_type": { + "required": True, + "openapi_types": (WidgetExperienceType,), + "attribute": "experience_type", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._search_widgets_api_v2_widgets_experience_type_get_endpoint = _Endpoint( + settings={ + "response_type": (WidgetSchemaJSONAPIListDocument,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/widgets/{experience_type}", + "operation_id": "search_widgets_api_v2_widgets_experience_type_get", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "experience_type": { + "required": True, + "openapi_types": (WidgetExperienceType,), + "attribute": "experience_type", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_widget_api_v2_widgets_experience_type_uuid_put_endpoint = _Endpoint( + settings={ + "response_type": (WidgetSchemaJSONAPIDocument,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/widgets/{experience_type}/{uuid}", + "operation_id": "update_widget_api_v2_widgets_experience_type_uuid_put", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "uuid": { + "required": True, + "openapi_types": (UUID,), + "attribute": "uuid", + "location": "path", + }, + "experience_type": { + "required": True, + "openapi_types": (WidgetExperienceType,), + "attribute": "experience_type", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (CreateOrUpdateWidgetRequestJSONAPIRequestDocument,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_widget_api_v2_widgets_experience_type_post( + self, + experience_type: WidgetExperienceType, + body: CreateOrUpdateWidgetRequestJSONAPIRequestDocument, + ) -> WidgetSchemaJSONAPIDocument: + """Create a widget. + + Create a new widget for a given experience type. + + :param experience_type: The experience type for the widget. + :type experience_type: WidgetExperienceType + :type body: CreateOrUpdateWidgetRequestJSONAPIRequestDocument + :rtype: WidgetSchemaJSONAPIDocument + """ + kwargs: Dict[str, Any] = {} + kwargs["experience_type"] = experience_type + + kwargs["body"] = body + + return self._create_widget_api_v2_widgets_experience_type_post_endpoint.call_with_http_info(**kwargs) + + def delete_widget_api_v2_widgets_experience_type_uuid_delete( + self, + uuid: UUID, + experience_type: WidgetExperienceType, + ) -> None: + """Delete a widget. + + Soft-delete a widget by its UUID for a given experience type. + + :param uuid: The UUID of the widget. + :type uuid: UUID + :param experience_type: The experience type for the widget. + :type experience_type: WidgetExperienceType + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["uuid"] = uuid + + kwargs["experience_type"] = experience_type + + return self._delete_widget_api_v2_widgets_experience_type_uuid_delete_endpoint.call_with_http_info(**kwargs) + + def get_widget_api_v2_widgets_experience_type_uuid_get( + self, + uuid: UUID, + experience_type: WidgetExperienceType, + ) -> WidgetSchemaJSONAPIDocument: + """Get a widget. + + Retrieve a widget by its UUID for a given experience type. + + :param uuid: The UUID of the widget. + :type uuid: UUID + :param experience_type: The experience type for the widget. + :type experience_type: WidgetExperienceType + :rtype: WidgetSchemaJSONAPIDocument + """ + kwargs: Dict[str, Any] = {} + kwargs["uuid"] = uuid + + kwargs["experience_type"] = experience_type + + return self._get_widget_api_v2_widgets_experience_type_uuid_get_endpoint.call_with_http_info(**kwargs) + + def search_widgets_api_v2_widgets_experience_type_get( + self, + experience_type: WidgetExperienceType, + ) -> WidgetSchemaJSONAPIListDocument: + """Search widgets. + + Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination. + + :param experience_type: The experience type for the widget. + :type experience_type: WidgetExperienceType + :rtype: WidgetSchemaJSONAPIListDocument + """ + kwargs: Dict[str, Any] = {} + kwargs["experience_type"] = experience_type + + return self._search_widgets_api_v2_widgets_experience_type_get_endpoint.call_with_http_info(**kwargs) + + def update_widget_api_v2_widgets_experience_type_uuid_put( + self, + uuid: UUID, + experience_type: WidgetExperienceType, + body: CreateOrUpdateWidgetRequestJSONAPIRequestDocument, + ) -> WidgetSchemaJSONAPIDocument: + """Update a widget. + + Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition. + + :param uuid: The UUID of the widget. + :type uuid: UUID + :param experience_type: The experience type for the widget. + :type experience_type: WidgetExperienceType + :type body: CreateOrUpdateWidgetRequestJSONAPIRequestDocument + :rtype: WidgetSchemaJSONAPIDocument + """ + kwargs: Dict[str, Any] = {} + kwargs["uuid"] = uuid + + kwargs["experience_type"] = experience_type + + kwargs["body"] = body + + return self._update_widget_api_v2_widgets_experience_type_uuid_put_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index d085528f44..7aa74fdeaf 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -99,6 +99,7 @@ from datadog_api_client.v2.api.test_optimization_api import TestOptimizationApi from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi from datadog_api_client.v2.api.users_api import UsersApi +from datadog_api_client.v2.api.widgets_api import WidgetsApi from datadog_api_client.v2.api.workflow_automation_api import WorkflowAutomationApi @@ -204,5 +205,6 @@ "TestOptimizationApi", "UsageMeteringApi", "UsersApi", + "WidgetsApi", "WorkflowAutomationApi", ] diff --git a/src/datadog_api_client/v2/model/create_or_update_widget_request_attributes.py b/src/datadog_api_client/v2/model/create_or_update_widget_request_attributes.py new file mode 100644 index 0000000000..a9375e92ae --- /dev/null +++ b/src/datadog_api_client/v2/model/create_or_update_widget_request_attributes.py @@ -0,0 +1,50 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.definition import Definition + + +class CreateOrUpdateWidgetRequestAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.definition import Definition + + return { + "definition": (Definition,), + "tags": ([str], none_type), + } + + attribute_map = { + "definition": "definition", + "tags": "tags", + } + + def __init__(self_, definition: Definition, tags: Union[List[str], none_type, UnsetType] = unset, **kwargs): + """ + + + :param definition: The definition of a widget, including its type and configuration. + :type definition: Definition + + :param tags: User-defined tags for organizing the widget. + :type tags: [str], none_type, optional + """ + if tags is not unset: + kwargs["tags"] = tags + super().__init__(kwargs) + + self_.definition = definition diff --git a/src/datadog_api_client/v2/model/create_or_update_widget_request_jsonapi_request_document.py b/src/datadog_api_client/v2/model/create_or_update_widget_request_jsonapi_request_document.py new file mode 100644 index 0000000000..8fa7213ad6 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_or_update_widget_request_jsonapi_request_document.py @@ -0,0 +1,109 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_or_update_widget_request_resource_object_request import ( + CreateOrUpdateWidgetRequestResourceObjectRequest, + ) + from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput + from datadog_api_client.v2.model.widget_resource_object_input import WidgetResourceObjectInput + from datadog_api_client.v2.model.widget_links import WidgetLinks + + +class CreateOrUpdateWidgetRequestJSONAPIRequestDocument(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_or_update_widget_request_resource_object_request import ( + CreateOrUpdateWidgetRequestResourceObjectRequest, + ) + from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput + from datadog_api_client.v2.model.widget_resource_object_input import WidgetResourceObjectInput + from datadog_api_client.v2.model.widget_links import WidgetLinks + + return { + "data": (CreateOrUpdateWidgetRequestResourceObjectRequest,), + "errors": ([WidgetErrorInput], none_type), + "included": ([WidgetResourceObjectInput], none_type), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + } + + attribute_map = { + "data": "data", + "errors": "errors", + "included": "included", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: CreateOrUpdateWidgetRequestResourceObjectRequest, + errors: Union[List[WidgetErrorInput], none_type, UnsetType] = unset, + included: Union[List[WidgetResourceObjectInput], none_type, UnsetType] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: CreateOrUpdateWidgetRequestResourceObjectRequest + + :param errors: + :type errors: [WidgetErrorInput], none_type, optional + + :param included: + :type included: [WidgetResourceObjectInput], none_type, optional + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + """ + if errors is not unset: + kwargs["errors"] = errors + if included is not unset: + kwargs["included"] = included + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/create_or_update_widget_request_resource_object_request.py b/src/datadog_api_client/v2/model/create_or_update_widget_request_resource_object_request.py new file mode 100644 index 0000000000..215175edb7 --- /dev/null +++ b/src/datadog_api_client/v2/model/create_or_update_widget_request_resource_object_request.py @@ -0,0 +1,122 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.create_or_update_widget_request_attributes import ( + CreateOrUpdateWidgetRequestAttributes, + ) + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_input import WidgetRelationshipObjectInput + + +class CreateOrUpdateWidgetRequestResourceObjectRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.create_or_update_widget_request_attributes import ( + CreateOrUpdateWidgetRequestAttributes, + ) + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_input import WidgetRelationshipObjectInput + + return { + "attributes": (CreateOrUpdateWidgetRequestAttributes,), + "id": (str, none_type), + "lid": (str, none_type), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "relationships": ({str: (WidgetRelationshipObjectInput,)}, none_type), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "lid": "lid", + "links": "links", + "meta": "meta", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: CreateOrUpdateWidgetRequestAttributes, + type: str, + id: Union[str, none_type, UnsetType] = unset, + lid: Union[str, none_type, UnsetType] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + relationships: Union[Dict[str, WidgetRelationshipObjectInput], none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: CreateOrUpdateWidgetRequestAttributes + + :param id: + :type id: str, none_type, optional + + :param lid: + :type lid: str, none_type, optional + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param relationships: + :type relationships: {str: (WidgetRelationshipObjectInput,)}, none_type, optional + + :param type: + :type type: str + """ + if id is not unset: + kwargs["id"] = id + if lid is not unset: + kwargs["lid"] = lid + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.type = type diff --git a/src/datadog_api_client/v2/model/definition.py b/src/datadog_api_client/v2/model/definition.py new file mode 100644 index 0000000000..cc1739750a --- /dev/null +++ b/src/datadog_api_client/v2/model/definition.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.widget_type import WidgetType + + +class Definition(ModelNormal): + validations = { + "title": { + "max_length": 100, + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.widget_type import WidgetType + + return { + "title": (str,), + "type": (WidgetType,), + } + + attribute_map = { + "title": "title", + "type": "type", + } + + def __init__(self_, title: str, type: WidgetType, **kwargs): + """ + The definition of a widget, including its type and configuration. + + :param title: The display title of the widget. + :type title: str + + :param type: Widget types that are allowed to be stored as individual records in the 'widget' PG table. + + This is not a complete list of dashboards/notebooks widget types. + :type type: WidgetType + """ + super().__init__(kwargs) + + self_.title = title + self_.type = type diff --git a/src/datadog_api_client/v2/model/error_links.py b/src/datadog_api_client/v2/model/error_links.py new file mode 100644 index 0000000000..18f481297e --- /dev/null +++ b/src/datadog_api_client/v2/model/error_links.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.error_links_about import ErrorLinksAbout + from datadog_api_client.v2.model.link_object import LinkObject + + +class ErrorLinks(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.error_links_about import ErrorLinksAbout + + return { + "about": (ErrorLinksAbout,), + } + + attribute_map = { + "about": "about", + } + + def __init__(self_, about: Union[ErrorLinksAbout, str, LinkObject], **kwargs): + """ + + + :param about: + :type about: ErrorLinksAbout + """ + super().__init__(kwargs) + + self_.about = about diff --git a/src/datadog_api_client/v2/model/error_links_about.py b/src/datadog_api_client/v2/model/error_links_about.py new file mode 100644 index 0000000000..80bf85c3e5 --- /dev/null +++ b/src/datadog_api_client/v2/model/error_links_about.py @@ -0,0 +1,57 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ErrorLinksAbout(ModelComposed): + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/error_source.py b/src/datadog_api_client/v2/model/error_source.py new file mode 100644 index 0000000000..1c83da0e49 --- /dev/null +++ b/src/datadog_api_client/v2/model/error_source.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +class ErrorSource(ModelNormal): + @cached_property + def openapi_types(_): + return { + "header": (str, none_type), + "parameter": (str, none_type), + "pointer": (str, none_type), + } + + attribute_map = { + "header": "header", + "parameter": "parameter", + "pointer": "pointer", + } + + def __init__( + self_, + header: Union[str, none_type, UnsetType] = unset, + parameter: Union[str, none_type, UnsetType] = unset, + pointer: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + An object containing references to the primary source of the error. + See: https://jsonapi.org/format/#error-objects + + :param header: + :type header: str, none_type, optional + + :param parameter: + :type parameter: str, none_type, optional + + :param pointer: + :type pointer: str, none_type, optional + """ + if header is not unset: + kwargs["header"] = header + if parameter is not unset: + kwargs["parameter"] = parameter + if pointer is not unset: + kwargs["pointer"] = pointer + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/jsonapi_attributes.py b/src/datadog_api_client/v2/model/jsonapi_attributes.py new file mode 100644 index 0000000000..81626442a6 --- /dev/null +++ b/src/datadog_api_client/v2/model/jsonapi_attributes.py @@ -0,0 +1,15 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class JSONAPIAttributes(ModelNormal): + def __init__(self_, **kwargs): + """ """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/link_object.py b/src/datadog_api_client/v2/model/link_object.py new file mode 100644 index 0000000000..3f41a0afb1 --- /dev/null +++ b/src/datadog_api_client/v2/model/link_object.py @@ -0,0 +1,109 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class LinkObject(ModelNormal): + @cached_property + def openapi_types(_): + return { + "describedby": (str, none_type), + "href": (str,), + "hreflang": ([str], none_type), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "rel": (str, none_type), + "title": (str, none_type), + "type": (str, none_type), + } + + attribute_map = { + "describedby": "describedby", + "href": "href", + "hreflang": "hreflang", + "meta": "meta", + "rel": "rel", + "title": "title", + "type": "type", + } + + def __init__( + self_, + href: str, + describedby: Union[str, none_type, UnsetType] = unset, + hreflang: Union[List[str], none_type, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + rel: Union[str, none_type, UnsetType] = unset, + title: Union[str, none_type, UnsetType] = unset, + type: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API "link object" + See: https://jsonapi.org/format/#auto-id--link-objects + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + if describedby is not unset: + kwargs["describedby"] = describedby + if hreflang is not unset: + kwargs["hreflang"] = hreflang + if meta is not unset: + kwargs["meta"] = meta + if rel is not unset: + kwargs["rel"] = rel + if title is not unset: + kwargs["title"] = title + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) + + self_.href = href diff --git a/src/datadog_api_client/v2/model/links_described_by.py b/src/datadog_api_client/v2/model/links_described_by.py new file mode 100644 index 0000000000..8abecd34ec --- /dev/null +++ b/src/datadog_api_client/v2/model/links_described_by.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksDescribedBy(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/links_first.py b/src/datadog_api_client/v2/model/links_first.py new file mode 100644 index 0000000000..19e50fb6c9 --- /dev/null +++ b/src/datadog_api_client/v2/model/links_first.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksFirst(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/links_last.py b/src/datadog_api_client/v2/model/links_last.py new file mode 100644 index 0000000000..3ac12242c7 --- /dev/null +++ b/src/datadog_api_client/v2/model/links_last.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksLast(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/links_next.py b/src/datadog_api_client/v2/model/links_next.py new file mode 100644 index 0000000000..594bc518d1 --- /dev/null +++ b/src/datadog_api_client/v2/model/links_next.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksNext(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/links_prev.py b/src/datadog_api_client/v2/model/links_prev.py new file mode 100644 index 0000000000..76749264db --- /dev/null +++ b/src/datadog_api_client/v2/model/links_prev.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksPrev(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/links_related.py b/src/datadog_api_client/v2/model/links_related.py new file mode 100644 index 0000000000..f7a5c2341e --- /dev/null +++ b/src/datadog_api_client/v2/model/links_related.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksRelated(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/links_self.py b/src/datadog_api_client/v2/model/links_self.py new file mode 100644 index 0000000000..0a68dbb842 --- /dev/null +++ b/src/datadog_api_client/v2/model/links_self.py @@ -0,0 +1,59 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class LinksSelf(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param describedby: + :type describedby: str, none_type, optional + + :param href: + :type href: str + + :param hreflang: + :type hreflang: [str], none_type, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param rel: + :type rel: str, none_type, optional + + :param title: + :type title: str, none_type, optional + + :param type: + :type type: str, none_type, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.link_object import LinkObject + + return { + "oneOf": [ + str, + LinkObject, + ], + } diff --git a/src/datadog_api_client/v2/model/relationship_object_output_data.py b/src/datadog_api_client/v2/model/relationship_object_output_data.py new file mode 100644 index 0000000000..9ffcf08463 --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_object_output_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class RelationshipObjectOutputData(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ + + + :param id: + :type id: str + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param type: + :type type: str + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.resource_identifier_object import ResourceIdentifierObject + from datadog_api_client.v2.model.resource_identifier_object import ResourceIdentifierObject + + return { + "oneOf": [ + ResourceIdentifierObject, + [ResourceIdentifierObject], + ], + } diff --git a/src/datadog_api_client/v2/model/resource_identifier_object.py b/src/datadog_api_client/v2/model/resource_identifier_object.py new file mode 100644 index 0000000000..590bd2ef1a --- /dev/null +++ b/src/datadog_api_client/v2/model/resource_identifier_object.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +class ResourceIdentifierObject(ModelNormal): + @cached_property + def openapi_types(_): + return { + "id": (str,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "type": (str,), + } + + attribute_map = { + "id": "id", + "meta": "meta", + "type": "type", + } + + def __init__(self_, id: str, type: str, meta: Union[Dict[str, Any], none_type, UnsetType] = unset, **kwargs): + """ + A JSON:API "resource identifier object" + See: https://jsonapi.org/format/#document-resource-identifier-objects + + :param id: + :type id: str + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param type: + :type type: str + """ + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/resource_object_input_attributes.py b/src/datadog_api_client/v2/model/resource_object_input_attributes.py new file mode 100644 index 0000000000..f13d946ddc --- /dev/null +++ b/src/datadog_api_client/v2/model/resource_object_input_attributes.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ResourceObjectInputAttributes(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.resource_object_input_attributes_one_of import ( + ResourceObjectInputAttributesOneOf, + ) + from datadog_api_client.v2.model.jsonapi_attributes import JSONAPIAttributes + + return { + "oneOf": [ + ResourceObjectInputAttributesOneOf, + JSONAPIAttributes, + ], + } diff --git a/src/datadog_api_client/v2/model/resource_object_input_attributes_one_of.py b/src/datadog_api_client/v2/model/resource_object_input_attributes_one_of.py new file mode 100644 index 0000000000..ed7d30144a --- /dev/null +++ b/src/datadog_api_client/v2/model/resource_object_input_attributes_one_of.py @@ -0,0 +1,15 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class ResourceObjectInputAttributesOneOf(ModelNormal): + def __init__(self_, **kwargs): + """ """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/resource_object_output_attributes.py b/src/datadog_api_client/v2/model/resource_object_output_attributes.py new file mode 100644 index 0000000000..6a82a8c473 --- /dev/null +++ b/src/datadog_api_client/v2/model/resource_object_output_attributes.py @@ -0,0 +1,39 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class ResourceObjectOutputAttributes(ModelComposed): + _nullable = True + + def __init__(self, **kwargs): + """ """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.resource_object_output_attributes_one_of import ( + ResourceObjectOutputAttributesOneOf, + ) + from datadog_api_client.v2.model.jsonapi_attributes import JSONAPIAttributes + + return { + "oneOf": [ + ResourceObjectOutputAttributesOneOf, + JSONAPIAttributes, + ], + } diff --git a/src/datadog_api_client/v2/model/resource_object_output_attributes_one_of.py b/src/datadog_api_client/v2/model/resource_object_output_attributes_one_of.py new file mode 100644 index 0000000000..97db17873a --- /dev/null +++ b/src/datadog_api_client/v2/model/resource_object_output_attributes_one_of.py @@ -0,0 +1,15 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, +) + + +class ResourceObjectOutputAttributesOneOf(ModelNormal): + def __init__(self_, **kwargs): + """ """ + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/widget_error_input.py b/src/datadog_api_client/v2/model/widget_error_input.py new file mode 100644 index 0000000000..9b2013c73a --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_error_input.py @@ -0,0 +1,126 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.error_links import ErrorLinks + from datadog_api_client.v2.model.error_source import ErrorSource + + +class WidgetErrorInput(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.error_links import ErrorLinks + from datadog_api_client.v2.model.error_source import ErrorSource + + return { + "code": (str, none_type), + "detail": (str, none_type), + "id": (str, none_type), + "links": (ErrorLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "source": (ErrorSource,), + "status": (str, none_type), + "title": (str, none_type), + } + + attribute_map = { + "code": "code", + "detail": "detail", + "id": "id", + "links": "links", + "meta": "meta", + "source": "source", + "status": "status", + "title": "title", + } + + def __init__( + self_, + code: Union[str, none_type, UnsetType] = unset, + detail: Union[str, none_type, UnsetType] = unset, + id: Union[str, none_type, UnsetType] = unset, + links: Union[ErrorLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + source: Union[ErrorSource, UnsetType] = unset, + status: Union[str, none_type, UnsetType] = unset, + title: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API "error object". + See: https://jsonapi.org/format/1.0/#error-objects + + :param code: + :type code: str, none_type, optional + + :param detail: + :type detail: str, none_type, optional + + :param id: + :type id: str, none_type, optional + + :param links: + :type links: ErrorLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param source: An object containing references to the primary source of the error. + See: https://jsonapi.org/format/#error-objects + :type source: ErrorSource, optional + + :param status: + :type status: str, none_type, optional + + :param title: + :type title: str, none_type, optional + """ + if code is not unset: + kwargs["code"] = code + if detail is not unset: + kwargs["detail"] = detail + if id is not unset: + kwargs["id"] = id + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + if source is not unset: + kwargs["source"] = source + if status is not unset: + kwargs["status"] = status + if title is not unset: + kwargs["title"] = title + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/widget_experience_type.py b/src/datadog_api_client/v2/model/widget_experience_type.py new file mode 100644 index 0000000000..5da187948e --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_experience_type.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class WidgetExperienceType(ModelSimple): + """ + Widget experience types that differentiate between the products using the specific widget. + + :param value: Must be one of ["ccm_reports", "logs_reports", "csv_reports", "product_analytics"]. + :type value: str + """ + + allowed_values = { + "ccm_reports", + "logs_reports", + "csv_reports", + "product_analytics", + } + CCM_REPORTS: ClassVar["WidgetExperienceType"] + LOGS_REPORTS: ClassVar["WidgetExperienceType"] + CSV_REPORTS: ClassVar["WidgetExperienceType"] + PRODUCT_ANALYTICS: ClassVar["WidgetExperienceType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WidgetExperienceType.CCM_REPORTS = WidgetExperienceType("ccm_reports") +WidgetExperienceType.LOGS_REPORTS = WidgetExperienceType("logs_reports") +WidgetExperienceType.CSV_REPORTS = WidgetExperienceType("csv_reports") +WidgetExperienceType.PRODUCT_ANALYTICS = WidgetExperienceType("product_analytics") diff --git a/src/datadog_api_client/v2/model/widget_links.py b/src/datadog_api_client/v2/model/widget_links.py new file mode 100644 index 0000000000..880f3385c4 --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_links.py @@ -0,0 +1,109 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.links_described_by import LinksDescribedBy + from datadog_api_client.v2.model.links_first import LinksFirst + from datadog_api_client.v2.model.links_last import LinksLast + from datadog_api_client.v2.model.links_next import LinksNext + from datadog_api_client.v2.model.links_prev import LinksPrev + from datadog_api_client.v2.model.links_related import LinksRelated + from datadog_api_client.v2.model.links_self import LinksSelf + from datadog_api_client.v2.model.link_object import LinkObject + + +class WidgetLinks(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.links_described_by import LinksDescribedBy + from datadog_api_client.v2.model.links_first import LinksFirst + from datadog_api_client.v2.model.links_last import LinksLast + from datadog_api_client.v2.model.links_next import LinksNext + from datadog_api_client.v2.model.links_prev import LinksPrev + from datadog_api_client.v2.model.links_related import LinksRelated + from datadog_api_client.v2.model.links_self import LinksSelf + + return { + "described_by": (LinksDescribedBy,), + "first": (LinksFirst,), + "last": (LinksLast,), + "next": (LinksNext,), + "prev": (LinksPrev,), + "related": (LinksRelated,), + "self": (LinksSelf,), + } + + attribute_map = { + "described_by": "describedBy", + "first": "first", + "last": "last", + "next": "next", + "prev": "prev", + "related": "related", + "self": "self", + } + + def __init__( + self_, + described_by: Union[Union[LinksDescribedBy, str, LinkObject], none_type, UnsetType] = unset, + first: Union[Union[LinksFirst, str, LinkObject], none_type, UnsetType] = unset, + last: Union[Union[LinksLast, str, LinkObject], none_type, UnsetType] = unset, + next: Union[Union[LinksNext, str, LinkObject], none_type, UnsetType] = unset, + prev: Union[Union[LinksPrev, str, LinkObject], none_type, UnsetType] = unset, + related: Union[Union[LinksRelated, str, LinkObject], none_type, UnsetType] = unset, + self: Union[Union[LinksSelf, str, LinkObject], none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + + :param described_by: + :type described_by: LinksDescribedBy, none_type, optional + + :param first: + :type first: LinksFirst, none_type, optional + + :param last: + :type last: LinksLast, none_type, optional + + :param next: + :type next: LinksNext, none_type, optional + + :param prev: + :type prev: LinksPrev, none_type, optional + + :param related: + :type related: LinksRelated, none_type, optional + + :param self: + :type self: LinksSelf, none_type, optional + """ + if described_by is not unset: + kwargs["described_by"] = described_by + if first is not unset: + kwargs["first"] = first + if last is not unset: + kwargs["last"] = last + if next is not unset: + kwargs["next"] = next + if prev is not unset: + kwargs["prev"] = prev + if related is not unset: + kwargs["related"] = related + if self is not unset: + kwargs["self"] = self + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/widget_relationship_object_input.py b/src/datadog_api_client/v2/model/widget_relationship_object_input.py new file mode 100644 index 0000000000..61c4c905be --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_relationship_object_input.py @@ -0,0 +1,93 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_object_output_data import RelationshipObjectOutputData + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.resource_identifier_object import ResourceIdentifierObject + + +class WidgetRelationshipObjectInput(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_object_output_data import RelationshipObjectOutputData + from datadog_api_client.v2.model.widget_links import WidgetLinks + + return { + "data": (RelationshipObjectOutputData,), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: Union[ + Union[RelationshipObjectOutputData, ResourceIdentifierObject, List[ResourceIdentifierObject]], + none_type, + UnsetType, + ] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API "relationship object". + See: https://jsonapi.org/format/#document-resource-object-relationships + + (When including relationships in models, you probably want Relationship, not this.) + + :param data: + :type data: RelationshipObjectOutputData, none_type, optional + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + """ + if data is not unset: + kwargs["data"] = data + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/widget_relationship_object_output.py b/src/datadog_api_client/v2/model/widget_relationship_object_output.py new file mode 100644 index 0000000000..87e4ba70ff --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_relationship_object_output.py @@ -0,0 +1,93 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_object_output_data import RelationshipObjectOutputData + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.resource_identifier_object import ResourceIdentifierObject + + +class WidgetRelationshipObjectOutput(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_object_output_data import RelationshipObjectOutputData + from datadog_api_client.v2.model.widget_links import WidgetLinks + + return { + "data": (RelationshipObjectOutputData,), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + } + + attribute_map = { + "data": "data", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: Union[ + Union[RelationshipObjectOutputData, ResourceIdentifierObject, List[ResourceIdentifierObject]], + none_type, + UnsetType, + ] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API "relationship object". + See: https://jsonapi.org/format/#document-resource-object-relationships + + (When including relationships in models, you probably want Relationship, not this.) + + :param data: + :type data: RelationshipObjectOutputData, none_type, optional + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + """ + if data is not unset: + kwargs["data"] = data + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/widget_resource_object_input.py b/src/datadog_api_client/v2/model/widget_resource_object_input.py new file mode 100644 index 0000000000..63f59afda5 --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_resource_object_input.py @@ -0,0 +1,117 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.resource_object_input_attributes import ResourceObjectInputAttributes + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_input import WidgetRelationshipObjectInput + from datadog_api_client.v2.model.resource_object_input_attributes_one_of import ResourceObjectInputAttributesOneOf + from datadog_api_client.v2.model.jsonapi_attributes import JSONAPIAttributes + + +class WidgetResourceObjectInput(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resource_object_input_attributes import ResourceObjectInputAttributes + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_input import WidgetRelationshipObjectInput + + return { + "attributes": (ResourceObjectInputAttributes,), + "id": (str,), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "relationships": ({str: (WidgetRelationshipObjectInput,)}, none_type), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "links": "links", + "meta": "meta", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + id: str, + type: str, + attributes: Union[ + Union[ResourceObjectInputAttributes, ResourceObjectInputAttributesOneOf, JSONAPIAttributes], + none_type, + UnsetType, + ] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + relationships: Union[Dict[str, WidgetRelationshipObjectInput], none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API resource object. + See: https://jsonapi.org/format/#document-resource-objects + + :param attributes: + :type attributes: ResourceObjectInputAttributes, none_type, optional + + :param id: + :type id: str + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param relationships: + :type relationships: {str: (WidgetRelationshipObjectInput,)}, none_type, optional + + :param type: + :type type: str + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/widget_resource_object_output.py b/src/datadog_api_client/v2/model/widget_resource_object_output.py new file mode 100644 index 0000000000..65fc04832b --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_resource_object_output.py @@ -0,0 +1,117 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.resource_object_output_attributes import ResourceObjectOutputAttributes + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_output import WidgetRelationshipObjectOutput + from datadog_api_client.v2.model.resource_object_output_attributes_one_of import ResourceObjectOutputAttributesOneOf + from datadog_api_client.v2.model.jsonapi_attributes import JSONAPIAttributes + + +class WidgetResourceObjectOutput(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.resource_object_output_attributes import ResourceObjectOutputAttributes + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_output import WidgetRelationshipObjectOutput + + return { + "attributes": (ResourceObjectOutputAttributes,), + "id": (str,), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "relationships": ({str: (WidgetRelationshipObjectOutput,)}, none_type), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "links": "links", + "meta": "meta", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + id: str, + type: str, + attributes: Union[ + Union[ResourceObjectOutputAttributes, ResourceObjectOutputAttributesOneOf, JSONAPIAttributes], + none_type, + UnsetType, + ] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + relationships: Union[Dict[str, WidgetRelationshipObjectOutput], none_type, UnsetType] = unset, + **kwargs, + ): + """ + A JSON:API resource object. + See: https://jsonapi.org/format/#document-resource-objects + + :param attributes: + :type attributes: ResourceObjectOutputAttributes, none_type, optional + + :param id: + :type id: str + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param relationships: + :type relationships: {str: (WidgetRelationshipObjectOutput,)}, none_type, optional + + :param type: + :type type: str + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/widget_schema_attributes.py b/src/datadog_api_client/v2/model/widget_schema_attributes.py new file mode 100644 index 0000000000..991dc9177c --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_schema_attributes.py @@ -0,0 +1,73 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.definition import Definition + + +class WidgetSchemaAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.definition import Definition + + return { + "created_at": (str,), + "definition": (Definition,), + "is_favorited": (bool,), + "modified_at": (str,), + "tags": ([str], none_type), + } + + attribute_map = { + "created_at": "created_at", + "definition": "definition", + "is_favorited": "is_favorited", + "modified_at": "modified_at", + "tags": "tags", + } + + def __init__( + self_, + created_at: str, + definition: Definition, + is_favorited: bool, + modified_at: str, + tags: Union[List[str], none_type], + **kwargs, + ): + """ + + + :param created_at: ISO 8601 timestamp of when the widget was created. + :type created_at: str + + :param definition: The definition of a widget, including its type and configuration. + :type definition: Definition + + :param is_favorited: Deprecated: this field is not functional and always returns False. **Deprecated**. + :type is_favorited: bool + + :param modified_at: ISO 8601 timestamp of when the widget was last modified. + :type modified_at: str + + :param tags: User-defined tags for organizing widgets. + :type tags: [str], none_type + """ + super().__init__(kwargs) + + self_.created_at = created_at + self_.definition = definition + self_.is_favorited = is_favorited + self_.modified_at = modified_at + self_.tags = tags diff --git a/src/datadog_api_client/v2/model/widget_schema_jsonapi_document.py b/src/datadog_api_client/v2/model/widget_schema_jsonapi_document.py new file mode 100644 index 0000000000..092b6f2f39 --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_schema_jsonapi_document.py @@ -0,0 +1,105 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.widget_schema_resource import WidgetSchemaResource + from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput + from datadog_api_client.v2.model.widget_resource_object_output import WidgetResourceObjectOutput + from datadog_api_client.v2.model.widget_links import WidgetLinks + + +class WidgetSchemaJSONAPIDocument(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.widget_schema_resource import WidgetSchemaResource + from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput + from datadog_api_client.v2.model.widget_resource_object_output import WidgetResourceObjectOutput + from datadog_api_client.v2.model.widget_links import WidgetLinks + + return { + "data": (WidgetSchemaResource,), + "errors": ([WidgetErrorInput], none_type), + "included": ([WidgetResourceObjectOutput], none_type), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + } + + attribute_map = { + "data": "data", + "errors": "errors", + "included": "included", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: WidgetSchemaResource, + errors: Union[List[WidgetErrorInput], none_type, UnsetType] = unset, + included: Union[List[WidgetResourceObjectOutput], none_type, UnsetType] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: WidgetSchemaResource + + :param errors: + :type errors: [WidgetErrorInput], none_type, optional + + :param included: + :type included: [WidgetResourceObjectOutput], none_type, optional + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + """ + if errors is not unset: + kwargs["errors"] = errors + if included is not unset: + kwargs["included"] = included + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/widget_schema_jsonapi_list_document.py b/src/datadog_api_client/v2/model/widget_schema_jsonapi_list_document.py new file mode 100644 index 0000000000..dd04aad823 --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_schema_jsonapi_list_document.py @@ -0,0 +1,105 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.widget_schema_resource import WidgetSchemaResource + from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput + from datadog_api_client.v2.model.widget_resource_object_output import WidgetResourceObjectOutput + from datadog_api_client.v2.model.widget_links import WidgetLinks + + +class WidgetSchemaJSONAPIListDocument(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.widget_schema_resource import WidgetSchemaResource + from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput + from datadog_api_client.v2.model.widget_resource_object_output import WidgetResourceObjectOutput + from datadog_api_client.v2.model.widget_links import WidgetLinks + + return { + "data": ([WidgetSchemaResource],), + "errors": ([WidgetErrorInput], none_type), + "included": ([WidgetResourceObjectOutput], none_type), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + } + + attribute_map = { + "data": "data", + "errors": "errors", + "included": "included", + "links": "links", + "meta": "meta", + } + + def __init__( + self_, + data: List[WidgetSchemaResource], + errors: Union[List[WidgetErrorInput], none_type, UnsetType] = unset, + included: Union[List[WidgetResourceObjectOutput], none_type, UnsetType] = unset, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param data: + :type data: [WidgetSchemaResource] + + :param errors: + :type errors: [WidgetErrorInput], none_type, optional + + :param included: + :type included: [WidgetResourceObjectOutput], none_type, optional + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + """ + if errors is not unset: + kwargs["errors"] = errors + if included is not unset: + kwargs["included"] = included + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/widget_schema_resource.py b/src/datadog_api_client/v2/model/widget_schema_resource.py new file mode 100644 index 0000000000..d2176523e2 --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_schema_resource.py @@ -0,0 +1,109 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.widget_schema_attributes import WidgetSchemaAttributes + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_output import WidgetRelationshipObjectOutput + + +class WidgetSchemaResource(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.widget_schema_attributes import WidgetSchemaAttributes + from datadog_api_client.v2.model.widget_links import WidgetLinks + from datadog_api_client.v2.model.widget_relationship_object_output import WidgetRelationshipObjectOutput + + return { + "attributes": (WidgetSchemaAttributes,), + "id": (str,), + "links": (WidgetLinks,), + "meta": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + none_type, + ), + "relationships": ({str: (WidgetRelationshipObjectOutput,)}, none_type), + "type": (str,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "links": "links", + "meta": "meta", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: WidgetSchemaAttributes, + id: str, + type: str, + links: Union[WidgetLinks, UnsetType] = unset, + meta: Union[Dict[str, Any], none_type, UnsetType] = unset, + relationships: Union[Dict[str, WidgetRelationshipObjectOutput], none_type, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: WidgetSchemaAttributes + + :param id: + :type id: str + + :param links: A JSON:API "links" member + See: https://jsonapi.org/format/#document-links + :type links: WidgetLinks, optional + + :param meta: + :type meta: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}, none_type, optional + + :param relationships: + :type relationships: {str: (WidgetRelationshipObjectOutput,)}, none_type, optional + + :param type: + :type type: str + """ + if links is not unset: + kwargs["links"] = links + if meta is not unset: + kwargs["meta"] = meta + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/widget_type.py b/src/datadog_api_client/v2/model/widget_type.py new file mode 100644 index 0000000000..8fda45b854 --- /dev/null +++ b/src/datadog_api_client/v2/model/widget_type.py @@ -0,0 +1,79 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class WidgetType(ModelSimple): + """ + Widget types that are allowed to be stored as individual records in the 'widget' PG table. + + This is not a complete list of dashboards/notebooks widget types. + + :param value: Must be one of ["bar_chart", "change", "cloud_cost_summary", "cohort", "funnel", "geomap", "list_stream", "query_table", "query_value", "retention_curve", "sankey", "sunburst", "timeseries", "toplist", "treemap"]. + :type value: str + """ + + allowed_values = { + "bar_chart", + "change", + "cloud_cost_summary", + "cohort", + "funnel", + "geomap", + "list_stream", + "query_table", + "query_value", + "retention_curve", + "sankey", + "sunburst", + "timeseries", + "toplist", + "treemap", + } + BAR_CHART: ClassVar["WidgetType"] + CHANGE: ClassVar["WidgetType"] + CLOUD_COST_SUMMARY: ClassVar["WidgetType"] + COHORT: ClassVar["WidgetType"] + FUNNEL: ClassVar["WidgetType"] + GEOMAP: ClassVar["WidgetType"] + LIST_STREAM: ClassVar["WidgetType"] + QUERY_TABLE: ClassVar["WidgetType"] + QUERY_VALUE: ClassVar["WidgetType"] + RETENTION_CURVE: ClassVar["WidgetType"] + SANKEY: ClassVar["WidgetType"] + SUNBURST: ClassVar["WidgetType"] + TIMESERIES: ClassVar["WidgetType"] + TOPLIST: ClassVar["WidgetType"] + TREEMAP: ClassVar["WidgetType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +WidgetType.BAR_CHART = WidgetType("bar_chart") +WidgetType.CHANGE = WidgetType("change") +WidgetType.CLOUD_COST_SUMMARY = WidgetType("cloud_cost_summary") +WidgetType.COHORT = WidgetType("cohort") +WidgetType.FUNNEL = WidgetType("funnel") +WidgetType.GEOMAP = WidgetType("geomap") +WidgetType.LIST_STREAM = WidgetType("list_stream") +WidgetType.QUERY_TABLE = WidgetType("query_table") +WidgetType.QUERY_VALUE = WidgetType("query_value") +WidgetType.RETENTION_CURVE = WidgetType("retention_curve") +WidgetType.SANKEY = WidgetType("sankey") +WidgetType.SUNBURST = WidgetType("sunburst") +WidgetType.TIMESERIES = WidgetType("timeseries") +WidgetType.TOPLIST = WidgetType("toplist") +WidgetType.TREEMAP = WidgetType("treemap") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index de43f25e1b..f73ff78888 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1191,6 +1191,13 @@ from datadog_api_client.v2.model.create_open_api_response import CreateOpenAPIResponse from datadog_api_client.v2.model.create_open_api_response_attributes import CreateOpenAPIResponseAttributes from datadog_api_client.v2.model.create_open_api_response_data import CreateOpenAPIResponseData +from datadog_api_client.v2.model.create_or_update_widget_request_attributes import CreateOrUpdateWidgetRequestAttributes +from datadog_api_client.v2.model.create_or_update_widget_request_jsonapi_request_document import ( + CreateOrUpdateWidgetRequestJSONAPIRequestDocument, +) +from datadog_api_client.v2.model.create_or_update_widget_request_resource_object_request import ( + CreateOrUpdateWidgetRequestResourceObjectRequest, +) from datadog_api_client.v2.model.create_page_request import CreatePageRequest from datadog_api_client.v2.model.create_page_request_data import CreatePageRequestData from datadog_api_client.v2.model.create_page_request_data_attributes import CreatePageRequestDataAttributes @@ -1583,6 +1590,7 @@ from datadog_api_client.v2.model.datastore_primary_key_generation_strategy import DatastorePrimaryKeyGenerationStrategy from datadog_api_client.v2.model.datastore_trigger import DatastoreTrigger from datadog_api_client.v2.model.datastore_trigger_wrapper import DatastoreTriggerWrapper +from datadog_api_client.v2.model.definition import Definition from datadog_api_client.v2.model.degradation import Degradation from datadog_api_client.v2.model.degradation_array import DegradationArray from datadog_api_client.v2.model.degradation_array_included import DegradationArrayIncluded @@ -1873,6 +1881,9 @@ from datadog_api_client.v2.model.entity_v3_system_kind import EntityV3SystemKind from datadog_api_client.v2.model.entity_v3_system_spec import EntityV3SystemSpec from datadog_api_client.v2.model.error_handler import ErrorHandler +from datadog_api_client.v2.model.error_links import ErrorLinks +from datadog_api_client.v2.model.error_links_about import ErrorLinksAbout +from datadog_api_client.v2.model.error_source import ErrorSource from datadog_api_client.v2.model.escalation import Escalation from datadog_api_client.v2.model.escalation_policy import EscalationPolicy from datadog_api_client.v2.model.escalation_policy_create_request import EscalationPolicyCreateRequest @@ -2753,6 +2764,7 @@ from datadog_api_client.v2.model.item_api_payload_meta_page import ItemApiPayloadMetaPage from datadog_api_client.v2.model.item_api_payload_meta_schema import ItemApiPayloadMetaSchema from datadog_api_client.v2.model.item_api_payload_meta_schema_field import ItemApiPayloadMetaSchemaField +from datadog_api_client.v2.model.jsonapi_attributes import JSONAPIAttributes from datadog_api_client.v2.model.jsonapi_error_item import JSONAPIErrorItem from datadog_api_client.v2.model.jsonapi_error_item_source import JSONAPIErrorItemSource from datadog_api_client.v2.model.jsonapi_error_response import JSONAPIErrorResponse @@ -2827,7 +2839,15 @@ from datadog_api_client.v2.model.leaked_key_attributes import LeakedKeyAttributes from datadog_api_client.v2.model.leaked_key_type import LeakedKeyType from datadog_api_client.v2.model.library import Library +from datadog_api_client.v2.model.link_object import LinkObject from datadog_api_client.v2.model.links import Links +from datadog_api_client.v2.model.links_described_by import LinksDescribedBy +from datadog_api_client.v2.model.links_first import LinksFirst +from datadog_api_client.v2.model.links_last import LinksLast +from datadog_api_client.v2.model.links_next import LinksNext +from datadog_api_client.v2.model.links_prev import LinksPrev +from datadog_api_client.v2.model.links_related import LinksRelated +from datadog_api_client.v2.model.links_self import LinksSelf from datadog_api_client.v2.model.list_apis_response import ListAPIsResponse from datadog_api_client.v2.model.list_apis_response_data import ListAPIsResponseData from datadog_api_client.v2.model.list_apis_response_data_attributes import ListAPIsResponseDataAttributes @@ -4403,6 +4423,7 @@ from datadog_api_client.v2.model.relation_to_entity import RelationToEntity from datadog_api_client.v2.model.relation_type import RelationType from datadog_api_client.v2.model.relationship_item import RelationshipItem +from datadog_api_client.v2.model.relationship_object_output_data import RelationshipObjectOutputData from datadog_api_client.v2.model.relationship_to_incident import RelationshipToIncident from datadog_api_client.v2.model.relationship_to_incident_attachment import RelationshipToIncidentAttachment from datadog_api_client.v2.model.relationship_to_incident_attachment_data import RelationshipToIncidentAttachmentData @@ -4500,6 +4521,11 @@ ) from datadog_api_client.v2.model.resource_filter_attributes import ResourceFilterAttributes from datadog_api_client.v2.model.resource_filter_request_type import ResourceFilterRequestType +from datadog_api_client.v2.model.resource_identifier_object import ResourceIdentifierObject +from datadog_api_client.v2.model.resource_object_input_attributes import ResourceObjectInputAttributes +from datadog_api_client.v2.model.resource_object_input_attributes_one_of import ResourceObjectInputAttributesOneOf +from datadog_api_client.v2.model.resource_object_output_attributes import ResourceObjectOutputAttributes +from datadog_api_client.v2.model.resource_object_output_attributes_one_of import ResourceObjectOutputAttributesOneOf from datadog_api_client.v2.model.response_meta_attributes import ResponseMetaAttributes from datadog_api_client.v2.model.restriction_policy import RestrictionPolicy from datadog_api_client.v2.model.restriction_policy_attributes import RestrictionPolicyAttributes @@ -6190,7 +6216,19 @@ from datadog_api_client.v2.model.watcher_data_attributes import WatcherDataAttributes from datadog_api_client.v2.model.watcher_data_type import WatcherDataType from datadog_api_client.v2.model.weekday import Weekday +from datadog_api_client.v2.model.widget_error_input import WidgetErrorInput +from datadog_api_client.v2.model.widget_experience_type import WidgetExperienceType +from datadog_api_client.v2.model.widget_links import WidgetLinks from datadog_api_client.v2.model.widget_live_span import WidgetLiveSpan +from datadog_api_client.v2.model.widget_relationship_object_input import WidgetRelationshipObjectInput +from datadog_api_client.v2.model.widget_relationship_object_output import WidgetRelationshipObjectOutput +from datadog_api_client.v2.model.widget_resource_object_input import WidgetResourceObjectInput +from datadog_api_client.v2.model.widget_resource_object_output import WidgetResourceObjectOutput +from datadog_api_client.v2.model.widget_schema_attributes import WidgetSchemaAttributes +from datadog_api_client.v2.model.widget_schema_jsonapi_document import WidgetSchemaJSONAPIDocument +from datadog_api_client.v2.model.widget_schema_jsonapi_list_document import WidgetSchemaJSONAPIListDocument +from datadog_api_client.v2.model.widget_schema_resource import WidgetSchemaResource +from datadog_api_client.v2.model.widget_type import WidgetType from datadog_api_client.v2.model.workflow_data import WorkflowData from datadog_api_client.v2.model.workflow_data_attributes import WorkflowDataAttributes from datadog_api_client.v2.model.workflow_data_relationships import WorkflowDataRelationships @@ -7116,6 +7154,9 @@ "CreateOpenAPIResponse", "CreateOpenAPIResponseAttributes", "CreateOpenAPIResponseData", + "CreateOrUpdateWidgetRequestAttributes", + "CreateOrUpdateWidgetRequestJSONAPIRequestDocument", + "CreateOrUpdateWidgetRequestResourceObjectRequest", "CreatePageRequest", "CreatePageRequestData", "CreatePageRequestDataAttributes", @@ -7380,6 +7421,7 @@ "DatastorePrimaryKeyGenerationStrategy", "DatastoreTrigger", "DatastoreTriggerWrapper", + "Definition", "Degradation", "DegradationArray", "DegradationArrayIncluded", @@ -7586,6 +7628,9 @@ "EntityV3SystemKind", "EntityV3SystemSpec", "ErrorHandler", + "ErrorLinks", + "ErrorLinksAbout", + "ErrorSource", "Escalation", "EscalationPolicy", "EscalationPolicyCreateRequest", @@ -8300,6 +8345,7 @@ "ItemApiPayloadMetaPage", "ItemApiPayloadMetaSchema", "ItemApiPayloadMetaSchemaField", + "JSONAPIAttributes", "JSONAPIErrorItem", "JSONAPIErrorItemSource", "JSONAPIErrorResponse", @@ -8366,7 +8412,15 @@ "LeakedKeyAttributes", "LeakedKeyType", "Library", + "LinkObject", "Links", + "LinksDescribedBy", + "LinksFirst", + "LinksLast", + "LinksNext", + "LinksPrev", + "LinksRelated", + "LinksSelf", "ListAPIsResponse", "ListAPIsResponseData", "ListAPIsResponseDataAttributes", @@ -9334,6 +9388,7 @@ "RelationToEntity", "RelationType", "RelationshipItem", + "RelationshipObjectOutputData", "RelationshipToIncident", "RelationshipToIncidentAttachment", "RelationshipToIncidentAttachmentData", @@ -9403,6 +9458,11 @@ "ResolveVulnerableSymbolsResponseResultsVulnerableSymbolsSymbols", "ResourceFilterAttributes", "ResourceFilterRequestType", + "ResourceIdentifierObject", + "ResourceObjectInputAttributes", + "ResourceObjectInputAttributesOneOf", + "ResourceObjectOutputAttributes", + "ResourceObjectOutputAttributesOneOf", "ResponseMetaAttributes", "RestrictionPolicy", "RestrictionPolicyAttributes", @@ -10629,7 +10689,19 @@ "WatcherDataAttributes", "WatcherDataType", "Weekday", + "WidgetErrorInput", + "WidgetExperienceType", + "WidgetLinks", "WidgetLiveSpan", + "WidgetRelationshipObjectInput", + "WidgetRelationshipObjectOutput", + "WidgetResourceObjectInput", + "WidgetResourceObjectOutput", + "WidgetSchemaAttributes", + "WidgetSchemaJSONAPIDocument", + "WidgetSchemaJSONAPIListDocument", + "WidgetSchemaResource", + "WidgetType", "WorkflowData", "WorkflowDataAttributes", "WorkflowDataRelationships", diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 6bcb5be0ae..f94ac0f0eb 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -5981,6 +5981,38 @@ "type": "safe" } }, + "SearchWidgetsApiV2WidgetsExperienceTypeGet": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, + "CreateWidgetApiV2WidgetsExperienceTypePost": { + "tag": "Widgets", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "DeleteWidgetApiV2WidgetsExperienceTypeUuidDelete": { + "tag": "Widgets", + "undo": { + "type": "idempotent" + } + }, + "GetWidgetApiV2WidgetsExperienceTypeUuidGet": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, + "UpdateWidgetApiV2WidgetsExperienceTypeUuidPut": { + "tag": "Widgets", + "undo": { + "type": "idempotent" + } + }, "CreateWorkflow": { "tag": "Workflow Automation", "undo": { diff --git a/tests/v2/features/widgets.feature b/tests/v2/features/widgets.feature new file mode 100644 index 0000000000..0f8c6c7a71 --- /dev/null +++ b/tests/v2/features/widgets.feature @@ -0,0 +1,48 @@ +@endpoint(widgets) @endpoint(widgets-v2) +Feature: Widgets + Auto-generated tag Widgets + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Widgets" API + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a widget returns "Successful Response" response + Given new "CreateWidgetApiV2WidgetsExperienceTypePost" request + And request contains "experience_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"requests": [{"queries": [{"data_source": "metrics", "name": "query1", "query": "avg:system.cpu.user{*}"}], "response_format": "timeseries"}], "time": {"type": "live", "unit": "day", "value": 30}, "title": "My Timeseries Widget", "type": "timeseries"}, "tags": []}, "id": null, "lid": null, "links": {"describedBy": null, "first": null, "last": null, "next": null, "prev": null, "related": null, "self": null}, "meta": null, "relationships": null, "type": ""}, "errors": [{"code": null, "detail": null, "id": null, "links": {"about": ""}, "meta": null, "source": {"header": null, "parameter": null, "pointer": null}, "status": null, "title": null}], "included": [{"attributes": null, "id": "", "links": {"describedBy": null, "first": null, "last": null, "next": null, "prev": null, "related": null, "self": null}, "meta": null, "relationships": null, "type": ""}], "links": {"describedBy": null, "first": null, "last": null, "next": null, "prev": null, "related": null, "self": null}, "meta": null} + When the request is sent + Then the response status is 200 Successful Response + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "Successful Response" response + Given new "DeleteWidgetApiV2WidgetsExperienceTypeUuidDelete" request + And request contains "uuid" parameter from "REPLACE.ME" + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 Successful Response + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "Successful Response" response + Given new "GetWidgetApiV2WidgetsExperienceTypeUuidGet" request + And request contains "uuid" parameter from "REPLACE.ME" + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful Response + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Search widgets returns "Successful Response" response + Given new "SearchWidgetsApiV2WidgetsExperienceTypeGet" request + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful Response + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "Successful Response" response + Given new "UpdateWidgetApiV2WidgetsExperienceTypeUuidPut" request + And request contains "uuid" parameter from "REPLACE.ME" + And request contains "experience_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"requests": [{"queries": [{"data_source": "metrics", "name": "query1", "query": "avg:system.cpu.user{*}"}], "response_format": "timeseries"}], "time": {"type": "live", "unit": "day", "value": 30}, "title": "My Timeseries Widget", "type": "timeseries"}, "tags": []}, "id": null, "lid": null, "links": {"describedBy": null, "first": null, "last": null, "next": null, "prev": null, "related": null, "self": null}, "meta": null, "relationships": null, "type": ""}, "errors": [{"code": null, "detail": null, "id": null, "links": {"about": ""}, "meta": null, "source": {"header": null, "parameter": null, "pointer": null}, "status": null, "title": null}], "included": [{"attributes": null, "id": "", "links": {"describedBy": null, "first": null, "last": null, "next": null, "prev": null, "related": null, "self": null}, "meta": null, "relationships": null, "type": ""}], "links": {"describedBy": null, "first": null, "last": null, "next": null, "prev": null, "related": null, "self": null}, "meta": null} + When the request is sent + Then the response status is 200 Successful Response