From 3ff81d692674749d5eec9056abba5ef0306b7d72 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 27 Jul 2021 12:46:36 +0000 Subject: [PATCH] Regenerate client from commit 9a2112a of spec repo --- .apigentools-info | 8 +- .openapi-generator/FILES | 1 - .openapi-generator/VERSION | 2 +- docs/v1/APIErrorResponse.md | 3 +- docs/v1/AWSAccount.md | 3 +- docs/v1/AWSAccountAndLambdaRequest.md | 3 +- docs/v1/AWSAccountCreateResponse.md | 3 +- docs/v1/AWSAccountDeleteRequest.md | 3 +- docs/v1/AWSAccountListResponse.md | 3 +- docs/v1/AWSLogsAsyncError.md | 3 +- docs/v1/AWSLogsAsyncResponse.md | 3 +- docs/v1/AWSLogsLambda.md | 3 +- docs/v1/AWSLogsListResponse.md | 3 +- docs/v1/AWSLogsListServicesResponse.md | 3 +- docs/v1/AWSLogsServicesRequest.md | 3 +- docs/v1/AWSNamespace.md | 3 +- docs/v1/AWSTagFilter.md | 3 +- docs/v1/AWSTagFilterCreateRequest.md | 3 +- docs/v1/AWSTagFilterDeleteRequest.md | 3 +- docs/v1/AWSTagFilterListResponse.md | 3 +- docs/v1/AccessRole.md | 3 +- docs/v1/AlertGraphWidgetDefinition.md | 3 +- docs/v1/AlertGraphWidgetDefinitionType.md | 3 +- docs/v1/AlertValueWidgetDefinition.md | 3 +- docs/v1/AlertValueWidgetDefinitionType.md | 3 +- docs/v1/ApiKey.md | 3 +- docs/v1/ApiKeyListResponse.md | 3 +- docs/v1/ApiKeyResponse.md | 3 +- docs/v1/ApmStatsQueryColumnType.md | 3 +- docs/v1/ApmStatsQueryDefinition.md | 3 +- docs/v1/ApmStatsQueryRowType.md | 3 +- docs/v1/ApplicationKey.md | 3 +- docs/v1/ApplicationKeyListResponse.md | 3 +- docs/v1/ApplicationKeyResponse.md | 3 +- docs/v1/AuthenticationValidationResponse.md | 3 +- docs/v1/AzureAccount.md | 3 +- docs/v1/AzureAccountListResponse.md | 3 +- docs/v1/CancelDowntimesByScopeRequest.md | 3 +- docs/v1/CanceledDowntimesIds.md | 3 +- docs/v1/ChangeWidgetDefinition.md | 3 +- docs/v1/ChangeWidgetDefinitionType.md | 3 +- docs/v1/ChangeWidgetRequest.md | 3 +- docs/v1/CheckCanDeleteMonitorResponse.md | 3 +- docs/v1/CheckCanDeleteMonitorResponseData.md | 3 +- docs/v1/CheckCanDeleteSLOResponse.md | 3 +- docs/v1/CheckCanDeleteSLOResponseData.md | 3 +- docs/v1/CheckStatusWidgetDefinition.md | 3 +- docs/v1/CheckStatusWidgetDefinitionType.md | 3 +- docs/v1/ContentEncoding.md | 3 +- docs/v1/Creator.md | 3 +- docs/v1/Dashboard.md | 3 +- docs/v1/DashboardBulkActionData.md | 3 +- docs/v1/DashboardBulkActionDataList.md | 3 +- docs/v1/DashboardBulkDeleteRequest.md | 3 +- docs/v1/DashboardDeleteResponse.md | 3 +- docs/v1/DashboardLayoutType.md | 3 +- docs/v1/DashboardList.md | 3 +- docs/v1/DashboardListDeleteResponse.md | 3 +- docs/v1/DashboardListListResponse.md | 3 +- docs/v1/DashboardListsApi.md | 22 - docs/v1/DashboardReflowType.md | 3 +- docs/v1/DashboardResourceType.md | 3 +- docs/v1/DashboardRestoreRequest.md | 3 +- docs/v1/DashboardSummary.md | 3 +- docs/v1/DashboardSummaryDefinition.md | 3 +- docs/v1/DashboardTemplateVariable.md | 3 +- docs/v1/DashboardTemplateVariablePreset.md | 3 +- .../DashboardTemplateVariablePresetValue.md | 3 +- docs/v1/DashboardsApi.md | 10 - docs/v1/DeletedMonitor.md | 3 +- docs/v1/DistributionWidgetDefinition.md | 3 +- docs/v1/DistributionWidgetDefinitionType.md | 3 +- docs/v1/DistributionWidgetRequest.md | 3 +- docs/v1/DistributionWidgetXAxis.md | 3 +- docs/v1/DistributionWidgetYAxis.md | 3 +- docs/v1/Downtime.md | 3 +- docs/v1/DowntimeChild.md | 3 +- docs/v1/DowntimeRecurrence.md | 3 +- docs/v1/DowntimesApi.md | 62 --- docs/v1/Event.md | 3 +- docs/v1/EventAlertType.md | 3 +- docs/v1/EventCreateRequest.md | 3 +- docs/v1/EventCreateResponse.md | 3 +- docs/v1/EventListResponse.md | 3 +- docs/v1/EventPriority.md | 3 +- docs/v1/EventQueryDefinition.md | 3 +- docs/v1/EventResponse.md | 3 +- docs/v1/EventStreamWidgetDefinition.md | 3 +- docs/v1/EventStreamWidgetDefinitionType.md | 3 +- docs/v1/EventTimelineWidgetDefinition.md | 3 +- docs/v1/EventTimelineWidgetDefinitionType.md | 3 +- docs/v1/EventsApi.md | 3 - docs/v1/FormulaAndFunctionEventAggregation.md | 3 +- .../FormulaAndFunctionEventQueryDefinition.md | 3 +- ...aAndFunctionEventQueryDefinitionCompute.md | 3 +- ...laAndFunctionEventQueryDefinitionSearch.md | 3 +- .../v1/FormulaAndFunctionEventQueryGroupBy.md | 3 +- ...FormulaAndFunctionEventQueryGroupBySort.md | 3 +- docs/v1/FormulaAndFunctionEventsDataSource.md | 3 +- .../v1/FormulaAndFunctionMetricAggregation.md | 3 +- docs/v1/FormulaAndFunctionMetricDataSource.md | 3 +- ...FormulaAndFunctionMetricQueryDefinition.md | 3 +- ...ormulaAndFunctionProcessQueryDataSource.md | 3 +- ...ormulaAndFunctionProcessQueryDefinition.md | 3 +- docs/v1/FormulaAndFunctionQueryDefinition.md | 2 +- docs/v1/FormulaAndFunctionResponseFormat.md | 3 +- docs/v1/FreeTextWidgetDefinition.md | 3 +- docs/v1/FreeTextWidgetDefinitionType.md | 3 +- docs/v1/GCPAccount.md | 3 +- docs/v1/GCPAccountListResponse.md | 3 +- docs/v1/GeomapWidgetDefinition.md | 3 +- docs/v1/GeomapWidgetDefinitionStyle.md | 3 +- docs/v1/GeomapWidgetDefinitionType.md | 3 +- docs/v1/GeomapWidgetDefinitionView.md | 3 +- docs/v1/GeomapWidgetRequest.md | 3 +- docs/v1/GraphSnapshot.md | 3 +- docs/v1/GroupWidgetDefinition.md | 3 +- docs/v1/GroupWidgetDefinitionType.md | 3 +- docs/v1/HTTPLog.md | 3 +- docs/v1/HTTPLogError.md | 3 +- docs/v1/HTTPLogItem.md | 3 +- docs/v1/HTTPMethod.md | 3 +- docs/v1/HeatMapWidgetDefinition.md | 3 +- docs/v1/HeatMapWidgetDefinitionType.md | 3 +- docs/v1/HeatMapWidgetRequest.md | 3 +- docs/v1/Host.md | 3 +- docs/v1/HostListResponse.md | 3 +- docs/v1/HostMapRequest.md | 3 +- docs/v1/HostMapWidgetDefinition.md | 3 +- docs/v1/HostMapWidgetDefinitionRequests.md | 3 +- docs/v1/HostMapWidgetDefinitionStyle.md | 3 +- docs/v1/HostMapWidgetDefinitionType.md | 3 +- docs/v1/HostMeta.md | 3 +- docs/v1/HostMetrics.md | 3 +- docs/v1/HostMuteResponse.md | 3 +- docs/v1/HostMuteSettings.md | 3 +- docs/v1/HostTags.md | 3 +- docs/v1/HostTotals.md | 3 +- docs/v1/IFrameWidgetDefinition.md | 3 +- docs/v1/IFrameWidgetDefinitionType.md | 3 +- docs/v1/IPPrefixesAPI.md | 3 +- docs/v1/IPPrefixesAPM.md | 3 +- docs/v1/IPPrefixesAgents.md | 3 +- docs/v1/IPPrefixesLogs.md | 3 +- docs/v1/IPPrefixesProcess.md | 3 +- docs/v1/IPPrefixesSynthetics.md | 3 +- docs/v1/IPPrefixesWebhooks.md | 3 +- docs/v1/IPRanges.md | 3 +- docs/v1/IdpFormData.md | 3 +- docs/v1/IdpResponse.md | 3 +- docs/v1/ImageWidgetDefinition.md | 3 +- docs/v1/ImageWidgetDefinitionType.md | 3 +- docs/v1/IntakePayloadAccepted.md | 3 +- docs/v1/KeyManagementApi.md | 10 - docs/v1/ListStreamColumn.md | 3 +- docs/v1/ListStreamColumnWidth.md | 3 +- docs/v1/ListStreamQuery.md | 3 +- docs/v1/ListStreamResponseFormat.md | 3 +- docs/v1/ListStreamSource.md | 3 +- docs/v1/ListStreamWidgetDefinition.md | 3 +- docs/v1/ListStreamWidgetDefinitionType.md | 3 +- docs/v1/ListStreamWidgetRequest.md | 3 +- docs/v1/Log.md | 3 +- docs/v1/LogContent.md | 3 +- docs/v1/LogQueryDefinition.md | 3 +- docs/v1/LogQueryDefinitionGroupBy.md | 3 +- docs/v1/LogQueryDefinitionGroupBySort.md | 3 +- docs/v1/LogQueryDefinitionSearch.md | 3 +- docs/v1/LogStreamWidgetDefinition.md | 3 +- docs/v1/LogStreamWidgetDefinitionType.md | 3 +- docs/v1/LogsAPIError.md | 3 +- docs/v1/LogsAPIErrorResponse.md | 3 +- docs/v1/LogsArithmeticProcessor.md | 3 +- docs/v1/LogsArithmeticProcessorType.md | 3 +- docs/v1/LogsAttributeRemapper.md | 3 +- docs/v1/LogsAttributeRemapperType.md | 3 +- docs/v1/LogsByRetention.md | 3 +- docs/v1/LogsByRetentionMonthlyUsage.md | 3 +- docs/v1/LogsByRetentionOrgUsage.md | 3 +- docs/v1/LogsByRetentionOrgs.md | 3 +- docs/v1/LogsCategoryProcessor.md | 3 +- docs/v1/LogsCategoryProcessorCategory.md | 3 +- docs/v1/LogsCategoryProcessorType.md | 3 +- docs/v1/LogsDateRemapper.md | 3 +- docs/v1/LogsDateRemapperType.md | 3 +- docs/v1/LogsExclusion.md | 3 +- docs/v1/LogsExclusionFilter.md | 3 +- docs/v1/LogsFilter.md | 3 +- docs/v1/LogsGeoIPParser.md | 3 +- docs/v1/LogsGeoIPParserType.md | 3 +- docs/v1/LogsGrokParser.md | 3 +- docs/v1/LogsGrokParserRules.md | 3 +- docs/v1/LogsGrokParserType.md | 3 +- docs/v1/LogsIndex.md | 3 +- docs/v1/LogsIndexListResponse.md | 3 +- docs/v1/LogsIndexUpdateRequest.md | 3 +- docs/v1/LogsIndexesApi.md | 1 - docs/v1/LogsIndexesOrder.md | 3 +- docs/v1/LogsListRequest.md | 3 +- docs/v1/LogsListRequestTime.md | 3 +- docs/v1/LogsListResponse.md | 3 +- docs/v1/LogsLookupProcessor.md | 3 +- docs/v1/LogsLookupProcessorType.md | 3 +- docs/v1/LogsMessageRemapper.md | 3 +- docs/v1/LogsMessageRemapperType.md | 3 +- docs/v1/LogsPipeline.md | 3 +- docs/v1/LogsPipelineList.md | 3 +- docs/v1/LogsPipelineProcessor.md | 3 +- docs/v1/LogsPipelineProcessorType.md | 3 +- docs/v1/LogsPipelinesApi.md | 6 - docs/v1/LogsPipelinesOrder.md | 3 +- docs/v1/LogsProcessor.md | 2 +- docs/v1/LogsQueryCompute.md | 3 +- docs/v1/LogsRetentionAggSumUsage.md | 3 +- docs/v1/LogsRetentionSumUsage.md | 3 +- docs/v1/LogsServiceRemapper.md | 3 +- docs/v1/LogsServiceRemapperType.md | 3 +- docs/v1/LogsSort.md | 3 +- docs/v1/LogsStatusRemapper.md | 3 +- docs/v1/LogsStatusRemapperType.md | 3 +- docs/v1/LogsStringBuilderProcessor.md | 3 +- docs/v1/LogsStringBuilderProcessorType.md | 3 +- docs/v1/LogsTraceRemapper.md | 3 +- docs/v1/LogsTraceRemapperType.md | 3 +- docs/v1/LogsURLParser.md | 3 +- docs/v1/LogsURLParserType.md | 3 +- docs/v1/LogsUserAgentParser.md | 3 +- docs/v1/LogsUserAgentParserType.md | 3 +- docs/v1/MetricMetadata.md | 3 +- docs/v1/MetricSearchResponse.md | 3 +- docs/v1/MetricSearchResponseResults.md | 3 +- docs/v1/MetricsApi.md | 1 - docs/v1/MetricsListResponse.md | 3 +- docs/v1/MetricsPayload.md | 3 +- docs/v1/MetricsQueryMetadata.md | 3 +- docs/v1/MetricsQueryResponse.md | 3 +- docs/v1/MetricsQueryUnit.md | 3 +- docs/v1/Monitor.md | 3 +- docs/v1/MonitorDeviceID.md | 3 +- docs/v1/MonitorGroupSearchResponse.md | 3 +- docs/v1/MonitorGroupSearchResponseCounts.md | 3 +- docs/v1/MonitorGroupSearchResult.md | 3 +- docs/v1/MonitorOptions.md | 3 +- docs/v1/MonitorOptionsAggregation.md | 3 +- docs/v1/MonitorOverallStates.md | 3 +- docs/v1/MonitorSearchCount.md | 3 +- docs/v1/MonitorSearchResponse.md | 3 +- docs/v1/MonitorSearchResponseCounts.md | 3 +- docs/v1/MonitorSearchResponseMetadata.md | 3 +- docs/v1/MonitorSearchResult.md | 3 +- docs/v1/MonitorSearchResultNotification.md | 3 +- docs/v1/MonitorState.md | 3 +- docs/v1/MonitorStateGroup.md | 3 +- docs/v1/MonitorSummaryWidgetDefinition.md | 3 +- docs/v1/MonitorSummaryWidgetDefinitionType.md | 3 +- docs/v1/MonitorThresholdWindowOptions.md | 3 +- docs/v1/MonitorThresholds.md | 3 +- docs/v1/MonitorType.md | 3 +- docs/v1/MonitorUpdateRequest.md | 3 +- docs/v1/MonitorsApi.md | 93 ---- docs/v1/NoteWidgetDefinition.md | 3 +- docs/v1/NoteWidgetDefinitionType.md | 3 +- docs/v1/NotebookAbsoluteTime.md | 3 +- docs/v1/NotebookAuthor.md | 3 +- docs/v1/NotebookCellCreateRequest.md | 3 +- .../v1/NotebookCellCreateRequestAttributes.md | 2 +- docs/v1/NotebookCellResourceType.md | 3 +- docs/v1/NotebookCellResponse.md | 3 +- docs/v1/NotebookCellResponseAttributes.md | 2 +- docs/v1/NotebookCellTime.md | 2 +- docs/v1/NotebookCellUpdateRequest.md | 3 +- .../v1/NotebookCellUpdateRequestAttributes.md | 2 +- docs/v1/NotebookCreateData.md | 3 +- docs/v1/NotebookCreateDataAttributes.md | 3 +- docs/v1/NotebookCreateRequest.md | 3 +- docs/v1/NotebookDistributionCellAttributes.md | 3 +- docs/v1/NotebookGlobalTime.md | 2 +- docs/v1/NotebookGraphSize.md | 3 +- docs/v1/NotebookHeatMapCellAttributes.md | 3 +- docs/v1/NotebookLogStreamCellAttributes.md | 3 +- docs/v1/NotebookMarkdownCellAttributes.md | 3 +- docs/v1/NotebookMarkdownCellDefinition.md | 3 +- docs/v1/NotebookMarkdownCellDefinitionType.md | 3 +- docs/v1/NotebookRelativeTime.md | 3 +- docs/v1/NotebookResourceType.md | 3 +- docs/v1/NotebookResponse.md | 3 +- docs/v1/NotebookResponseData.md | 3 +- docs/v1/NotebookResponseDataAttributes.md | 3 +- docs/v1/NotebookSplitBy.md | 3 +- docs/v1/NotebookStatus.md | 3 +- docs/v1/NotebookTimeseriesCellAttributes.md | 3 +- docs/v1/NotebookToplistCellAttributes.md | 3 +- docs/v1/NotebookUpdateCell.md | 2 +- docs/v1/NotebookUpdateData.md | 3 +- docs/v1/NotebookUpdateDataAttributes.md | 3 +- docs/v1/NotebookUpdateRequest.md | 3 +- docs/v1/NotebooksResponse.md | 3 +- docs/v1/NotebooksResponseData.md | 3 +- docs/v1/NotebooksResponseDataAttributes.md | 3 +- docs/v1/NotebooksResponseMeta.md | 3 +- docs/v1/NotebooksResponsePage.md | 3 +- docs/v1/Organization.md | 3 +- docs/v1/OrganizationBilling.md | 3 +- docs/v1/OrganizationCreateBody.md | 3 +- docs/v1/OrganizationCreateResponse.md | 3 +- docs/v1/OrganizationListResponse.md | 3 +- docs/v1/OrganizationResponse.md | 3 +- docs/v1/OrganizationSettings.md | 3 +- docs/v1/OrganizationSettingsSaml.md | 3 +- ...ationSettingsSamlAutocreateUsersDomains.md | 3 +- ...ganizationSettingsSamlIdpInitiatedLogin.md | 3 +- docs/v1/OrganizationSettingsSamlStrictMode.md | 3 +- docs/v1/OrganizationSubscription.md | 3 +- docs/v1/OrganizationsApi.md | 1 - docs/v1/PagerDutyService.md | 3 +- docs/v1/PagerDutyServiceKey.md | 3 +- docs/v1/PagerDutyServiceName.md | 3 +- docs/v1/Pagination.md | 3 +- docs/v1/Point.md | 3 +- docs/v1/ProcessQueryDefinition.md | 3 +- docs/v1/QuerySortOrder.md | 3 +- docs/v1/QueryValueWidgetDefinition.md | 3 +- docs/v1/QueryValueWidgetDefinitionType.md | 3 +- docs/v1/QueryValueWidgetRequest.md | 3 +- docs/v1/ResponseMetaAttributes.md | 3 +- docs/v1/SLOBulkDelete.md | 4 +- docs/v1/SLOBulkDeleteError.md | 3 +- docs/v1/SLOBulkDeleteResponse.md | 3 +- docs/v1/SLOBulkDeleteResponseData.md | 3 +- docs/v1/SLOCorrection.md | 3 +- docs/v1/SLOCorrectionCategory.md | 3 +- docs/v1/SLOCorrectionCreateData.md | 3 +- docs/v1/SLOCorrectionCreateRequest.md | 3 +- .../SLOCorrectionCreateRequestAttributes.md | 3 +- docs/v1/SLOCorrectionListResponse.md | 3 +- docs/v1/SLOCorrectionResponse.md | 3 +- docs/v1/SLOCorrectionResponseAttributes.md | 3 +- docs/v1/SLOCorrectionType.md | 3 +- docs/v1/SLOCorrectionUpdateData.md | 3 +- docs/v1/SLOCorrectionUpdateRequest.md | 3 +- .../SLOCorrectionUpdateRequestAttributes.md | 3 +- docs/v1/SLODeleteResponse.md | 3 +- docs/v1/SLOErrorBudgetRemainingData.md | 2 +- docs/v1/SLOErrorTimeframe.md | 3 +- docs/v1/SLOHistoryMetrics.md | 3 +- docs/v1/SLOHistoryMetricsSeries.md | 3 +- docs/v1/SLOHistoryMetricsSeriesMetadata.md | 3 +- .../v1/SLOHistoryMetricsSeriesMetadataUnit.md | 3 +- docs/v1/SLOHistoryResponse.md | 3 +- docs/v1/SLOHistoryResponseData.md | 3 +- docs/v1/SLOHistoryResponseError.md | 3 +- docs/v1/SLOHistorySLIData.md | 3 +- docs/v1/SLOListResponse.md | 3 +- docs/v1/SLOListResponseMetadata.md | 3 +- docs/v1/SLOListResponseMetadataPage.md | 3 +- docs/v1/SLOResponse.md | 3 +- docs/v1/SLOResponseData.md | 3 +- docs/v1/SLOThreshold.md | 3 +- docs/v1/SLOTimeframe.md | 3 +- docs/v1/SLOType.md | 3 +- docs/v1/SLOTypeNumeric.md | 3 +- docs/v1/SLOWidgetDefinition.md | 3 +- docs/v1/SLOWidgetDefinitionType.md | 3 +- docs/v1/ScatterPlotRequest.md | 3 +- docs/v1/ScatterPlotWidgetDefinition.md | 3 +- .../v1/ScatterPlotWidgetDefinitionRequests.md | 3 +- docs/v1/ScatterPlotWidgetDefinitionType.md | 3 +- docs/v1/Series.md | 3 +- docs/v1/ServiceCheck.md | 3 +- docs/v1/ServiceCheckStatus.md | 3 +- docs/v1/ServiceChecks.md | 3 +- docs/v1/ServiceLevelObjective.md | 3 +- docs/v1/ServiceLevelObjectiveQuery.md | 3 +- docs/v1/ServiceLevelObjectiveRequest.md | 3 +- docs/v1/ServiceLevelObjectivesApi.md | 8 - docs/v1/ServiceMapWidgetDefinition.md | 3 +- docs/v1/ServiceMapWidgetDefinitionType.md | 3 +- docs/v1/ServiceSummaryWidgetDefinition.md | 3 +- docs/v1/ServiceSummaryWidgetDefinitionType.md | 3 +- docs/v1/SlackIntegrationChannel.md | 3 +- docs/v1/SlackIntegrationChannelDisplay.md | 3 +- docs/v1/SlackIntegrationChannels.md | 3 +- docs/v1/SyntheticsAPIStep.md | 3 +- docs/v1/SyntheticsAPIStepSubtype.md | 3 +- docs/v1/SyntheticsAPITest.md | 3 +- docs/v1/SyntheticsAPITestConfig.md | 3 +- docs/v1/SyntheticsAPITestResultData.md | 3 +- docs/v1/SyntheticsAPITestResultFull.md | 3 +- docs/v1/SyntheticsAPITestResultFullCheck.md | 3 +- docs/v1/SyntheticsAPITestResultShort.md | 3 +- docs/v1/SyntheticsAPITestResultShortResult.md | 3 +- docs/v1/SyntheticsAPITestType.md | 3 +- docs/v1/SyntheticsApi.md | 46 +- docs/v1/SyntheticsAssertion.md | 2 +- .../v1/SyntheticsAssertionJSONPathOperator.md | 3 +- docs/v1/SyntheticsAssertionJSONPathTarget.md | 3 +- ...SyntheticsAssertionJSONPathTargetTarget.md | 3 +- docs/v1/SyntheticsAssertionOperator.md | 3 +- docs/v1/SyntheticsAssertionTarget.md | 5 +- docs/v1/SyntheticsAssertionType.md | 3 +- docs/v1/SyntheticsBasicAuth.md | 3 +- docs/v1/SyntheticsBrowserError.md | 3 +- docs/v1/SyntheticsBrowserErrorType.md | 3 +- docs/v1/SyntheticsBrowserTest.md | 3 +- docs/v1/SyntheticsBrowserTestConfig.md | 3 +- docs/v1/SyntheticsBrowserTestResultData.md | 3 +- docs/v1/SyntheticsBrowserTestResultFull.md | 3 +- .../SyntheticsBrowserTestResultFullCheck.md | 3 +- docs/v1/SyntheticsBrowserTestResultShort.md | 3 +- .../SyntheticsBrowserTestResultShortResult.md | 3 +- docs/v1/SyntheticsBrowserTestType.md | 3 +- docs/v1/SyntheticsBrowserVariable.md | 3 +- docs/v1/SyntheticsBrowserVariableType.md | 3 +- docs/v1/SyntheticsCITest.md | 3 +- docs/v1/SyntheticsCITestBody.md | 3 +- docs/v1/SyntheticsCITestMetadata.md | 3 +- docs/v1/SyntheticsCITestMetadataCi.md | 3 +- docs/v1/SyntheticsCITestMetadataGit.md | 3 +- docs/v1/SyntheticsCheckType.md | 3 +- docs/v1/SyntheticsConfigVariable.md | 3 +- docs/v1/SyntheticsConfigVariableType.md | 3 +- docs/v1/SyntheticsCoreWebVitals.md | 3 +- docs/v1/SyntheticsDeleteTestsPayload.md | 3 +- docs/v1/SyntheticsDeleteTestsResponse.md | 3 +- docs/v1/SyntheticsDeletedTest.md | 3 +- docs/v1/SyntheticsDevice.md | 3 +- docs/v1/SyntheticsDeviceID.md | 3 +- docs/v1/SyntheticsErrorCode.md | 3 +- ...ntheticsGetAPITestLatestResultsResponse.md | 3 +- ...ticsGetBrowserTestLatestResultsResponse.md | 3 +- docs/v1/SyntheticsGlobalVariable.md | 3 +- ...yntheticsGlobalVariableParseTestOptions.md | 3 +- ...eticsGlobalVariableParseTestOptionsType.md | 3 +- docs/v1/SyntheticsGlobalVariableParserType.md | 3 +- docs/v1/SyntheticsGlobalVariableValue.md | 3 +- .../SyntheticsListGlobalVariablesResponse.md | 3 +- docs/v1/SyntheticsListTestsResponse.md | 3 +- docs/v1/SyntheticsLocation.md | 3 +- docs/v1/SyntheticsLocations.md | 3 +- docs/v1/SyntheticsParsingOptions.md | 3 +- docs/v1/SyntheticsPlayingTab.md | 3 +- docs/v1/SyntheticsPrivateLocation.md | 3 +- ...ntheticsPrivateLocationCreationResponse.md | 3 +- ...ocationCreationResponseResultEncryption.md | 3 +- docs/v1/SyntheticsPrivateLocationSecrets.md | 3 +- ...icsPrivateLocationSecretsAuthentication.md | 3 +- ...sPrivateLocationSecretsConfigDecryption.md | 3 +- docs/v1/SyntheticsSSLCertificate.md | 3 +- docs/v1/SyntheticsSSLCertificateIssuer.md | 3 +- docs/v1/SyntheticsSSLCertificateSubject.md | 3 +- docs/v1/SyntheticsStep.md | 3 +- docs/v1/SyntheticsStepDetail.md | 3 +- docs/v1/SyntheticsStepDetailWarning.md | 3 +- docs/v1/SyntheticsStepType.md | 3 +- docs/v1/SyntheticsTestConfig.md | 3 +- docs/v1/SyntheticsTestDetails.md | 3 +- docs/v1/SyntheticsTestDetailsSubType.md | 3 +- docs/v1/SyntheticsTestDetailsType.md | 3 +- docs/v1/SyntheticsTestHeaders.md | 2 +- docs/v1/SyntheticsTestMonitorStatus.md | 3 +- docs/v1/SyntheticsTestOptions.md | 3 +- .../v1/SyntheticsTestOptionsMonitorOptions.md | 3 +- docs/v1/SyntheticsTestOptionsRetry.md | 3 +- docs/v1/SyntheticsTestPauseStatus.md | 3 +- docs/v1/SyntheticsTestProcessStatus.md | 3 +- docs/v1/SyntheticsTestRequest.md | 3 +- docs/v1/SyntheticsTestRequestCertificate.md | 3 +- .../SyntheticsTestRequestCertificateItem.md | 3 +- docs/v1/SyntheticsTiming.md | 3 +- docs/v1/SyntheticsTriggerCITestLocation.md | 3 +- docs/v1/SyntheticsTriggerCITestRunResult.md | 3 +- docs/v1/SyntheticsTriggerCITestsResponse.md | 3 +- .../SyntheticsUpdateTestPauseStatusPayload.md | 3 +- docs/v1/SyntheticsVariableParser.md | 3 +- docs/v1/SyntheticsWarningType.md | 3 +- docs/v1/TableWidgetCellDisplayMode.md | 3 +- docs/v1/TableWidgetDefinition.md | 3 +- docs/v1/TableWidgetDefinitionType.md | 3 +- docs/v1/TableWidgetHasSearchBar.md | 3 +- docs/v1/TableWidgetRequest.md | 3 +- docs/v1/TagToHosts.md | 3 +- docs/v1/TargetFormatType.md | 3 +- docs/v1/TimeseriesWidgetDefinition.md | 3 +- docs/v1/TimeseriesWidgetDefinitionType.md | 3 +- docs/v1/TimeseriesWidgetExpressionAlias.md | 3 +- docs/v1/TimeseriesWidgetLegendColumn.md | 3 +- docs/v1/TimeseriesWidgetLegendLayout.md | 3 +- docs/v1/TimeseriesWidgetRequest.md | 3 +- docs/v1/ToplistWidgetDefinition.md | 3 +- docs/v1/ToplistWidgetDefinitionType.md | 3 +- docs/v1/ToplistWidgetRequest.md | 3 +- docs/v1/TreeMapColorBy.md | 3 +- docs/v1/TreeMapGroupBy.md | 3 +- docs/v1/TreeMapSizeBy.md | 3 +- docs/v1/TreeMapWidgetDefinition.md | 3 +- docs/v1/TreeMapWidgetDefinitionType.md | 3 +- docs/v1/TreeMapWidgetRequest.md | 3 +- docs/v1/UsageAnalyzedLogsHour.md | 3 +- docs/v1/UsageAnalyzedLogsResponse.md | 3 +- docs/v1/UsageAttributionAggregates.md | 3 +- docs/v1/UsageAttributionAggregatesBody.md | 3 +- docs/v1/UsageAttributionBody.md | 3 +- docs/v1/UsageAttributionMetadata.md | 3 +- docs/v1/UsageAttributionPagination.md | 3 +- docs/v1/UsageAttributionResponse.md | 3 +- docs/v1/UsageAttributionSort.md | 3 +- docs/v1/UsageAttributionSupportedMetrics.md | 3 +- docs/v1/UsageAttributionTagNames.md | 2 +- docs/v1/UsageAttributionValues.md | 3 +- docs/v1/UsageAuditLogsHour.md | 3 +- docs/v1/UsageAuditLogsResponse.md | 3 +- docs/v1/UsageBillableSummaryBody.md | 3 +- docs/v1/UsageBillableSummaryHour.md | 3 +- docs/v1/UsageBillableSummaryKeys.md | 3 +- docs/v1/UsageBillableSummaryResponse.md | 3 +- docs/v1/UsageCWSHour.md | 3 +- docs/v1/UsageCWSResponse.md | 3 +- ...UsageCloudSecurityPostureManagementHour.md | 3 +- ...eCloudSecurityPostureManagementResponse.md | 3 +- docs/v1/UsageCustomReportsAttributes.md | 3 +- docs/v1/UsageCustomReportsData.md | 3 +- docs/v1/UsageCustomReportsMeta.md | 3 +- docs/v1/UsageCustomReportsPage.md | 3 +- docs/v1/UsageCustomReportsResponse.md | 3 +- docs/v1/UsageFargateHour.md | 3 +- docs/v1/UsageFargateResponse.md | 3 +- docs/v1/UsageHostHour.md | 3 +- docs/v1/UsageHostsResponse.md | 3 +- docs/v1/UsageIncidentManagementHour.md | 3 +- docs/v1/UsageIncidentManagementResponse.md | 3 +- docs/v1/UsageIndexedSpansHour.md | 3 +- docs/v1/UsageIndexedSpansResponse.md | 3 +- docs/v1/UsageIngestedSpansHour.md | 3 +- docs/v1/UsageIngestedSpansResponse.md | 3 +- docs/v1/UsageIoTHour.md | 3 +- docs/v1/UsageIoTResponse.md | 3 +- docs/v1/UsageLambdaHour.md | 3 +- docs/v1/UsageLambdaResponse.md | 3 +- docs/v1/UsageLogsByIndexHour.md | 3 +- docs/v1/UsageLogsByIndexResponse.md | 3 +- docs/v1/UsageLogsByRetentionHour.md | 3 +- docs/v1/UsageLogsByRetentionResponse.md | 3 +- docs/v1/UsageLogsHour.md | 3 +- docs/v1/UsageLogsResponse.md | 3 +- docs/v1/UsageMetricCategory.md | 3 +- docs/v1/UsageNetworkFlowsHour.md | 3 +- docs/v1/UsageNetworkFlowsResponse.md | 3 +- docs/v1/UsageNetworkHostsHour.md | 3 +- docs/v1/UsageNetworkHostsResponse.md | 3 +- docs/v1/UsageProfilingHour.md | 3 +- docs/v1/UsageProfilingResponse.md | 3 +- docs/v1/UsageReportsType.md | 3 +- docs/v1/UsageRumSessionsHour.md | 3 +- docs/v1/UsageRumSessionsResponse.md | 3 +- docs/v1/UsageSNMPHour.md | 3 +- docs/v1/UsageSNMPResponse.md | 3 +- docs/v1/UsageSort.md | 3 +- docs/v1/UsageSortDirection.md | 3 +- .../UsageSpecifiedCustomReportsAttributes.md | 3 +- docs/v1/UsageSpecifiedCustomReportsData.md | 3 +- docs/v1/UsageSpecifiedCustomReportsMeta.md | 3 +- docs/v1/UsageSpecifiedCustomReportsPage.md | 3 +- .../v1/UsageSpecifiedCustomReportsResponse.md | 3 +- docs/v1/UsageSummaryDate.md | 3 +- docs/v1/UsageSummaryDateOrg.md | 3 +- docs/v1/UsageSummaryResponse.md | 3 +- docs/v1/UsageSyntheticsAPIHour.md | 3 +- docs/v1/UsageSyntheticsAPIResponse.md | 3 +- docs/v1/UsageSyntheticsBrowserHour.md | 3 +- docs/v1/UsageSyntheticsBrowserResponse.md | 3 +- docs/v1/UsageSyntheticsHour.md | 3 +- docs/v1/UsageSyntheticsResponse.md | 3 +- docs/v1/UsageTimeseriesHour.md | 3 +- docs/v1/UsageTimeseriesResponse.md | 3 +- docs/v1/UsageTopAvgMetricsHour.md | 3 +- docs/v1/UsageTopAvgMetricsMetadata.md | 3 +- docs/v1/UsageTopAvgMetricsResponse.md | 3 +- docs/v1/User.md | 3 +- docs/v1/UserDisableResponse.md | 3 +- docs/v1/UserListResponse.md | 3 +- docs/v1/UserResponse.md | 3 +- docs/v1/UsersApi.md | 4 - docs/v1/Widget.md | 3 +- docs/v1/WidgetAggregator.md | 3 +- docs/v1/WidgetAxis.md | 3 +- docs/v1/WidgetChangeType.md | 3 +- docs/v1/WidgetColorPreference.md | 3 +- docs/v1/WidgetComparator.md | 3 +- docs/v1/WidgetCompareTo.md | 3 +- docs/v1/WidgetConditionalFormat.md | 3 +- docs/v1/WidgetCustomLink.md | 3 +- docs/v1/WidgetDefinition.md | 2 +- docs/v1/WidgetDisplayType.md | 3 +- docs/v1/WidgetEvent.md | 3 +- docs/v1/WidgetEventSize.md | 3 +- docs/v1/WidgetFieldSort.md | 3 +- docs/v1/WidgetFormula.md | 3 +- docs/v1/WidgetFormulaLimit.md | 3 +- docs/v1/WidgetGrouping.md | 3 +- docs/v1/WidgetHorizontalAlign.md | 3 +- docs/v1/WidgetImageSizing.md | 3 +- docs/v1/WidgetLayout.md | 3 +- docs/v1/WidgetLayoutType.md | 3 +- docs/v1/WidgetLineType.md | 3 +- docs/v1/WidgetLineWidth.md | 3 +- docs/v1/WidgetLiveSpan.md | 3 +- docs/v1/WidgetMargin.md | 3 +- docs/v1/WidgetMarker.md | 3 +- docs/v1/WidgetMessageDisplay.md | 3 +- docs/v1/WidgetMonitorSummaryDisplayFormat.md | 3 +- docs/v1/WidgetMonitorSummarySort.md | 3 +- docs/v1/WidgetNodeType.md | 3 +- docs/v1/WidgetOrderBy.md | 3 +- docs/v1/WidgetPalette.md | 3 +- docs/v1/WidgetRequestStyle.md | 3 +- docs/v1/WidgetServiceSummaryDisplayFormat.md | 3 +- docs/v1/WidgetSizeFormat.md | 3 +- docs/v1/WidgetSort.md | 3 +- docs/v1/WidgetStyle.md | 3 +- docs/v1/WidgetSummaryType.md | 3 +- docs/v1/WidgetTextAlign.md | 3 +- docs/v1/WidgetTickEdge.md | 3 +- docs/v1/WidgetTime.md | 3 +- docs/v1/WidgetTimeWindows.md | 3 +- docs/v1/WidgetVerticalAlign.md | 3 +- docs/v1/WidgetViewMode.md | 3 +- docs/v1/WidgetVizType.md | 3 +- docs/v2/APIErrorResponse.md | 3 +- docs/v2/APIKeyCreateAttributes.md | 3 +- docs/v2/APIKeyCreateData.md | 3 +- docs/v2/APIKeyCreateRequest.md | 3 +- docs/v2/APIKeyRelationships.md | 3 +- docs/v2/APIKeyResponse.md | 3 +- docs/v2/APIKeyResponseIncludedItem.md | 2 +- docs/v2/APIKeyUpdateAttributes.md | 3 +- docs/v2/APIKeyUpdateData.md | 3 +- docs/v2/APIKeyUpdateRequest.md | 3 +- docs/v2/APIKeysResponse.md | 3 +- docs/v2/APIKeysSort.md | 3 +- docs/v2/APIKeysType.md | 3 +- docs/v2/ApplicationKeyCreateAttributes.md | 3 +- docs/v2/ApplicationKeyCreateData.md | 3 +- docs/v2/ApplicationKeyCreateRequest.md | 3 +- docs/v2/ApplicationKeyRelationships.md | 3 +- docs/v2/ApplicationKeyResponse.md | 3 +- docs/v2/ApplicationKeyResponseIncludedItem.md | 2 +- docs/v2/ApplicationKeyUpdateAttributes.md | 3 +- docs/v2/ApplicationKeyUpdateData.md | 3 +- docs/v2/ApplicationKeyUpdateRequest.md | 3 +- docs/v2/ApplicationKeysSort.md | 3 +- docs/v2/ApplicationKeysType.md | 3 +- docs/v2/Creator.md | 3 +- docs/v2/DashboardListAddItemsRequest.md | 3 +- docs/v2/DashboardListAddItemsResponse.md | 3 +- docs/v2/DashboardListDeleteItemsRequest.md | 3 +- docs/v2/DashboardListDeleteItemsResponse.md | 3 +- docs/v2/DashboardListItem.md | 3 +- docs/v2/DashboardListItemRequest.md | 3 +- docs/v2/DashboardListItemResponse.md | 3 +- docs/v2/DashboardListItems.md | 3 +- docs/v2/DashboardListUpdateItemsRequest.md | 3 +- docs/v2/DashboardListUpdateItemsResponse.md | 3 +- docs/v2/DashboardType.md | 3 +- docs/v2/FullAPIKey.md | 3 +- docs/v2/FullAPIKeyAttributes.md | 3 +- docs/v2/FullApplicationKey.md | 3 +- docs/v2/FullApplicationKeyAttributes.md | 3 +- docs/v2/IncidentCreateAttributes.md | 3 +- docs/v2/IncidentCreateData.md | 3 +- docs/v2/IncidentCreateRelationships.md | 3 +- docs/v2/IncidentCreateRequest.md | 3 +- docs/v2/IncidentFieldAttributes.md | 2 +- .../IncidentFieldAttributesMultipleValue.md | 3 +- docs/v2/IncidentFieldAttributesSingleValue.md | 3 +- .../IncidentFieldAttributesSingleValueType.md | 3 +- docs/v2/IncidentFieldAttributesValueType.md | 3 +- docs/v2/IncidentIntegrationMetadataType.md | 3 +- docs/v2/IncidentPostmortemType.md | 3 +- docs/v2/IncidentRelatedObject.md | 3 +- docs/v2/IncidentResponse.md | 3 +- docs/v2/IncidentResponseAttributes.md | 3 +- docs/v2/IncidentResponseData.md | 3 +- docs/v2/IncidentResponseIncludedItem.md | 2 +- docs/v2/IncidentResponseRelationships.md | 3 +- docs/v2/IncidentServiceCreateAttributes.md | 3 +- docs/v2/IncidentServiceCreateData.md | 3 +- docs/v2/IncidentServiceCreateRequest.md | 3 +- docs/v2/IncidentServiceIncludedItems.md | 2 +- docs/v2/IncidentServiceRelationships.md | 3 +- docs/v2/IncidentServiceResponse.md | 3 +- docs/v2/IncidentServiceResponseAttributes.md | 3 +- docs/v2/IncidentServiceResponseData.md | 3 +- docs/v2/IncidentServiceType.md | 3 +- docs/v2/IncidentServiceUpdateAttributes.md | 3 +- docs/v2/IncidentServiceUpdateData.md | 3 +- docs/v2/IncidentServiceUpdateRequest.md | 3 +- docs/v2/IncidentServicesApi.md | 28 -- docs/v2/IncidentServicesResponse.md | 3 +- docs/v2/IncidentServicesResponseMeta.md | 3 +- .../IncidentServicesResponseMetaPagination.md | 3 +- docs/v2/IncidentTeamCreateAttributes.md | 3 +- docs/v2/IncidentTeamCreateData.md | 3 +- docs/v2/IncidentTeamCreateRequest.md | 3 +- docs/v2/IncidentTeamIncludedItems.md | 2 +- docs/v2/IncidentTeamRelationships.md | 3 +- docs/v2/IncidentTeamResponse.md | 3 +- docs/v2/IncidentTeamResponseAttributes.md | 3 +- docs/v2/IncidentTeamResponseData.md | 3 +- docs/v2/IncidentTeamType.md | 3 +- docs/v2/IncidentTeamUpdateAttributes.md | 3 +- docs/v2/IncidentTeamUpdateData.md | 3 +- docs/v2/IncidentTeamUpdateRequest.md | 3 +- docs/v2/IncidentTeamsApi.md | 28 -- docs/v2/IncidentTeamsResponse.md | 3 +- .../IncidentTimelineCellCreateAttributes.md | 2 +- ...IncidentTimelineCellMarkdownContentType.md | 3 +- ...entTimelineCellMarkdownCreateAttributes.md | 3 +- ...lineCellMarkdownCreateAttributesContent.md | 3 +- docs/v2/IncidentType.md | 3 +- docs/v2/IncidentUpdateAttributes.md | 3 +- docs/v2/IncidentUpdateData.md | 3 +- docs/v2/IncidentUpdateRelationships.md | 3 +- docs/v2/IncidentUpdateRequest.md | 3 +- docs/v2/IncidentsResponse.md | 3 +- docs/v2/ListApplicationKeysResponse.md | 3 +- docs/v2/Log.md | 3 +- docs/v2/LogAttributes.md | 3 +- docs/v2/LogType.md | 3 +- docs/v2/LogsAggregateBucket.md | 3 +- docs/v2/LogsAggregateBucketValue.md | 2 +- docs/v2/LogsAggregateBucketValueTimeseries.md | 3 +- ...LogsAggregateBucketValueTimeseriesPoint.md | 3 +- docs/v2/LogsAggregateRequest.md | 3 +- docs/v2/LogsAggregateRequestPage.md | 3 +- docs/v2/LogsAggregateResponse.md | 3 +- docs/v2/LogsAggregateResponseData.md | 3 +- docs/v2/LogsAggregateResponseStatus.md | 3 +- docs/v2/LogsAggregateSort.md | 3 +- docs/v2/LogsAggregateSortType.md | 3 +- docs/v2/LogsAggregationFunction.md | 3 +- docs/v2/LogsArchive.md | 3 +- docs/v2/LogsArchiveAttributes.md | 3 +- docs/v2/LogsArchiveCreateRequest.md | 3 +- docs/v2/LogsArchiveCreateRequestAttributes.md | 3 +- docs/v2/LogsArchiveCreateRequestDefinition.md | 3 +- .../v2/LogsArchiveCreateRequestDestination.md | 2 +- docs/v2/LogsArchiveDefinition.md | 3 +- docs/v2/LogsArchiveDestination.md | 2 +- docs/v2/LogsArchiveDestinationAzure.md | 3 +- docs/v2/LogsArchiveDestinationAzureType.md | 3 +- docs/v2/LogsArchiveDestinationGCS.md | 3 +- docs/v2/LogsArchiveDestinationGCSType.md | 3 +- docs/v2/LogsArchiveDestinationS3.md | 3 +- docs/v2/LogsArchiveDestinationS3Type.md | 3 +- docs/v2/LogsArchiveIntegrationAzure.md | 3 +- docs/v2/LogsArchiveIntegrationGCS.md | 3 +- docs/v2/LogsArchiveIntegrationS3.md | 3 +- docs/v2/LogsArchiveOrder.md | 3 +- docs/v2/LogsArchiveOrderAttributes.md | 3 +- docs/v2/LogsArchiveOrderDefinition.md | 3 +- docs/v2/LogsArchiveOrderDefinitionType.md | 3 +- docs/v2/LogsArchiveState.md | 3 +- docs/v2/LogsArchives.md | 3 +- docs/v2/LogsCompute.md | 3 +- docs/v2/LogsComputeType.md | 3 +- docs/v2/LogsGroupBy.md | 3 +- docs/v2/LogsGroupByHistogram.md | 3 +- docs/v2/LogsGroupByMissing.md | 2 +- docs/v2/LogsGroupByTotal.md | 2 +- docs/v2/LogsListRequest.md | 3 +- docs/v2/LogsListRequestPage.md | 3 +- docs/v2/LogsListResponse.md | 3 +- docs/v2/LogsListResponseLinks.md | 3 +- docs/v2/LogsMetricCompute.md | 3 +- docs/v2/LogsMetricComputeAggregationType.md | 3 +- docs/v2/LogsMetricCreateAttributes.md | 3 +- docs/v2/LogsMetricCreateData.md | 3 +- docs/v2/LogsMetricCreateRequest.md | 3 +- docs/v2/LogsMetricFilter.md | 3 +- docs/v2/LogsMetricGroupBy.md | 3 +- docs/v2/LogsMetricResponse.md | 3 +- docs/v2/LogsMetricResponseAttributes.md | 3 +- docs/v2/LogsMetricResponseCompute.md | 3 +- ...ogsMetricResponseComputeAggregationType.md | 3 +- docs/v2/LogsMetricResponseData.md | 3 +- docs/v2/LogsMetricResponseFilter.md | 3 +- docs/v2/LogsMetricResponseGroupBy.md | 3 +- docs/v2/LogsMetricType.md | 3 +- docs/v2/LogsMetricUpdateAttributes.md | 3 +- docs/v2/LogsMetricUpdateData.md | 3 +- docs/v2/LogsMetricUpdateRequest.md | 3 +- docs/v2/LogsMetricsResponse.md | 3 +- docs/v2/LogsQueryFilter.md | 3 +- docs/v2/LogsQueryOptions.md | 3 +- docs/v2/LogsResponseMetadata.md | 3 +- docs/v2/LogsResponseMetadataPage.md | 3 +- docs/v2/LogsSort.md | 3 +- docs/v2/LogsSortOrder.md | 3 +- docs/v2/LogsWarning.md | 3 +- docs/v2/Metric.md | 3 +- docs/v2/MetricAllTags.md | 3 +- docs/v2/MetricAllTagsAttributes.md | 3 +- docs/v2/MetricAllTagsResponse.md | 3 +- docs/v2/MetricDistinctVolume.md | 3 +- docs/v2/MetricDistinctVolumeAttributes.md | 3 +- docs/v2/MetricDistinctVolumeType.md | 3 +- docs/v2/MetricIngestedIndexedVolume.md | 3 +- .../MetricIngestedIndexedVolumeAttributes.md | 3 +- docs/v2/MetricIngestedIndexedVolumeType.md | 3 +- docs/v2/MetricTagConfiguration.md | 3 +- docs/v2/MetricTagConfigurationAttributes.md | 3 +- .../MetricTagConfigurationCreateAttributes.md | 3 +- docs/v2/MetricTagConfigurationCreateData.md | 3 +- .../v2/MetricTagConfigurationCreateRequest.md | 3 +- docs/v2/MetricTagConfigurationMetricTypes.md | 3 +- docs/v2/MetricTagConfigurationResponse.md | 3 +- docs/v2/MetricTagConfigurationType.md | 3 +- .../MetricTagConfigurationUpdateAttributes.md | 3 +- docs/v2/MetricTagConfigurationUpdateData.md | 3 +- .../v2/MetricTagConfigurationUpdateRequest.md | 3 +- docs/v2/MetricType.md | 3 +- docs/v2/MetricVolumes.md | 2 +- docs/v2/MetricVolumesResponse.md | 3 +- docs/v2/MetricsAndMetricTagConfigurations.md | 2 +- ...tricsAndMetricTagConfigurationsResponse.md | 3 +- docs/v2/Organization.md | 3 +- docs/v2/OrganizationAttributes.md | 3 +- docs/v2/OrganizationsType.md | 3 +- docs/v2/Pagination.md | 3 +- docs/v2/PartialAPIKey.md | 3 +- docs/v2/PartialAPIKeyAttributes.md | 3 +- docs/v2/PartialApplicationKey.md | 3 +- docs/v2/PartialApplicationKeyAttributes.md | 3 +- docs/v2/Permission.md | 3 +- docs/v2/PermissionAttributes.md | 3 +- docs/v2/PermissionsResponse.md | 3 +- docs/v2/PermissionsType.md | 3 +- docs/v2/ProcessSummariesMeta.md | 3 +- docs/v2/ProcessSummariesMetaPage.md | 3 +- docs/v2/ProcessSummariesResponse.md | 3 +- docs/v2/ProcessSummary.md | 3 +- docs/v2/ProcessSummaryAttributes.md | 3 +- docs/v2/ProcessSummaryType.md | 3 +- docs/v2/QuerySortOrder.md | 3 +- ...onshipToIncidentIntegrationMetadataData.md | 3 +- ...ationshipToIncidentIntegrationMetadatas.md | 3 +- docs/v2/RelationshipToIncidentPostmortem.md | 3 +- .../RelationshipToIncidentPostmortemData.md | 3 +- docs/v2/RelationshipToOrganization.md | 3 +- docs/v2/RelationshipToOrganizationData.md | 3 +- docs/v2/RelationshipToOrganizations.md | 3 +- docs/v2/RelationshipToPermission.md | 3 +- docs/v2/RelationshipToPermissionData.md | 3 +- docs/v2/RelationshipToPermissions.md | 3 +- docs/v2/RelationshipToRole.md | 3 +- docs/v2/RelationshipToRoleData.md | 3 +- docs/v2/RelationshipToRoles.md | 3 +- docs/v2/RelationshipToUser.md | 3 +- docs/v2/RelationshipToUserData.md | 3 +- docs/v2/RelationshipToUsers.md | 3 +- docs/v2/ResponseMetaAttributes.md | 3 +- docs/v2/Role.md | 3 +- docs/v2/RoleAttributes.md | 3 +- docs/v2/RoleCreateAttributes.md | 3 +- docs/v2/RoleCreateData.md | 3 +- docs/v2/RoleCreateRequest.md | 3 +- docs/v2/RoleCreateResponse.md | 3 +- docs/v2/RoleCreateResponseData.md | 3 +- docs/v2/RoleRelationships.md | 3 +- docs/v2/RoleResponse.md | 3 +- docs/v2/RoleResponseRelationships.md | 3 +- docs/v2/RoleUpdateAttributes.md | 3 +- docs/v2/RoleUpdateData.md | 3 +- docs/v2/RoleUpdateRequest.md | 3 +- docs/v2/RoleUpdateResponse.md | 3 +- docs/v2/RoleUpdateResponseData.md | 3 +- docs/v2/RolesApi.md | 4 - docs/v2/RolesResponse.md | 3 +- docs/v2/RolesSort.md | 3 +- docs/v2/RolesType.md | 3 +- docs/v2/SecurityFilter.md | 3 +- docs/v2/SecurityFilterAttributes.md | 3 +- docs/v2/SecurityFilterCreateAttributes.md | 3 +- docs/v2/SecurityFilterCreateData.md | 3 +- docs/v2/SecurityFilterCreateRequest.md | 3 +- docs/v2/SecurityFilterExclusionFilter.md | 3 +- .../SecurityFilterExclusionFilterResponse.md | 3 +- docs/v2/SecurityFilterFilteredDataType.md | 3 +- docs/v2/SecurityFilterMeta.md | 3 +- docs/v2/SecurityFilterResponse.md | 3 +- docs/v2/SecurityFilterType.md | 3 +- docs/v2/SecurityFilterUpdateAttributes.md | 3 +- docs/v2/SecurityFilterUpdateData.md | 3 +- docs/v2/SecurityFilterUpdateRequest.md | 3 +- docs/v2/SecurityFiltersResponse.md | 3 +- docs/v2/SecurityMonitoringFilter.md | 3 +- docs/v2/SecurityMonitoringFilterAction.md | 3 +- .../v2/SecurityMonitoringListRulesResponse.md | 3 +- docs/v2/SecurityMonitoringRuleCase.md | 3 +- docs/v2/SecurityMonitoringRuleCaseCreate.md | 3 +- .../v2/SecurityMonitoringRuleCreatePayload.md | 3 +- .../SecurityMonitoringRuleDetectionMethod.md | 3 +- .../SecurityMonitoringRuleEvaluationWindow.md | 3 +- docs/v2/SecurityMonitoringRuleKeepAlive.md | 3 +- ...SecurityMonitoringRuleMaxSignalDuration.md | 3 +- .../SecurityMonitoringRuleNewValueOptions.md | 3 +- ...onitoringRuleNewValueOptionsForgetAfter.md | 3 +- ...ringRuleNewValueOptionsLearningDuration.md | 3 +- docs/v2/SecurityMonitoringRuleOptions.md | 3 +- docs/v2/SecurityMonitoringRuleQuery.md | 3 +- .../SecurityMonitoringRuleQueryAggregation.md | 3 +- docs/v2/SecurityMonitoringRuleQueryCreate.md | 3 +- docs/v2/SecurityMonitoringRuleResponse.md | 3 +- docs/v2/SecurityMonitoringRuleSeverity.md | 3 +- .../v2/SecurityMonitoringRuleUpdatePayload.md | 3 +- docs/v2/SecurityMonitoringRuntimeAgentRule.md | 3 +- docs/v2/SecurityMonitoringSignal.md | 3 +- docs/v2/SecurityMonitoringSignalAttributes.md | 3 +- .../v2/SecurityMonitoringSignalListRequest.md | 3 +- ...curityMonitoringSignalListRequestFilter.md | 3 +- ...SecurityMonitoringSignalListRequestPage.md | 3 +- docs/v2/SecurityMonitoringSignalType.md | 3 +- .../SecurityMonitoringSignalsListResponse.md | 3 +- ...urityMonitoringSignalsListResponseLinks.md | 3 +- ...curityMonitoringSignalsListResponseMeta.md | 3 +- ...tyMonitoringSignalsListResponseMetaPage.md | 3 +- docs/v2/SecurityMonitoringSignalsSort.md | 3 +- docs/v2/User.md | 3 +- docs/v2/UserAttributes.md | 3 +- docs/v2/UserCreateAttributes.md | 3 +- docs/v2/UserCreateData.md | 3 +- docs/v2/UserCreateRequest.md | 3 +- docs/v2/UserInvitationData.md | 3 +- docs/v2/UserInvitationDataAttributes.md | 3 +- docs/v2/UserInvitationRelationships.md | 3 +- docs/v2/UserInvitationResponse.md | 3 +- docs/v2/UserInvitationResponseData.md | 3 +- docs/v2/UserInvitationsRequest.md | 3 +- docs/v2/UserInvitationsResponse.md | 3 +- docs/v2/UserInvitationsType.md | 3 +- docs/v2/UserRelationships.md | 3 +- docs/v2/UserResponse.md | 3 +- docs/v2/UserResponseIncludedItem.md | 2 +- docs/v2/UserResponseRelationships.md | 3 +- docs/v2/UserUpdateAttributes.md | 3 +- docs/v2/UserUpdateData.md | 3 +- docs/v2/UserUpdateRequest.md | 3 +- docs/v2/UsersResponse.md | 3 +- docs/v2/UsersType.md | 3 +- src/datadog_api_client/v1/api_client.py | 6 +- .../v1/model/access_role.py | 114 ++++- .../v1/model/alert_graph_widget_definition.py | 114 ++++- .../alert_graph_widget_definition_type.py | 114 ++++- .../v1/model/alert_value_widget_definition.py | 114 ++++- .../alert_value_widget_definition_type.py | 114 ++++- .../v1/model/api_error_response.py | 105 ++++- src/datadog_api_client/v1/model/api_key.py | 105 ++++- .../v1/model/api_key_list_response.py | 103 ++++- .../v1/model/api_key_response.py | 103 ++++- .../v1/model/apm_stats_query_column_type.py | 109 ++++- .../v1/model/apm_stats_query_definition.py | 116 ++++- .../v1/model/apm_stats_query_row_type.py | 118 ++++- .../v1/model/application_key.py | 104 ++++- .../v1/model/application_key_list_response.py | 103 ++++- .../v1/model/application_key_response.py | 103 ++++- .../authentication_validation_response.py | 102 ++++- .../v1/model/aws_account.py | 109 ++++- .../model/aws_account_and_lambda_request.py | 107 ++++- .../v1/model/aws_account_create_response.py | 102 ++++- .../v1/model/aws_account_delete_request.py | 104 ++++- .../v1/model/aws_account_list_response.py | 103 ++++- .../v1/model/aws_logs_async_error.py | 103 ++++- .../v1/model/aws_logs_async_response.py | 104 ++++- .../v1/model/aws_logs_lambda.py | 102 ++++- .../v1/model/aws_logs_list_response.py | 105 ++++- .../model/aws_logs_list_services_response.py | 103 ++++- .../v1/model/aws_logs_services_request.py | 107 ++++- .../v1/model/aws_namespace.py | 118 ++++- .../v1/model/aws_tag_filter.py | 104 ++++- .../v1/model/aws_tag_filter_create_request.py | 105 ++++- .../v1/model/aws_tag_filter_delete_request.py | 104 ++++- .../v1/model/aws_tag_filter_list_response.py | 103 ++++- .../v1/model/azure_account.py | 108 ++++- .../v1/model/azure_account_list_response.py | 112 ++++- .../cancel_downtimes_by_scope_request.py | 105 ++++- .../v1/model/canceled_downtimes_ids.py | 102 ++++- .../v1/model/change_widget_definition.py | 113 ++++- .../v1/model/change_widget_definition_type.py | 114 ++++- .../v1/model/change_widget_request.py | 117 ++++- .../check_can_delete_monitor_response.py | 107 ++++- .../check_can_delete_monitor_response_data.py | 102 ++++- .../v1/model/check_can_delete_slo_response.py | 104 ++++- .../check_can_delete_slo_response_data.py | 102 ++++- .../model/check_status_widget_definition.py | 117 ++++- .../check_status_widget_definition_type.py | 114 ++++- .../v1/model/content_encoding.py | 118 ++++- src/datadog_api_client/v1/model/creator.py | 104 ++++- src/datadog_api_client/v1/model/dashboard.py | 122 ++++- .../v1/model/dashboard_bulk_action_data.py | 108 ++++- .../model/dashboard_bulk_action_data_list.py | 112 ++++- .../v1/model/dashboard_bulk_delete_request.py | 106 ++++- .../v1/model/dashboard_delete_response.py | 102 ++++- .../v1/model/dashboard_layout_type.py | 118 ++++- .../v1/model/dashboard_list.py | 113 ++++- .../model/dashboard_list_delete_response.py | 102 ++++- .../v1/model/dashboard_list_list_response.py | 103 ++++- .../v1/model/dashboard_reflow_type.py | 118 ++++- .../v1/model/dashboard_resource_type.py | 114 ++++- .../v1/model/dashboard_restore_request.py | 106 ++++- .../v1/model/dashboard_summary.py | 103 ++++- .../v1/model/dashboard_summary_definition.py | 111 ++++- .../v1/model/dashboard_template_variable.py | 107 ++++- .../dashboard_template_variable_preset.py | 104 ++++- ...ashboard_template_variable_preset_value.py | 103 ++++- .../v1/model/deleted_monitor.py | 102 ++++- .../model/distribution_widget_definition.py | 117 ++++- .../distribution_widget_definition_type.py | 114 ++++- .../v1/model/distribution_widget_request.py | 112 ++++- .../v1/model/distribution_widget_x_axis.py | 105 ++++- .../v1/model/distribution_widget_y_axis.py | 106 ++++- src/datadog_api_client/v1/model/downtime.py | 119 ++++- .../v1/model/downtime_child.py | 118 ++++- .../v1/model/downtime_recurrence.py | 107 ++++- src/datadog_api_client/v1/model/event.py | 114 ++++- .../v1/model/event_alert_type.py | 118 ++++- .../v1/model/event_create_request.py | 120 ++++- .../v1/model/event_create_response.py | 116 ++++- .../v1/model/event_list_response.py | 104 ++++- .../v1/model/event_priority.py | 118 ++++- .../v1/model/event_query_definition.py | 107 ++++- .../v1/model/event_response.py | 104 ++++- .../model/event_stream_widget_definition.py | 114 ++++- .../event_stream_widget_definition_type.py | 114 ++++- .../model/event_timeline_widget_definition.py | 113 ++++- .../event_timeline_widget_definition_type.py | 114 ++++- .../formula_and_function_event_aggregation.py | 118 ++++- ...ula_and_function_event_query_definition.py | 113 ++++- ...function_event_query_definition_compute.py | 108 ++++- ..._function_event_query_definition_search.py | 105 ++++- ...rmula_and_function_event_query_group_by.py | 108 ++++- ..._and_function_event_query_group_by_sort.py | 108 ++++- ...formula_and_function_events_data_source.py | 118 ++++- ...formula_and_function_metric_aggregation.py | 118 ++++- ...formula_and_function_metric_data_source.py | 114 ++++- ...la_and_function_metric_query_definition.py | 111 ++++- ..._and_function_process_query_data_source.py | 118 ++++- ...a_and_function_process_query_definition.py | 116 ++++- .../formula_and_function_query_definition.py | 125 +++++- .../formula_and_function_response_format.py | 118 ++++- .../v1/model/free_text_widget_definition.py | 111 ++++- .../model/free_text_widget_definition_type.py | 114 ++++- .../v1/model/gcp_account.py | 114 ++++- .../v1/model/gcp_account_list_response.py | 112 ++++- .../v1/model/geomap_widget_definition.py | 117 ++++- .../model/geomap_widget_definition_style.py | 107 ++++- .../v1/model/geomap_widget_definition_type.py | 114 ++++- .../v1/model/geomap_widget_definition_view.py | 105 ++++- .../v1/model/geomap_widget_request.py | 109 ++++- .../v1/model/graph_snapshot.py | 104 ++++- .../v1/model/group_widget_definition.py | 115 ++++- .../v1/model/group_widget_definition_type.py | 114 ++++- .../v1/model/heat_map_widget_definition.py | 117 ++++- .../model/heat_map_widget_definition_type.py | 114 ++++- .../v1/model/heat_map_widget_request.py | 112 ++++- src/datadog_api_client/v1/model/host.py | 116 ++++- .../v1/model/host_list_response.py | 105 ++++- .../v1/model/host_map_request.py | 111 ++++- .../v1/model/host_map_widget_definition.py | 119 ++++- .../host_map_widget_definition_requests.py | 104 ++++- .../model/host_map_widget_definition_style.py | 105 ++++- .../model/host_map_widget_definition_type.py | 114 ++++- src/datadog_api_client/v1/model/host_meta.py | 102 ++++- .../v1/model/host_metrics.py | 104 ++++- .../v1/model/host_mute_response.py | 105 ++++- .../v1/model/host_mute_settings.py | 104 ++++- src/datadog_api_client/v1/model/host_tags.py | 103 ++++- .../v1/model/host_totals.py | 103 ++++- src/datadog_api_client/v1/model/http_log.py | 112 ++++- .../v1/model/http_log_error.py | 107 ++++- .../v1/model/http_log_item.py | 106 ++++- .../v1/model/http_method.py | 118 ++++- .../v1/model/i_frame_widget_definition.py | 108 ++++- .../model/i_frame_widget_definition_type.py | 114 ++++- .../v1/model/idp_form_data.py | 105 ++++- .../v1/model/idp_response.py | 105 ++++- .../v1/model/image_widget_definition.py | 115 ++++- .../v1/model/image_widget_definition_type.py | 114 ++++- .../v1/model/intake_payload_accepted.py | 102 ++++- .../v1/model/ip_prefixes_agents.py | 103 ++++- .../v1/model/ip_prefixes_api.py | 103 ++++- .../v1/model/ip_prefixes_apm.py | 103 ++++- .../v1/model/ip_prefixes_logs.py | 103 ++++- .../v1/model/ip_prefixes_process.py | 103 ++++- .../v1/model/ip_prefixes_synthetics.py | 105 ++++- .../v1/model/ip_prefixes_webhooks.py | 103 ++++- src/datadog_api_client/v1/model/ip_ranges.py | 111 ++++- .../v1/model/list_stream_column.py | 108 ++++- .../v1/model/list_stream_column_width.py | 118 ++++- .../v1/model/list_stream_query.py | 109 ++++- .../v1/model/list_stream_response_format.py | 114 ++++- .../v1/model/list_stream_source.py | 114 ++++- .../v1/model/list_stream_widget_definition.py | 114 ++++- .../list_stream_widget_definition_type.py | 114 ++++- .../v1/model/list_stream_widget_request.py | 110 ++++- src/datadog_api_client/v1/model/log.py | 104 ++++- .../v1/model/log_content.py | 107 ++++- .../v1/model/log_query_definition.py | 107 ++++- .../v1/model/log_query_definition_group_by.py | 108 ++++- .../log_query_definition_group_by_sort.py | 109 ++++- .../v1/model/log_query_definition_search.py | 105 ++++- .../v1/model/log_stream_widget_definition.py | 118 ++++- .../log_stream_widget_definition_type.py | 114 ++++- .../v1/model/logs_api_error.py | 104 ++++- .../v1/model/logs_api_error_response.py | 103 ++++- .../v1/model/logs_arithmetic_processor.py | 113 ++++- .../model/logs_arithmetic_processor_type.py | 114 ++++- .../v1/model/logs_attribute_remapper.py | 117 ++++- .../v1/model/logs_attribute_remapper_type.py | 114 ++++- .../v1/model/logs_by_retention.py | 105 ++++- .../model/logs_by_retention_monthly_usage.py | 104 ++++- .../v1/model/logs_by_retention_org_usage.py | 103 ++++- .../v1/model/logs_by_retention_orgs.py | 103 ++++- .../v1/model/logs_category_processor.py | 112 ++++- .../model/logs_category_processor_category.py | 104 ++++- .../v1/model/logs_category_processor_type.py | 114 ++++- .../v1/model/logs_date_remapper.py | 110 ++++- .../v1/model/logs_date_remapper_type.py | 114 ++++- .../v1/model/logs_exclusion.py | 108 ++++- .../v1/model/logs_exclusion_filter.py | 106 ++++- .../v1/model/logs_filter.py | 102 ++++- .../v1/model/logs_geo_ip_parser.py | 114 ++++- .../v1/model/logs_geo_ip_parser_type.py | 114 ++++- .../v1/model/logs_grok_parser.py | 114 ++++- .../v1/model/logs_grok_parser_rules.py | 106 ++++- .../v1/model/logs_grok_parser_type.py | 114 ++++- src/datadog_api_client/v1/model/logs_index.py | 112 ++++- .../v1/model/logs_index_list_response.py | 103 ++++- .../v1/model/logs_index_update_request.py | 110 ++++- .../v1/model/logs_indexes_order.py | 105 ++++- .../v1/model/logs_list_request.py | 111 ++++- .../v1/model/logs_list_request_time.py | 108 ++++- .../v1/model/logs_list_response.py | 105 ++++- .../v1/model/logs_lookup_processor.py | 115 ++++- .../v1/model/logs_lookup_processor_type.py | 114 ++++- .../v1/model/logs_message_remapper.py | 111 ++++- .../v1/model/logs_message_remapper_type.py | 114 ++++- .../v1/model/logs_pipeline.py | 112 ++++- .../v1/model/logs_pipeline_list.py | 112 ++++- .../v1/model/logs_pipeline_processor.py | 110 ++++- .../v1/model/logs_pipeline_processor_type.py | 114 ++++- .../v1/model/logs_pipelines_order.py | 105 ++++- .../v1/model/logs_processor.py | 134 +++++- .../v1/model/logs_query_compute.py | 107 ++++- .../v1/model/logs_retention_agg_sum_usage.py | 105 ++++- .../v1/model/logs_retention_sum_usage.py | 105 ++++- .../v1/model/logs_service_remapper.py | 110 ++++- .../v1/model/logs_service_remapper_type.py | 114 ++++- src/datadog_api_client/v1/model/logs_sort.py | 118 ++++- .../v1/model/logs_status_remapper.py | 110 ++++- .../v1/model/logs_status_remapper_type.py | 114 ++++- .../v1/model/logs_string_builder_processor.py | 113 ++++- .../logs_string_builder_processor_type.py | 114 ++++- .../v1/model/logs_trace_remapper.py | 109 ++++- .../v1/model/logs_trace_remapper_type.py | 114 ++++- .../v1/model/logs_url_parser.py | 115 ++++- .../v1/model/logs_url_parser_type.py | 114 ++++- .../v1/model/logs_user_agent_parser.py | 115 ++++- .../v1/model/logs_user_agent_parser_type.py | 114 ++++- .../v1/model/metric_metadata.py | 108 ++++- .../v1/model/metric_search_response.py | 103 ++++- .../model/metric_search_response_results.py | 102 ++++- .../v1/model/metrics_list_response.py | 103 ++++- .../v1/model/metrics_payload.py | 106 ++++- .../v1/model/metrics_query_metadata.py | 115 ++++- .../v1/model/metrics_query_response.py | 111 ++++- .../v1/model/metrics_query_unit.py | 106 ++++- src/datadog_api_client/v1/model/monitor.py | 122 ++++- .../v1/model/monitor_device_id.py | 118 ++++- .../v1/model/monitor_group_search_response.py | 105 ++++- .../monitor_group_search_response_counts.py | 104 ++++- .../v1/model/monitor_group_search_result.py | 109 ++++- .../v1/model/monitor_options.py | 123 ++++- .../v1/model/monitor_options_aggregation.py | 104 ++++- .../v1/model/monitor_overall_states.py | 118 ++++- .../v1/model/monitor_search_count.py | 111 ++++- .../v1/model/monitor_search_response.py | 105 ++++- .../model/monitor_search_response_counts.py | 106 ++++- .../model/monitor_search_response_metadata.py | 105 ++++- .../v1/model/monitor_search_result.py | 114 ++++- .../monitor_search_result_notification.py | 103 ++++- .../v1/model/monitor_state.py | 103 ++++- .../v1/model/monitor_state_group.py | 108 ++++- .../monitor_summary_widget_definition.py | 119 ++++- .../monitor_summary_widget_definition_type.py | 114 ++++- .../model/monitor_threshold_window_options.py | 103 ++++- .../v1/model/monitor_thresholds.py | 107 ++++- .../v1/model/monitor_type.py | 118 ++++- .../v1/model/monitor_update_request.py | 118 ++++- .../v1/model/note_widget_definition.py | 116 ++++- .../v1/model/note_widget_definition_type.py | 114 ++++- .../v1/model/notebook_absolute_time.py | 108 ++++- .../v1/model/notebook_author.py | 110 ++++- .../v1/model/notebook_cell_create_request.py | 108 ++++- ...notebook_cell_create_request_attributes.py | 115 ++++- .../v1/model/notebook_cell_resource_type.py | 114 ++++- .../v1/model/notebook_cell_response.py | 110 ++++- .../notebook_cell_response_attributes.py | 115 ++++- .../v1/model/notebook_cell_time.py | 115 ++++- .../v1/model/notebook_cell_update_request.py | 110 ++++- ...notebook_cell_update_request_attributes.py | 115 ++++- .../v1/model/notebook_create_data.py | 108 ++++- .../model/notebook_create_data_attributes.py | 111 ++++- .../v1/model/notebook_create_request.py | 106 ++++- .../notebook_distribution_cell_attributes.py | 109 ++++- .../v1/model/notebook_global_time.py | 115 ++++- .../v1/model/notebook_graph_size.py | 118 ++++- .../notebook_heat_map_cell_attributes.py | 109 ++++- .../notebook_log_stream_cell_attributes.py | 108 ++++- .../notebook_markdown_cell_attributes.py | 106 ++++- .../notebook_markdown_cell_definition.py | 108 ++++- .../notebook_markdown_cell_definition_type.py | 114 ++++- .../v1/model/notebook_relative_time.py | 106 ++++- .../v1/model/notebook_resource_type.py | 114 ++++- .../v1/model/notebook_response.py | 103 ++++- .../v1/model/notebook_response_data.py | 114 ++++- .../notebook_response_data_attributes.py | 114 ++++- .../v1/model/notebook_split_by.py | 107 ++++- .../v1/model/notebook_status.py | 114 ++++- .../notebook_timeseries_cell_attributes.py | 109 ++++- .../model/notebook_toplist_cell_attributes.py | 109 ++++- .../v1/model/notebook_update_cell.py | 114 ++++- .../v1/model/notebook_update_data.py | 108 ++++- .../model/notebook_update_data_attributes.py | 111 ++++- .../v1/model/notebook_update_request.py | 106 ++++- .../v1/model/notebooks_response.py | 104 ++++- .../v1/model/notebooks_response_data.py | 114 ++++- .../notebooks_response_data_attributes.py | 112 ++++- .../v1/model/notebooks_response_meta.py | 103 ++++- .../v1/model/notebooks_response_page.py | 103 ++++- .../v1/model/organization.py | 109 ++++- .../v1/model/organization_billing.py | 102 ++++- .../v1/model/organization_create_body.py | 108 ++++- .../v1/model/organization_create_response.py | 106 ++++- .../v1/model/organization_list_response.py | 103 ++++- .../v1/model/organization_response.py | 103 ++++- .../v1/model/organization_settings.py | 112 ++++- .../v1/model/organization_settings_saml.py | 102 ++++- ..._settings_saml_autocreate_users_domains.py | 103 ++++- ...ation_settings_saml_idp_initiated_login.py | 102 ++++- .../organization_settings_saml_strict_mode.py | 102 ++++- .../v1/model/organization_subscription.py | 102 ++++- .../v1/model/pager_duty_service.py | 107 ++++- .../v1/model/pager_duty_service_key.py | 105 ++++- .../v1/model/pager_duty_service_name.py | 105 ++++- src/datadog_api_client/v1/model/pagination.py | 103 ++++- src/datadog_api_client/v1/model/point.py | 111 ++++- .../v1/model/process_query_definition.py | 108 ++++- .../v1/model/query_sort_order.py | 114 ++++- .../v1/model/query_value_widget_definition.py | 117 ++++- .../query_value_widget_definition_type.py | 114 ++++- .../v1/model/query_value_widget_request.py | 117 ++++- .../v1/model/response_meta_attributes.py | 103 ++++- .../v1/model/scatter_plot_request.py | 112 ++++- .../model/scatter_plot_widget_definition.py | 116 ++++- ...scatter_plot_widget_definition_requests.py | 108 ++++- .../scatter_plot_widget_definition_type.py | 114 ++++- src/datadog_api_client/v1/model/series.py | 112 ++++- .../v1/model/service_check.py | 114 ++++- .../v1/model/service_check_status.py | 118 ++++- .../v1/model/service_checks.py | 112 ++++- .../v1/model/service_level_objective.py | 120 ++++- .../v1/model/service_level_objective_query.py | 107 ++++- .../model/service_level_objective_request.py | 115 ++++- .../v1/model/service_map_widget_definition.py | 114 ++++- .../service_map_widget_definition_type.py | 114 ++++- .../service_summary_widget_definition.py | 124 ++++- .../service_summary_widget_definition_type.py | 114 ++++- .../v1/model/slack_integration_channel.py | 104 ++++- .../slack_integration_channel_display.py | 105 ++++- .../v1/model/slack_integration_channels.py | 112 ++++- .../v1/model/slo_bulk_delete.py | 83 ++++ .../v1/model/slo_bulk_delete_error.py | 110 ++++- .../v1/model/slo_bulk_delete_response.py | 104 ++++- .../v1/model/slo_bulk_delete_response_data.py | 103 ++++- .../v1/model/slo_correction.py | 105 ++++- .../v1/model/slo_correction_category.py | 118 ++++- .../v1/model/slo_correction_create_data.py | 104 ++++- .../v1/model/slo_correction_create_request.py | 103 ++++- ...lo_correction_create_request_attributes.py | 114 ++++- .../v1/model/slo_correction_list_response.py | 104 ++++- .../v1/model/slo_correction_response.py | 103 ++++- .../slo_correction_response_attributes.py | 109 ++++- .../v1/model/slo_correction_type.py | 114 ++++- .../v1/model/slo_correction_update_data.py | 104 ++++- .../v1/model/slo_correction_update_request.py | 103 ++++- ...lo_correction_update_request_attributes.py | 107 ++++- .../v1/model/slo_delete_response.py | 103 ++++- .../model/slo_error_budget_remaining_data.py | 83 ++++ .../v1/model/slo_error_timeframe.py | 118 ++++- .../v1/model/slo_history_metrics.py | 121 ++++- .../v1/model/slo_history_metrics_series.py | 112 ++++- .../slo_history_metrics_series_metadata.py | 108 ++++- ...lo_history_metrics_series_metadata_unit.py | 107 ++++- .../v1/model/slo_history_response.py | 104 ++++- .../v1/model/slo_history_response_data.py | 112 ++++- .../v1/model/slo_history_response_error.py | 102 ++++- .../v1/model/slo_history_sli_data.py | 114 ++++- .../v1/model/slo_list_response.py | 105 ++++- .../v1/model/slo_list_response_metadata.py | 103 ++++- .../model/slo_list_response_metadata_page.py | 103 ++++- .../v1/model/slo_response.py | 104 ++++- .../v1/model/slo_response_data.py | 116 ++++- .../v1/model/slo_threshold.py | 111 ++++- .../v1/model/slo_timeframe.py | 118 ++++- src/datadog_api_client/v1/model/slo_type.py | 118 ++++- .../v1/model/slo_type_numeric.py | 118 ++++- .../v1/model/slo_widget_definition.py | 117 ++++- .../v1/model/slo_widget_definition_type.py | 114 ++++- .../v1/model/synthetics_api_step.py | 109 ++++- .../v1/model/synthetics_api_step_subtype.py | 114 ++++- .../v1/model/synthetics_api_test.py | 113 ++++- .../v1/model/synthetics_api_test_config.py | 106 ++++- .../model/synthetics_api_test_result_data.py | 112 ++++- .../model/synthetics_api_test_result_full.py | 109 ++++- .../synthetics_api_test_result_full_check.py | 106 ++++- .../model/synthetics_api_test_result_short.py | 107 ++++- ...synthetics_api_test_result_short_result.py | 104 ++++- .../v1/model/synthetics_api_test_type.py | 114 ++++- .../v1/model/synthetics_assertion.py | 115 ++++- ...synthetics_assertion_json_path_operator.py | 114 ++++- .../synthetics_assertion_json_path_target.py | 110 ++++- ...etics_assertion_json_path_target_target.py | 104 ++++- .../v1/model/synthetics_assertion_operator.py | 118 ++++- .../v1/model/synthetics_assertion_target.py | 113 ++++- .../v1/model/synthetics_assertion_type.py | 118 ++++- .../v1/model/synthetics_basic_auth.py | 107 ++++- .../v1/model/synthetics_browser_error.py | 111 ++++- .../v1/model/synthetics_browser_error_type.py | 118 ++++- .../v1/model/synthetics_browser_test.py | 116 ++++- .../model/synthetics_browser_test_config.py | 111 ++++- .../synthetics_browser_test_result_data.py | 113 ++++- .../synthetics_browser_test_result_full.py | 109 ++++- ...nthetics_browser_test_result_full_check.py | 106 ++++- .../synthetics_browser_test_result_short.py | 107 ++++- ...hetics_browser_test_result_short_result.py | 107 ++++- .../v1/model/synthetics_browser_test_type.py | 114 ++++- .../v1/model/synthetics_browser_variable.py | 111 ++++- .../model/synthetics_browser_variable_type.py | 118 ++++- .../v1/model/synthetics_check_type.py | 118 ++++- .../v1/model/synthetics_ci_test.py | 119 ++++- .../v1/model/synthetics_ci_test_body.py | 103 ++++- .../v1/model/synthetics_ci_test_metadata.py | 104 ++++- .../model/synthetics_ci_test_metadata_ci.py | 103 ++++- .../model/synthetics_ci_test_metadata_git.py | 103 ++++- .../v1/model/synthetics_config_variable.py | 111 ++++- .../model/synthetics_config_variable_type.py | 118 ++++- .../v1/model/synthetics_core_web_vitals.py | 104 ++++- .../model/synthetics_delete_tests_payload.py | 102 ++++- .../model/synthetics_delete_tests_response.py | 103 ++++- .../v1/model/synthetics_deleted_test.py | 103 ++++- .../v1/model/synthetics_device.py | 113 ++++- .../v1/model/synthetics_device_id.py | 118 ++++- .../v1/model/synthetics_error_code.py | 118 ++++- ...cs_get_api_test_latest_results_response.py | 104 ++++- ...et_browser_test_latest_results_response.py | 104 ++++- .../v1/model/synthetics_global_variable.py | 115 ++++- ...tics_global_variable_parse_test_options.py | 109 ++++- ...global_variable_parse_test_options_type.py | 118 ++++- .../synthetics_global_variable_parser_type.py | 118 ++++- .../model/synthetics_global_variable_value.py | 103 ++++- ...nthetics_list_global_variables_response.py | 103 ++++- .../model/synthetics_list_tests_response.py | 103 ++++- .../v1/model/synthetics_location.py | 103 ++++- .../v1/model/synthetics_locations.py | 103 ++++- .../v1/model/synthetics_parsing_options.py | 106 ++++- .../v1/model/synthetics_playing_tab.py | 118 ++++- .../v1/model/synthetics_private_location.py | 112 ++++- ...tics_private_location_creation_response.py | 105 ++++- ...ion_creation_response_result_encryption.py | 103 ++++- .../synthetics_private_location_secrets.py | 104 ++++- ...private_location_secrets_authentication.py | 103 ++++- ...vate_location_secrets_config_decryption.py | 102 ++++- .../v1/model/synthetics_ssl_certificate.py | 114 ++++- .../synthetics_ssl_certificate_issuer.py | 107 ++++- .../synthetics_ssl_certificate_subject.py | 108 ++++- .../v1/model/synthetics_step.py | 107 ++++- .../v1/model/synthetics_step_detail.py | 119 ++++- .../model/synthetics_step_detail_warning.py | 108 ++++- .../v1/model/synthetics_step_type.py | 118 ++++- .../v1/model/synthetics_test_config.py | 106 ++++- .../v1/model/synthetics_test_details.py | 114 ++++- .../model/synthetics_test_details_sub_type.py | 118 ++++- .../v1/model/synthetics_test_details_type.py | 118 ++++- .../v1/model/synthetics_test_headers.py | 83 ++++ .../model/synthetics_test_monitor_status.py | 118 ++++- .../v1/model/synthetics_test_options.py | 115 ++++- ...synthetics_test_options_monitor_options.py | 102 ++++- .../v1/model/synthetics_test_options_retry.py | 103 ++++- .../v1/model/synthetics_test_pause_status.py | 118 ++++- .../model/synthetics_test_process_status.py | 118 ++++- .../v1/model/synthetics_test_request.py | 118 ++++- .../synthetics_test_request_certificate.py | 104 ++++- ...ynthetics_test_request_certificate_item.py | 104 ++++- .../v1/model/synthetics_timing.py | 110 ++++- .../synthetics_trigger_ci_test_location.py | 103 ++++- .../synthetics_trigger_ci_test_run_result.py | 106 ++++- .../synthetics_trigger_ci_tests_response.py | 105 ++++- ...hetics_update_test_pause_status_payload.py | 103 ++++- .../v1/model/synthetics_variable_parser.py | 107 ++++- .../v1/model/synthetics_warning_type.py | 114 ++++- .../model/table_widget_cell_display_mode.py | 118 ++++- .../v1/model/table_widget_definition.py | 114 ++++- .../v1/model/table_widget_definition_type.py | 114 ++++- .../v1/model/table_widget_has_search_bar.py | 118 ++++- .../v1/model/table_widget_request.py | 121 ++++- .../v1/model/tag_to_hosts.py | 102 ++++- .../v1/model/target_format_type.py | 118 ++++- .../v1/model/timeseries_widget_definition.py | 121 ++++- .../timeseries_widget_definition_type.py | 114 ++++- .../timeseries_widget_expression_alias.py | 106 ++++- .../model/timeseries_widget_legend_column.py | 118 ++++- .../model/timeseries_widget_legend_layout.py | 118 ++++- .../v1/model/timeseries_widget_request.py | 119 ++++- .../v1/model/toplist_widget_definition.py | 113 ++++- .../model/toplist_widget_definition_type.py | 114 ++++- .../v1/model/toplist_widget_request.py | 117 ++++- .../v1/model/tree_map_color_by.py | 114 ++++- .../v1/model/tree_map_group_by.py | 118 ++++- .../v1/model/tree_map_size_by.py | 118 ++++- .../v1/model/tree_map_widget_definition.py | 115 ++++- .../model/tree_map_widget_definition_type.py | 114 ++++- .../v1/model/tree_map_widget_request.py | 102 ++++- .../v1/model/usage_analyzed_logs_hour.py | 103 ++++- .../v1/model/usage_analyzed_logs_response.py | 103 ++++- .../v1/model/usage_attribution_aggregates.py | 112 ++++- .../usage_attribution_aggregates_body.py | 104 ++++- .../v1/model/usage_attribution_body.py | 109 ++++- .../v1/model/usage_attribution_metadata.py | 104 ++++- .../v1/model/usage_attribution_pagination.py | 104 ++++- .../v1/model/usage_attribution_response.py | 104 ++++- .../v1/model/usage_attribution_sort.py | 114 ++++- .../usage_attribution_supported_metrics.py | 118 ++++- .../v1/model/usage_attribution_tag_names.py | 83 ++++ .../v1/model/usage_attribution_values.py | 135 +++++- .../v1/model/usage_audit_logs_hour.py | 103 ++++- .../v1/model/usage_audit_logs_response.py | 103 ++++- .../v1/model/usage_billable_summary_body.py | 108 ++++- .../v1/model/usage_billable_summary_hour.py | 110 ++++- .../v1/model/usage_billable_summary_keys.py | 134 +++++- .../model/usage_billable_summary_response.py | 103 ++++- ..._cloud_security_posture_management_hour.py | 104 ++++- ...ud_security_posture_management_response.py | 103 ++++- .../model/usage_custom_reports_attributes.py | 106 ++++- .../v1/model/usage_custom_reports_data.py | 105 ++++- .../v1/model/usage_custom_reports_meta.py | 103 ++++- .../v1/model/usage_custom_reports_page.py | 102 ++++- .../v1/model/usage_custom_reports_response.py | 104 ++++- .../v1/model/usage_cws_hour.py | 104 ++++- .../v1/model/usage_cws_response.py | 103 ++++- .../v1/model/usage_fargate_hour.py | 103 ++++- .../v1/model/usage_fargate_response.py | 103 ++++- .../v1/model/usage_host_hour.py | 115 ++++- .../v1/model/usage_hosts_response.py | 103 ++++- .../model/usage_incident_management_hour.py | 103 ++++- .../usage_incident_management_response.py | 103 ++++- .../v1/model/usage_indexed_spans_hour.py | 103 ++++- .../v1/model/usage_indexed_spans_response.py | 103 ++++- .../v1/model/usage_ingested_spans_hour.py | 103 ++++- .../v1/model/usage_ingested_spans_response.py | 103 ++++- .../v1/model/usage_io_t_hour.py | 103 ++++- .../v1/model/usage_io_t_response.py | 103 ++++- .../v1/model/usage_lambda_hour.py | 104 ++++- .../v1/model/usage_lambda_response.py | 103 ++++- .../v1/model/usage_logs_by_index_hour.py | 106 ++++- .../v1/model/usage_logs_by_index_response.py | 103 ++++- .../v1/model/usage_logs_by_retention_hour.py | 105 ++++- .../model/usage_logs_by_retention_response.py | 103 ++++- .../v1/model/usage_logs_hour.py | 109 ++++- .../v1/model/usage_logs_response.py | 103 ++++- .../v1/model/usage_metric_category.py | 118 ++++- .../v1/model/usage_network_flows_hour.py | 103 ++++- .../v1/model/usage_network_flows_response.py | 103 ++++- .../v1/model/usage_network_hosts_hour.py | 103 ++++- .../v1/model/usage_network_hosts_response.py | 103 ++++- .../v1/model/usage_profiling_hour.py | 104 ++++- .../v1/model/usage_profiling_response.py | 103 ++++- .../v1/model/usage_reports_type.py | 114 ++++- .../v1/model/usage_rum_sessions_hour.py | 105 ++++- .../v1/model/usage_rum_sessions_response.py | 103 ++++- .../v1/model/usage_snmp_hour.py | 103 ++++- .../v1/model/usage_snmp_response.py | 103 ++++- src/datadog_api_client/v1/model/usage_sort.py | 114 ++++- .../v1/model/usage_sort_direction.py | 114 ++++- ...age_specified_custom_reports_attributes.py | 107 ++++- .../usage_specified_custom_reports_data.py | 105 ++++- .../usage_specified_custom_reports_meta.py | 103 ++++- .../usage_specified_custom_reports_page.py | 102 ++++- ...usage_specified_custom_reports_response.py | 104 ++++- .../v1/model/usage_summary_date.py | 145 +++++- .../v1/model/usage_summary_date_org.py | 145 +++++- .../v1/model/usage_summary_response.py | 154 ++++++- .../v1/model/usage_synthetics_api_hour.py | 103 ++++- .../v1/model/usage_synthetics_api_response.py | 103 ++++- .../v1/model/usage_synthetics_browser_hour.py | 103 ++++- .../usage_synthetics_browser_response.py | 103 ++++- .../v1/model/usage_synthetics_hour.py | 103 ++++- .../v1/model/usage_synthetics_response.py | 103 ++++- .../v1/model/usage_timeseries_hour.py | 105 ++++- .../v1/model/usage_timeseries_response.py | 103 ++++- .../v1/model/usage_top_avg_metrics_hour.py | 106 ++++- .../model/usage_top_avg_metrics_metadata.py | 105 ++++- .../model/usage_top_avg_metrics_response.py | 104 ++++- src/datadog_api_client/v1/model/user.py | 109 ++++- .../v1/model/user_disable_response.py | 102 ++++- .../v1/model/user_list_response.py | 103 ++++- .../v1/model/user_response.py | 103 ++++- src/datadog_api_client/v1/model/widget.py | 108 ++++- .../v1/model/widget_aggregator.py | 118 ++++- .../v1/model/widget_axis.py | 106 ++++- .../v1/model/widget_change_type.py | 118 ++++- .../v1/model/widget_color_preference.py | 118 ++++- .../v1/model/widget_comparator.py | 118 ++++- .../v1/model/widget_compare_to.py | 118 ++++- .../v1/model/widget_conditional_format.py | 116 ++++- .../v1/model/widget_custom_link.py | 105 ++++- .../v1/model/widget_definition.py | 205 ++++++++- .../v1/model/widget_display_type.py | 118 ++++- .../v1/model/widget_event.py | 106 ++++- .../v1/model/widget_event_size.py | 118 ++++- .../v1/model/widget_field_sort.py | 108 ++++- .../v1/model/widget_formula.py | 110 ++++- .../v1/model/widget_formula_limit.py | 104 ++++- .../v1/model/widget_grouping.py | 118 ++++- .../v1/model/widget_horizontal_align.py | 118 ++++- .../v1/model/widget_image_sizing.py | 118 ++++- .../v1/model/widget_layout.py | 112 ++++- .../v1/model/widget_layout_type.py | 114 ++++- .../v1/model/widget_line_type.py | 118 ++++- .../v1/model/widget_line_width.py | 118 ++++- .../v1/model/widget_live_span.py | 118 ++++- .../v1/model/widget_margin.py | 118 ++++- .../v1/model/widget_marker.py | 108 ++++- .../v1/model/widget_message_display.py | 118 ++++- .../widget_monitor_summary_display_format.py | 118 ++++- .../v1/model/widget_monitor_summary_sort.py | 118 ++++- .../v1/model/widget_node_type.py | 118 ++++- .../v1/model/widget_order_by.py | 118 ++++- .../v1/model/widget_palette.py | 118 ++++- .../v1/model/widget_request_style.py | 105 ++++- .../widget_service_summary_display_format.py | 118 ++++- .../v1/model/widget_size_format.py | 118 ++++- .../v1/model/widget_sort.py | 118 ++++- .../v1/model/widget_style.py | 102 ++++- .../v1/model/widget_summary_type.py | 118 ++++- .../v1/model/widget_text_align.py | 118 ++++- .../v1/model/widget_tick_edge.py | 118 ++++- .../v1/model/widget_time.py | 103 ++++- .../v1/model/widget_time_windows.py | 118 ++++- .../v1/model/widget_vertical_align.py | 118 ++++- .../v1/model/widget_view_mode.py | 118 ++++- .../v1/model/widget_viz_type.py | 118 ++++- src/datadog_api_client/v1/model_utils.py | 423 +++++++++++------- src/datadog_api_client/v1/openapi.yaml | 2 - src/datadog_api_client/v1/rest.py | 8 +- src/datadog_api_client/v2/api_client.py | 6 +- .../v2/model/api_error_response.py | 105 ++++- .../v2/model/api_key_create_attributes.py | 105 ++++- .../v2/model/api_key_create_data.py | 108 ++++- .../v2/model/api_key_create_request.py | 106 ++++- .../v2/model/api_key_relationships.py | 104 ++++- .../v2/model/api_key_response.py | 104 ++++- .../model/api_key_response_included_item.py | 115 ++++- .../v2/model/api_key_update_attributes.py | 105 ++++- .../v2/model/api_key_update_data.py | 110 ++++- .../v2/model/api_key_update_request.py | 106 ++++- .../v2/model/api_keys_response.py | 104 ++++- .../v2/model/api_keys_sort.py | 114 ++++- .../v2/model/api_keys_type.py | 114 ++++- .../application_key_create_attributes.py | 105 ++++- .../v2/model/application_key_create_data.py | 108 ++++- .../model/application_key_create_request.py | 106 ++++- .../v2/model/application_key_relationships.py | 103 ++++- .../v2/model/application_key_response.py | 104 ++++- .../application_key_response_included_item.py | 115 ++++- .../application_key_update_attributes.py | 105 ++++- .../v2/model/application_key_update_data.py | 110 ++++- .../model/application_key_update_request.py | 106 ++++- .../v2/model/application_keys_sort.py | 114 ++++- .../v2/model/application_keys_type.py | 114 ++++- src/datadog_api_client/v2/model/creator.py | 104 ++++- .../model/dashboard_list_add_items_request.py | 103 ++++- .../dashboard_list_add_items_response.py | 103 ++++- .../dashboard_list_delete_items_request.py | 103 ++++- .../dashboard_list_delete_items_response.py | 103 ++++- .../v2/model/dashboard_list_item.py | 118 ++++- .../v2/model/dashboard_list_item_request.py | 108 ++++- .../v2/model/dashboard_list_item_response.py | 113 ++++- .../v2/model/dashboard_list_items.py | 107 ++++- .../dashboard_list_update_items_request.py | 103 ++++- .../dashboard_list_update_items_response.py | 103 ++++- .../v2/model/dashboard_type.py | 118 ++++- .../v2/model/full_api_key.py | 106 ++++- .../v2/model/full_api_key_attributes.py | 106 ++++- .../v2/model/full_application_key.py | 106 ++++- .../model/full_application_key_attributes.py | 105 ++++- .../v2/model/incident_create_attributes.py | 111 ++++- .../v2/model/incident_create_data.py | 109 ++++- .../v2/model/incident_create_relationships.py | 106 ++++- .../v2/model/incident_create_request.py | 106 ++++- .../v2/model/incident_field_attributes.py | 121 ++++- ...ncident_field_attributes_multiple_value.py | 104 ++++- .../incident_field_attributes_single_value.py | 104 ++++- ...dent_field_attributes_single_value_type.py | 114 ++++- .../incident_field_attributes_value_type.py | 114 ++++- .../incident_integration_metadata_type.py | 114 ++++- .../v2/model/incident_postmortem_type.py | 114 ++++- .../v2/model/incident_related_object.py | 114 ++++- .../v2/model/incident_response.py | 107 ++++- .../v2/model/incident_response_attributes.py | 123 ++++- .../v2/model/incident_response_data.py | 110 ++++- .../model/incident_response_included_item.py | 115 ++++- .../model/incident_response_relationships.py | 107 ++++- .../incident_service_create_attributes.py | 105 ++++- .../v2/model/incident_service_create_data.py | 108 ++++- .../model/incident_service_create_request.py | 106 ++++- .../model/incident_service_included_items.py | 115 ++++- .../model/incident_service_relationships.py | 104 ++++- .../v2/model/incident_service_response.py | 107 ++++- .../incident_service_response_attributes.py | 104 ++++- .../model/incident_service_response_data.py | 110 ++++- .../v2/model/incident_service_type.py | 114 ++++- .../incident_service_update_attributes.py | 105 ++++- .../v2/model/incident_service_update_data.py | 109 ++++- .../model/incident_service_update_request.py | 106 ++++- .../v2/model/incident_services_response.py | 108 ++++- .../model/incident_services_response_meta.py | 103 ++++- ...ident_services_response_meta_pagination.py | 104 ++++- .../model/incident_team_create_attributes.py | 105 ++++- .../v2/model/incident_team_create_data.py | 108 ++++- .../v2/model/incident_team_create_request.py | 106 ++++- .../v2/model/incident_team_included_items.py | 115 ++++- .../v2/model/incident_team_relationships.py | 104 ++++- .../v2/model/incident_team_response.py | 107 ++++- .../incident_team_response_attributes.py | 104 ++++- .../v2/model/incident_team_response_data.py | 106 ++++- .../v2/model/incident_team_type.py | 114 ++++- .../model/incident_team_update_attributes.py | 105 ++++- .../v2/model/incident_team_update_data.py | 109 ++++- .../v2/model/incident_team_update_request.py | 106 ++++- .../v2/model/incident_teams_response.py | 108 ++++- ...ncident_timeline_cell_create_attributes.py | 114 ++++- ...ent_timeline_cell_markdown_content_type.py | 114 ++++- ...imeline_cell_markdown_create_attributes.py | 109 ++++- ...cell_markdown_create_attributes_content.py | 102 ++++- .../v2/model/incident_type.py | 114 ++++- .../v2/model/incident_update_attributes.py | 111 ++++- .../v2/model/incident_update_data.py | 110 ++++- .../v2/model/incident_update_relationships.py | 107 ++++- .../v2/model/incident_update_request.py | 106 ++++- .../v2/model/incidents_response.py | 108 ++++- .../model/list_application_keys_response.py | 104 ++++- src/datadog_api_client/v2/model/log.py | 105 ++++- .../v2/model/log_attributes.py | 108 ++++- src/datadog_api_client/v2/model/log_type.py | 114 ++++- .../v2/model/logs_aggregate_bucket.py | 104 ++++- .../v2/model/logs_aggregate_bucket_value.py | 111 ++++- .../logs_aggregate_bucket_value_timeseries.py | 112 ++++- ...aggregate_bucket_value_timeseries_point.py | 103 ++++- .../v2/model/logs_aggregate_request.py | 107 ++++- .../v2/model/logs_aggregate_request_page.py | 102 ++++- .../v2/model/logs_aggregate_response.py | 104 ++++- .../v2/model/logs_aggregate_response_data.py | 103 ++++- .../model/logs_aggregate_response_status.py | 118 ++++- .../v2/model/logs_aggregate_sort.py | 106 ++++- .../v2/model/logs_aggregate_sort_type.py | 114 ++++- .../v2/model/logs_aggregation_function.py | 118 ++++- .../v2/model/logs_archive.py | 103 ++++- .../v2/model/logs_archive_attributes.py | 113 ++++- .../v2/model/logs_archive_create_request.py | 103 ++++- .../logs_archive_create_request_attributes.py | 112 ++++- .../logs_archive_create_request_definition.py | 108 ++++- ...logs_archive_create_request_destination.py | 118 ++++- .../v2/model/logs_archive_definition.py | 114 ++++- .../v2/model/logs_archive_destination.py | 118 ++++- .../model/logs_archive_destination_azure.py | 114 ++++- .../logs_archive_destination_azure_type.py | 114 ++++- .../v2/model/logs_archive_destination_gcs.py | 111 ++++- .../logs_archive_destination_gcs_type.py | 114 ++++- .../v2/model/logs_archive_destination_s3.py | 111 ++++- .../model/logs_archive_destination_s3_type.py | 114 ++++- .../model/logs_archive_integration_azure.py | 107 ++++- .../v2/model/logs_archive_integration_gcs.py | 107 ++++- .../v2/model/logs_archive_integration_s3.py | 107 ++++- .../v2/model/logs_archive_order.py | 103 ++++- .../v2/model/logs_archive_order_attributes.py | 105 ++++- .../v2/model/logs_archive_order_definition.py | 108 ++++- .../logs_archive_order_definition_type.py | 114 ++++- .../v2/model/logs_archive_state.py | 118 ++++- .../v2/model/logs_archives.py | 103 ++++- .../v2/model/logs_compute.py | 109 ++++- .../v2/model/logs_compute_type.py | 114 ++++- .../v2/model/logs_group_by.py | 111 ++++- .../v2/model/logs_group_by_histogram.py | 109 ++++- .../v2/model/logs_group_by_missing.py | 83 ++++ .../v2/model/logs_group_by_total.py | 83 ++++ .../v2/model/logs_list_request.py | 106 ++++- .../v2/model/logs_list_request_page.py | 103 ++++- .../v2/model/logs_list_response.py | 105 ++++- .../v2/model/logs_list_response_links.py | 102 ++++- .../v2/model/logs_metric_compute.py | 107 ++++- .../logs_metric_compute_aggregation_type.py | 118 ++++- .../v2/model/logs_metric_create_attributes.py | 108 ++++- .../v2/model/logs_metric_create_data.py | 110 ++++- .../v2/model/logs_metric_create_request.py | 106 ++++- .../v2/model/logs_metric_filter.py | 102 ++++- .../v2/model/logs_metric_group_by.py | 106 ++++- .../v2/model/logs_metric_response.py | 103 ++++- .../model/logs_metric_response_attributes.py | 105 ++++- .../v2/model/logs_metric_response_compute.py | 104 ++++- ...etric_response_compute_aggregation_type.py | 118 ++++- .../v2/model/logs_metric_response_data.py | 105 ++++- .../v2/model/logs_metric_response_filter.py | 102 ++++- .../v2/model/logs_metric_response_group_by.py | 103 ++++- .../v2/model/logs_metric_type.py | 114 ++++- .../v2/model/logs_metric_update_attributes.py | 104 ++++- .../v2/model/logs_metric_update_data.py | 108 ++++- .../v2/model/logs_metric_update_request.py | 106 ++++- .../v2/model/logs_metrics_response.py | 103 ++++- .../v2/model/logs_query_filter.py | 105 ++++- .../v2/model/logs_query_options.py | 103 ++++- .../v2/model/logs_response_metadata.py | 107 ++++- .../v2/model/logs_response_metadata_page.py | 102 ++++- src/datadog_api_client/v2/model/logs_sort.py | 118 ++++- .../v2/model/logs_sort_order.py | 118 ++++- .../v2/model/logs_warning.py | 104 ++++- src/datadog_api_client/v2/model/metric.py | 104 ++++- .../v2/model/metric_all_tags.py | 105 ++++- .../v2/model/metric_all_tags_attributes.py | 102 ++++- .../v2/model/metric_all_tags_response.py | 103 ++++- .../v2/model/metric_distinct_volume.py | 105 ++++- .../metric_distinct_volume_attributes.py | 102 ++++- .../v2/model/metric_distinct_volume_type.py | 114 ++++- .../model/metric_ingested_indexed_volume.py | 105 ++++- ...tric_ingested_indexed_volume_attributes.py | 103 ++++- .../metric_ingested_indexed_volume_type.py | 114 ++++- .../v2/model/metric_tag_configuration.py | 105 ++++- .../metric_tag_configuration_attributes.py | 107 ++++- ...ric_tag_configuration_create_attributes.py | 110 ++++- .../metric_tag_configuration_create_data.py | 109 ++++- ...metric_tag_configuration_create_request.py | 106 ++++- .../metric_tag_configuration_metric_types.py | 114 ++++- .../metric_tag_configuration_response.py | 103 ++++- .../v2/model/metric_tag_configuration_type.py | 114 ++++- ...ric_tag_configuration_update_attributes.py | 103 ++++- .../metric_tag_configuration_update_data.py | 109 ++++- ...metric_tag_configuration_update_request.py | 106 ++++- .../v2/model/metric_type.py | 114 ++++- .../v2/model/metric_volumes.py | 114 ++++- .../v2/model/metric_volumes_response.py | 103 ++++- .../metrics_and_metric_tag_configurations.py | 114 ++++- ..._and_metric_tag_configurations_response.py | 103 ++++- .../v2/model/organization.py | 108 ++++- .../v2/model/organization_attributes.py | 109 ++++- .../v2/model/organizations_type.py | 114 ++++- src/datadog_api_client/v2/model/pagination.py | 103 ++++- .../v2/model/partial_api_key.py | 106 ++++- .../v2/model/partial_api_key_attributes.py | 105 ++++- .../v2/model/partial_application_key.py | 106 ++++- .../partial_application_key_attributes.py | 104 ++++- src/datadog_api_client/v2/model/permission.py | 108 ++++- .../v2/model/permission_attributes.py | 108 ++++- .../v2/model/permissions_response.py | 103 ++++- .../v2/model/permissions_type.py | 114 ++++- .../v2/model/process_summaries_meta.py | 103 ++++- .../v2/model/process_summaries_meta_page.py | 103 ++++- .../v2/model/process_summaries_response.py | 104 ++++- .../v2/model/process_summary.py | 105 ++++- .../v2/model/process_summary_attributes.py | 109 ++++- .../v2/model/process_summary_type.py | 114 ++++- .../v2/model/query_sort_order.py | 114 ++++- ...p_to_incident_integration_metadata_data.py | 108 ++++- ...nship_to_incident_integration_metadatas.py | 106 ++++- .../relationship_to_incident_postmortem.py | 106 ++++- ...elationship_to_incident_postmortem_data.py | 108 ++++- .../v2/model/relationship_to_organization.py | 106 ++++- .../relationship_to_organization_data.py | 108 ++++- .../v2/model/relationship_to_organizations.py | 106 ++++- .../v2/model/relationship_to_permission.py | 103 ++++- .../model/relationship_to_permission_data.py | 104 ++++- .../v2/model/relationship_to_permissions.py | 103 ++++- .../v2/model/relationship_to_role.py | 103 ++++- .../v2/model/relationship_to_role_data.py | 104 ++++- .../v2/model/relationship_to_roles.py | 103 ++++- .../v2/model/relationship_to_user.py | 106 ++++- .../v2/model/relationship_to_user_data.py | 108 ++++- .../v2/model/relationship_to_users.py | 106 ++++- .../v2/model/response_meta_attributes.py | 103 ++++- src/datadog_api_client/v2/model/role.py | 109 ++++- .../v2/model/role_attributes.py | 105 ++++- .../v2/model/role_create_attributes.py | 107 ++++- .../v2/model/role_create_data.py | 108 ++++- .../v2/model/role_create_request.py | 106 ++++- .../v2/model/role_create_response.py | 103 ++++- .../v2/model/role_create_response_data.py | 109 ++++- .../v2/model/role_relationships.py | 104 ++++- .../v2/model/role_response.py | 103 ++++- .../v2/model/role_response_relationships.py | 103 ++++- .../v2/model/role_update_attributes.py | 104 ++++- .../v2/model/role_update_data.py | 110 ++++- .../v2/model/role_update_request.py | 106 ++++- .../v2/model/role_update_response.py | 103 ++++- .../v2/model/role_update_response_data.py | 109 ++++- .../v2/model/roles_response.py | 104 ++++- src/datadog_api_client/v2/model/roles_sort.py | 114 ++++- src/datadog_api_client/v2/model/roles_type.py | 114 ++++- .../v2/model/security_filter.py | 105 ++++- .../v2/model/security_filter_attributes.py | 109 ++++- .../security_filter_create_attributes.py | 116 ++++- .../v2/model/security_filter_create_data.py | 108 ++++- .../model/security_filter_create_request.py | 106 ++++- .../model/security_filter_exclusion_filter.py | 107 ++++- ...curity_filter_exclusion_filter_response.py | 103 ++++- .../security_filter_filtered_data_type.py | 114 ++++- .../v2/model/security_filter_meta.py | 102 ++++- .../v2/model/security_filter_response.py | 104 ++++- .../v2/model/security_filter_type.py | 114 ++++- .../security_filter_update_attributes.py | 108 ++++- .../v2/model/security_filter_update_data.py | 108 ++++- .../model/security_filter_update_request.py | 106 ++++- .../v2/model/security_filters_response.py | 104 ++++- .../v2/model/security_monitoring_filter.py | 104 ++++- .../security_monitoring_filter_action.py | 118 ++++- ...security_monitoring_list_rules_response.py | 104 ++++- .../v2/model/security_monitoring_rule_case.py | 106 ++++- .../security_monitoring_rule_case_create.py | 109 ++++- ...security_monitoring_rule_create_payload.py | 119 ++++- ...curity_monitoring_rule_detection_method.py | 118 ++++- ...urity_monitoring_rule_evaluation_window.py | 118 ++++- .../security_monitoring_rule_keep_alive.py | 118 ++++- ...ity_monitoring_rule_max_signal_duration.py | 118 ++++- ...urity_monitoring_rule_new_value_options.py | 104 ++++- ...ing_rule_new_value_options_forget_after.py | 118 ++++- ...ule_new_value_options_learning_duration.py | 118 ++++- .../model/security_monitoring_rule_options.py | 107 ++++- .../model/security_monitoring_rule_query.py | 109 ++++- ...urity_monitoring_rule_query_aggregation.py | 118 ++++- .../security_monitoring_rule_query_create.py | 112 ++++- .../security_monitoring_rule_response.py | 118 ++++- .../security_monitoring_rule_severity.py | 118 ++++- ...security_monitoring_rule_update_payload.py | 112 ++++- .../security_monitoring_runtime_agent_rule.py | 103 ++++- .../v2/model/security_monitoring_signal.py | 105 ++++- .../security_monitoring_signal_attributes.py | 105 ++++- ...security_monitoring_signal_list_request.py | 105 ++++- ...y_monitoring_signal_list_request_filter.py | 104 ++++- ...ity_monitoring_signal_list_request_page.py | 103 ++++- .../model/security_monitoring_signal_type.py | 114 ++++- ...curity_monitoring_signals_list_response.py | 105 ++++- ..._monitoring_signals_list_response_links.py | 102 ++++- ...y_monitoring_signals_list_response_meta.py | 103 ++++- ...itoring_signals_list_response_meta_page.py | 102 ++++- .../model/security_monitoring_signals_sort.py | 118 ++++- src/datadog_api_client/v2/model/user.py | 106 ++++- .../v2/model/user_attributes.py | 111 ++++- .../v2/model/user_create_attributes.py | 107 ++++- .../v2/model/user_create_data.py | 109 ++++- .../v2/model/user_create_request.py | 106 ++++- .../v2/model/user_invitation_data.py | 108 ++++- .../model/user_invitation_data_attributes.py | 105 ++++- .../v2/model/user_invitation_relationships.py | 106 ++++- .../v2/model/user_invitation_response.py | 103 ++++- .../v2/model/user_invitation_response_data.py | 105 ++++- .../v2/model/user_invitations_request.py | 106 ++++- .../v2/model/user_invitations_response.py | 103 ++++- .../v2/model/user_invitations_type.py | 114 ++++- .../v2/model/user_relationships.py | 103 ++++- .../v2/model/user_response.py | 104 ++++- .../v2/model/user_response_included_item.py | 115 ++++- .../v2/model/user_response_relationships.py | 106 ++++- .../v2/model/user_update_attributes.py | 104 ++++- .../v2/model/user_update_data.py | 110 ++++- .../v2/model/user_update_request.py | 106 ++++- .../v2/model/users_response.py | 105 ++++- src/datadog_api_client/v2/model/users_type.py | 114 ++++- src/datadog_api_client/v2/model_utils.py | 423 +++++++++++------- src/datadog_api_client/v2/rest.py | 8 +- tests/v1/features/synthetics.feature | 2 +- 1887 files changed, 102848 insertions(+), 2767 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 89040f0428..1836e95be3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev11", - "regenerated": "2021-07-23 09:17:27.076054", - "spec_repo_commit": "0b10309" + "regenerated": "2021-07-27 12:46:06.989229", + "spec_repo_commit": "9a2112a" }, "v2": { "apigentools_version": "1.4.1.dev11", - "regenerated": "2021-07-23 09:17:49.537097", - "spec_repo_commit": "0b10309" + "regenerated": "2021-07-27 12:46:33.945818", + "spec_repo_commit": "9a2112a" } } } \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index a1b151d647..e2a8821e2d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -341,7 +341,6 @@ datadog_api_client/v2/model/users_response.py datadog_api_client/v2/model/users_type.py datadog_api_client/v2/model_utils.py datadog_api_client/v2/models/__init__.py -datadog_api_client/v2/models/__init__.py datadog_api_client/v2/rest.py docs/APIErrorResponse.md docs/APIKeyCreateAttributes.md diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index c30f0ec2be..862529f8ca 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -5.1.0-SNAPSHOT \ No newline at end of file +5.2.1-SNAPSHOT \ No newline at end of file diff --git a/docs/v1/APIErrorResponse.md b/docs/v1/APIErrorResponse.md index ad0fdede58..9b3e480fc3 100644 --- a/docs/v1/APIErrorResponse.md +++ b/docs/v1/APIErrorResponse.md @@ -6,7 +6,8 @@ Error response object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **errors** | **[str]** | Array of errors returned by the API. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSAccount.md b/docs/v1/AWSAccount.md index 8c68af3891..03de8846a0 100644 --- a/docs/v1/AWSAccount.md +++ b/docs/v1/AWSAccount.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **host_tags** | **[str]** | Array of tags (in the form `key:value`) to add to all hosts and metrics reporting through this integration. | [optional] **role_name** | **str** | Your Datadog role delegation name. | [optional] **secret_access_key** | **str** | Your AWS secret access key. Only required if your AWS account is a GovCloud or China account. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSAccountAndLambdaRequest.md b/docs/v1/AWSAccountAndLambdaRequest.md index bb9ecee3bc..523e41d0de 100644 --- a/docs/v1/AWSAccountAndLambdaRequest.md +++ b/docs/v1/AWSAccountAndLambdaRequest.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_id** | **str** | Your AWS Account ID without dashes. | **lambda_arn** | **str** | ARN of the Datadog Lambda created during the Datadog-Amazon Web services Log collection setup. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSAccountCreateResponse.md b/docs/v1/AWSAccountCreateResponse.md index 2d6a57c0ee..6b91b33e68 100644 --- a/docs/v1/AWSAccountCreateResponse.md +++ b/docs/v1/AWSAccountCreateResponse.md @@ -6,7 +6,8 @@ The Response returned by the AWS Create Account call. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **external_id** | **str** | AWS external_id. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSAccountDeleteRequest.md b/docs/v1/AWSAccountDeleteRequest.md index f4adc0892b..a5e5cca225 100644 --- a/docs/v1/AWSAccountDeleteRequest.md +++ b/docs/v1/AWSAccountDeleteRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **access_key_id** | **str** | Your AWS access key ID. Only required if your AWS account is a GovCloud or China account. | [optional] **account_id** | **str** | Your AWS Account ID without dashes. | [optional] **role_name** | **str** | Your Datadog role delegation name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSAccountListResponse.md b/docs/v1/AWSAccountListResponse.md index fe3b15b09a..37b9412beb 100644 --- a/docs/v1/AWSAccountListResponse.md +++ b/docs/v1/AWSAccountListResponse.md @@ -6,7 +6,8 @@ List of enabled AWS accounts. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **accounts** | [**[AWSAccount]**](AWSAccount.md) | List of enabled AWS accounts. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSLogsAsyncError.md b/docs/v1/AWSLogsAsyncError.md index d720ffd92a..36d3106f0b 100644 --- a/docs/v1/AWSLogsAsyncError.md +++ b/docs/v1/AWSLogsAsyncError.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Code properties | [optional] **message** | **str** | Message content. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSLogsAsyncResponse.md b/docs/v1/AWSLogsAsyncResponse.md index 5dca461bbe..2b9b4b3a5f 100644 --- a/docs/v1/AWSLogsAsyncResponse.md +++ b/docs/v1/AWSLogsAsyncResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **errors** | [**[AWSLogsAsyncError]**](AWSLogsAsyncError.md) | List of errors. | [optional] **status** | **str** | Status of the properties. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSLogsLambda.md b/docs/v1/AWSLogsLambda.md index f1fb601cd1..5bc11717f9 100644 --- a/docs/v1/AWSLogsLambda.md +++ b/docs/v1/AWSLogsLambda.md @@ -6,7 +6,8 @@ Description of the Lambdas. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **arn** | **str** | Available ARN IDs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSLogsListResponse.md b/docs/v1/AWSLogsListResponse.md index cbc9816b5c..120e7360cd 100644 --- a/docs/v1/AWSLogsListResponse.md +++ b/docs/v1/AWSLogsListResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **account_id** | **str** | Your AWS Account ID without dashes. | [optional] **lambdas** | [**[AWSLogsLambda]**](AWSLogsLambda.md) | List of ARNs configured in your Datadog account. | [optional] **services** | **[str]** | Array of services IDs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSLogsListServicesResponse.md b/docs/v1/AWSLogsListServicesResponse.md index 3946882f01..19778e64fa 100644 --- a/docs/v1/AWSLogsListServicesResponse.md +++ b/docs/v1/AWSLogsListServicesResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Key value in returned object. | [optional] **label** | **str** | Name of service available for configuration with Datadog logs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSLogsServicesRequest.md b/docs/v1/AWSLogsServicesRequest.md index 780b0420db..4eaf47a974 100644 --- a/docs/v1/AWSLogsServicesRequest.md +++ b/docs/v1/AWSLogsServicesRequest.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_id** | **str** | Your AWS Account ID without dashes. | **services** | **[str]** | Array of services IDs set to enable automatic log collection. Discover the list of available services with the get list of AWS log ready services API endpoint. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSNamespace.md b/docs/v1/AWSNamespace.md index d16aca9b3b..75fb588fa9 100644 --- a/docs/v1/AWSNamespace.md +++ b/docs/v1/AWSNamespace.md @@ -6,7 +6,8 @@ The namespace associated with the tag filter entry. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The namespace associated with the tag filter entry. | must be one of ["elb", "application_elb", "sqs", "rds", "custom", "network_elb", "lambda", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSTagFilter.md b/docs/v1/AWSTagFilter.md index 0144b54d48..792d367a18 100644 --- a/docs/v1/AWSTagFilter.md +++ b/docs/v1/AWSTagFilter.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **namespace** | [**AWSNamespace**](AWSNamespace.md) | | [optional] **tag_filter_str** | **str** | The tag filter string. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSTagFilterCreateRequest.md b/docs/v1/AWSTagFilterCreateRequest.md index 831e84dd98..8bf6018b7e 100644 --- a/docs/v1/AWSTagFilterCreateRequest.md +++ b/docs/v1/AWSTagFilterCreateRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **account_id** | **str** | Your AWS Account ID without dashes. | [optional] **namespace** | [**AWSNamespace**](AWSNamespace.md) | | [optional] **tag_filter_str** | **str** | The tag filter string. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSTagFilterDeleteRequest.md b/docs/v1/AWSTagFilterDeleteRequest.md index 629228ebd1..ffb3665caf 100644 --- a/docs/v1/AWSTagFilterDeleteRequest.md +++ b/docs/v1/AWSTagFilterDeleteRequest.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_id** | **str** | The unique identifier of your AWS account. | [optional] **namespace** | [**AWSNamespace**](AWSNamespace.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AWSTagFilterListResponse.md b/docs/v1/AWSTagFilterListResponse.md index 255253c4ee..4eab73da76 100644 --- a/docs/v1/AWSTagFilterListResponse.md +++ b/docs/v1/AWSTagFilterListResponse.md @@ -6,7 +6,8 @@ An array of tag filter rules by `namespace` and tag filter string. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **filters** | [**[AWSTagFilter]**](AWSTagFilter.md) | An array of tag filters. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AccessRole.md b/docs/v1/AccessRole.md index 0c13203cb8..1411c18fe4 100644 --- a/docs/v1/AccessRole.md +++ b/docs/v1/AccessRole.md @@ -6,7 +6,8 @@ The access role of the user. Options are **st** (standard user), **adm** (admin Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The access role of the user. Options are **st** (standard user), **adm** (admin user), or **ro** (read-only user). | defaults to "st", must be one of ["st", "adm", "ro", "ERROR", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AlertGraphWidgetDefinition.md b/docs/v1/AlertGraphWidgetDefinition.md index e26e340f5c..0e115ede80 100644 --- a/docs/v1/AlertGraphWidgetDefinition.md +++ b/docs/v1/AlertGraphWidgetDefinition.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **title** | **str** | The title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AlertGraphWidgetDefinitionType.md b/docs/v1/AlertGraphWidgetDefinitionType.md index 563cf8fc35..9e45e5879f 100644 --- a/docs/v1/AlertGraphWidgetDefinitionType.md +++ b/docs/v1/AlertGraphWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the alert graph widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the alert graph widget. | defaults to "alert_graph", must be one of ["alert_graph", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AlertValueWidgetDefinition.md b/docs/v1/AlertValueWidgetDefinition.md index 9c61c0ebbe..2abd64d7b4 100644 --- a/docs/v1/AlertValueWidgetDefinition.md +++ b/docs/v1/AlertValueWidgetDefinition.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of value in the widget. | [optional] **unit** | **str** | Unit to display with the value. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AlertValueWidgetDefinitionType.md b/docs/v1/AlertValueWidgetDefinitionType.md index 64ff599233..64dbabb3d0 100644 --- a/docs/v1/AlertValueWidgetDefinitionType.md +++ b/docs/v1/AlertValueWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the alert value widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the alert value widget. | defaults to "alert_value", must be one of ["alert_value", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApiKey.md b/docs/v1/ApiKey.md index 5048de007a..eb61ca5c50 100644 --- a/docs/v1/ApiKey.md +++ b/docs/v1/ApiKey.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **created_by** | **str** | Datadog user handle that created the API key. | [optional] [readonly] **key** | **str** | API key. | [optional] [readonly] **name** | **str** | Name of your API key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApiKeyListResponse.md b/docs/v1/ApiKeyListResponse.md index 9fae0737ca..0d120e1792 100644 --- a/docs/v1/ApiKeyListResponse.md +++ b/docs/v1/ApiKeyListResponse.md @@ -6,7 +6,8 @@ List of API and application keys available for a given organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_keys** | [**[ApiKey]**](ApiKey.md) | Array of API keys. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApiKeyResponse.md b/docs/v1/ApiKeyResponse.md index 688ef85c29..35181b0cb3 100644 --- a/docs/v1/ApiKeyResponse.md +++ b/docs/v1/ApiKeyResponse.md @@ -6,7 +6,8 @@ An API key with its associated metadata. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **api_key** | [**ApiKey**](ApiKey.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApmStatsQueryColumnType.md b/docs/v1/ApmStatsQueryColumnType.md index f8550dff78..140e089522 100644 --- a/docs/v1/ApmStatsQueryColumnType.md +++ b/docs/v1/ApmStatsQueryColumnType.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **alias** | **str** | A user-assigned alias for the column. | [optional] **cell_display_mode** | [**TableWidgetCellDisplayMode**](TableWidgetCellDisplayMode.md) | | [optional] **order** | [**WidgetSort**](WidgetSort.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApmStatsQueryDefinition.md b/docs/v1/ApmStatsQueryDefinition.md index 3f489dd859..413539abc9 100644 --- a/docs/v1/ApmStatsQueryDefinition.md +++ b/docs/v1/ApmStatsQueryDefinition.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **service** | **str** | Service name. | **columns** | [**[ApmStatsQueryColumnType]**](ApmStatsQueryColumnType.md) | Column properties used by the front end for display. | [optional] **resource** | **str** | Resource name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApmStatsQueryRowType.md b/docs/v1/ApmStatsQueryRowType.md index c2b347fb81..7a2bee0884 100644 --- a/docs/v1/ApmStatsQueryRowType.md +++ b/docs/v1/ApmStatsQueryRowType.md @@ -6,7 +6,8 @@ The level of detail for the request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The level of detail for the request. | must be one of ["service", "resource", "span", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApplicationKey.md b/docs/v1/ApplicationKey.md index 60d02f0437..649cfb25ed 100644 --- a/docs/v1/ApplicationKey.md +++ b/docs/v1/ApplicationKey.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **hash** | **str** | Hash of an application key. | [optional] [readonly] **name** | **str** | Name of an application key. | [optional] **owner** | **str** | Owner of an application key. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApplicationKeyListResponse.md b/docs/v1/ApplicationKeyListResponse.md index ae00dcf1f4..114b680c19 100644 --- a/docs/v1/ApplicationKeyListResponse.md +++ b/docs/v1/ApplicationKeyListResponse.md @@ -6,7 +6,8 @@ An application key response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_keys** | [**[ApplicationKey]**](ApplicationKey.md) | Array of application keys. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ApplicationKeyResponse.md b/docs/v1/ApplicationKeyResponse.md index 9c90417b6e..6dc32546ec 100644 --- a/docs/v1/ApplicationKeyResponse.md +++ b/docs/v1/ApplicationKeyResponse.md @@ -6,7 +6,8 @@ An application key response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **application_key** | [**ApplicationKey**](ApplicationKey.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AuthenticationValidationResponse.md b/docs/v1/AuthenticationValidationResponse.md index 3322abb45f..32174f2210 100644 --- a/docs/v1/AuthenticationValidationResponse.md +++ b/docs/v1/AuthenticationValidationResponse.md @@ -6,7 +6,8 @@ Represent validation endpoint responses. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **valid** | **bool** | Return `true` if the authentication response is valid. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AzureAccount.md b/docs/v1/AzureAccount.md index b0ccd6ed8a..890dcf177f 100644 --- a/docs/v1/AzureAccount.md +++ b/docs/v1/AzureAccount.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **new_client_id** | **str** | Your New Azure web application ID. | [optional] **new_tenant_name** | **str** | Your New Azure Active Directory ID. | [optional] **tenant_name** | **str** | Your Azure Active Directory ID. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/AzureAccountListResponse.md b/docs/v1/AzureAccountListResponse.md index 144db3afd5..ceb666f070 100644 --- a/docs/v1/AzureAccountListResponse.md +++ b/docs/v1/AzureAccountListResponse.md @@ -6,7 +6,8 @@ Accounts configured for your organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[AzureAccount]**](AzureAccount.md) | Accounts configured for your organization. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CancelDowntimesByScopeRequest.md b/docs/v1/CancelDowntimesByScopeRequest.md index 9ebbc9bbf1..43d3bb790c 100644 --- a/docs/v1/CancelDowntimesByScopeRequest.md +++ b/docs/v1/CancelDowntimesByScopeRequest.md @@ -6,7 +6,8 @@ Cancel downtimes according to scope. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **scope** | **str** | The scope(s) to which the downtime applies. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`). | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CanceledDowntimesIds.md b/docs/v1/CanceledDowntimesIds.md index e4d3728605..51248f5a81 100644 --- a/docs/v1/CanceledDowntimesIds.md +++ b/docs/v1/CanceledDowntimesIds.md @@ -6,7 +6,8 @@ Object containing array of IDs of canceled downtimes. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cancelled_ids** | **[int]** | ID of downtimes that were canceled. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ChangeWidgetDefinition.md b/docs/v1/ChangeWidgetDefinition.md index 1e71a955a9..8d0261d335 100644 --- a/docs/v1/ChangeWidgetDefinition.md +++ b/docs/v1/ChangeWidgetDefinition.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ChangeWidgetDefinitionType.md b/docs/v1/ChangeWidgetDefinitionType.md index 3d3bdca350..a2af07f3c2 100644 --- a/docs/v1/ChangeWidgetDefinitionType.md +++ b/docs/v1/ChangeWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the change widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the change widget. | defaults to "change", must be one of ["change", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ChangeWidgetRequest.md b/docs/v1/ChangeWidgetRequest.md index 757652a21f..c8bc945591 100644 --- a/docs/v1/ChangeWidgetRequest.md +++ b/docs/v1/ChangeWidgetRequest.md @@ -20,7 +20,8 @@ Name | Type | Description | Notes **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **show_present** | **bool** | Whether to show the present value. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CheckCanDeleteMonitorResponse.md b/docs/v1/CheckCanDeleteMonitorResponse.md index 9af024b507..2ce33fc853 100644 --- a/docs/v1/CheckCanDeleteMonitorResponse.md +++ b/docs/v1/CheckCanDeleteMonitorResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**CheckCanDeleteMonitorResponseData**](CheckCanDeleteMonitorResponseData.md) | | **errors** | **{str: ([str],)}** | A mapping of Monitor ID to strings denoting where it's used. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CheckCanDeleteMonitorResponseData.md b/docs/v1/CheckCanDeleteMonitorResponseData.md index cd9a7f8998..2e49a1ca3f 100644 --- a/docs/v1/CheckCanDeleteMonitorResponseData.md +++ b/docs/v1/CheckCanDeleteMonitorResponseData.md @@ -6,7 +6,8 @@ Wrapper object with the list of monitor IDs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ok** | **[int]** | An array of of Monitor IDs that can be safely deleted. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CheckCanDeleteSLOResponse.md b/docs/v1/CheckCanDeleteSLOResponse.md index c04310b2d1..688e26c8a7 100644 --- a/docs/v1/CheckCanDeleteSLOResponse.md +++ b/docs/v1/CheckCanDeleteSLOResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**CheckCanDeleteSLOResponseData**](CheckCanDeleteSLOResponseData.md) | | [optional] **errors** | **{str: (str,)}** | A mapping of SLO id to it's current usages. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CheckCanDeleteSLOResponseData.md b/docs/v1/CheckCanDeleteSLOResponseData.md index 826f919cc5..f92c0c646d 100644 --- a/docs/v1/CheckCanDeleteSLOResponseData.md +++ b/docs/v1/CheckCanDeleteSLOResponseData.md @@ -6,7 +6,8 @@ An array of service level objective objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ok** | **[str]** | An array of of SLO IDs that can be safely deleted. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CheckStatusWidgetDefinition.md b/docs/v1/CheckStatusWidgetDefinition.md index 8fed87458f..97d7c1ab74 100644 --- a/docs/v1/CheckStatusWidgetDefinition.md +++ b/docs/v1/CheckStatusWidgetDefinition.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/CheckStatusWidgetDefinitionType.md b/docs/v1/CheckStatusWidgetDefinitionType.md index 8727b40644..5657d4019d 100644 --- a/docs/v1/CheckStatusWidgetDefinitionType.md +++ b/docs/v1/CheckStatusWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the check status widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the check status widget. | defaults to "check_status", must be one of ["check_status", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ContentEncoding.md b/docs/v1/ContentEncoding.md index 1c7c729fda..7b82907931 100644 --- a/docs/v1/ContentEncoding.md +++ b/docs/v1/ContentEncoding.md @@ -6,7 +6,8 @@ HTTP header used to compress the media-type Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | HTTP header used to compress the media-type | must be one of ["gzip", "deflate", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Creator.md b/docs/v1/Creator.md index 023e476317..ca49b10523 100644 --- a/docs/v1/Creator.md +++ b/docs/v1/Creator.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **email** | **str** | Email of the creator. | [optional] **handle** | **str** | Handle of the creator. | [optional] **name** | **str** | Name of the creator. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Dashboard.md b/docs/v1/Dashboard.md index 642c165b2e..97a003e142 100644 --- a/docs/v1/Dashboard.md +++ b/docs/v1/Dashboard.md @@ -20,7 +20,8 @@ Name | Type | Description | Notes **template_variable_presets** | [**[DashboardTemplateVariablePreset], none_type**](DashboardTemplateVariablePreset.md) | Array of template variables saved views. | [optional] **template_variables** | [**[DashboardTemplateVariable], none_type**](DashboardTemplateVariable.md) | List of template variables for this dashboard. | [optional] **url** | **str** | The URL of the dashboard. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardBulkActionData.md b/docs/v1/DashboardBulkActionData.md index f6068c005e..ca2fcc5145 100644 --- a/docs/v1/DashboardBulkActionData.md +++ b/docs/v1/DashboardBulkActionData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Dashboard resource ID. | **type** | [**DashboardResourceType**](DashboardResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardBulkActionDataList.md b/docs/v1/DashboardBulkActionDataList.md index 2c4e1ae115..4555aa7d44 100644 --- a/docs/v1/DashboardBulkActionDataList.md +++ b/docs/v1/DashboardBulkActionDataList.md @@ -6,7 +6,8 @@ List of dashboard bulk action request data objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[DashboardBulkActionData]**](DashboardBulkActionData.md) | List of dashboard bulk action request data objects. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardBulkDeleteRequest.md b/docs/v1/DashboardBulkDeleteRequest.md index fe63b8c24e..69cc17f347 100644 --- a/docs/v1/DashboardBulkDeleteRequest.md +++ b/docs/v1/DashboardBulkDeleteRequest.md @@ -6,7 +6,8 @@ Dashboard bulk delete request body. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**DashboardBulkActionDataList**](DashboardBulkActionDataList.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardDeleteResponse.md b/docs/v1/DashboardDeleteResponse.md index 54befd3274..7f5f58864f 100644 --- a/docs/v1/DashboardDeleteResponse.md +++ b/docs/v1/DashboardDeleteResponse.md @@ -6,7 +6,8 @@ Response from the delete dashboard call. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted_dashboard_id** | **str** | ID of the deleted dashboard. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardLayoutType.md b/docs/v1/DashboardLayoutType.md index 24072235ad..1acf65c929 100644 --- a/docs/v1/DashboardLayoutType.md +++ b/docs/v1/DashboardLayoutType.md @@ -6,7 +6,8 @@ Layout type of the dashboard. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Layout type of the dashboard. | must be one of ["ordered", "free", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardList.md b/docs/v1/DashboardList.md index a5f19d388f..cfa5351a0b 100644 --- a/docs/v1/DashboardList.md +++ b/docs/v1/DashboardList.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **is_favorite** | **bool** | Whether or not the list is in the favorites. | [optional] [readonly] **modified** | **datetime** | Date of last edition of the dashboard list. | [optional] [readonly] **type** | **str** | The type of dashboard list. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardListDeleteResponse.md b/docs/v1/DashboardListDeleteResponse.md index 5c915470f0..e2eed4b604 100644 --- a/docs/v1/DashboardListDeleteResponse.md +++ b/docs/v1/DashboardListDeleteResponse.md @@ -6,7 +6,8 @@ Deleted dashboard details. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted_dashboard_list_id** | **int** | ID of the deleted dashboard list. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardListListResponse.md b/docs/v1/DashboardListListResponse.md index 28ceaa0d2e..315bf68ead 100644 --- a/docs/v1/DashboardListListResponse.md +++ b/docs/v1/DashboardListListResponse.md @@ -6,7 +6,8 @@ Information on your dashboard lists. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboard_lists** | [**[DashboardList]**](DashboardList.md) | List of all your dashboard lists. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardListsApi.md b/docs/v1/DashboardListsApi.md index db6a5a987c..b118d999bb 100644 --- a/docs/v1/DashboardListsApi.md +++ b/docs/v1/DashboardListsApi.md @@ -35,18 +35,7 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dashboard_lists_api.DashboardListsApi(api_client) body = DashboardList( - author=Creator( - email="email_example", - handle="handle_example", - name="name_example", - ), - created=dateutil_parser('1970-01-01T00:00:00.00Z'), - dashboard_count=1, - id=1, - is_favorite=True, - modified=dateutil_parser('1970-01-01T00:00:00.00Z'), name="My Dashboard", - type="manual_dashboard_list", ) # DashboardList | Create a dashboard list request body. # example passing only required values which don't have defaults set @@ -300,18 +289,7 @@ with ApiClient(configuration) as api_client: api_instance = dashboard_lists_api.DashboardListsApi(api_client) list_id = 1 # int | ID of the dashboard list to update. body = DashboardList( - author=Creator( - email="email_example", - handle="handle_example", - name="name_example", - ), - created=dateutil_parser('1970-01-01T00:00:00.00Z'), - dashboard_count=1, - id=1, - is_favorite=True, - modified=dateutil_parser('1970-01-01T00:00:00.00Z'), name="My Dashboard", - type="manual_dashboard_list", ) # DashboardList | Update a dashboard list request body. # example passing only required values which don't have defaults set diff --git a/docs/v1/DashboardReflowType.md b/docs/v1/DashboardReflowType.md index 59c418da83..908f2dca9a 100644 --- a/docs/v1/DashboardReflowType.md +++ b/docs/v1/DashboardReflowType.md @@ -6,7 +6,8 @@ Reflow type for a **new dashboard layout** dashboard. Set this only when layout Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Reflow type for a **new dashboard layout** dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts. | must be one of ["auto", "fixed", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardResourceType.md b/docs/v1/DashboardResourceType.md index 78ecc035ae..c7dfe06641 100644 --- a/docs/v1/DashboardResourceType.md +++ b/docs/v1/DashboardResourceType.md @@ -6,7 +6,8 @@ Dashboard resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Dashboard resource type. | defaults to "dashboard", must be one of ["dashboard", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardRestoreRequest.md b/docs/v1/DashboardRestoreRequest.md index 88c87efd30..b24683aed3 100644 --- a/docs/v1/DashboardRestoreRequest.md +++ b/docs/v1/DashboardRestoreRequest.md @@ -6,7 +6,8 @@ Dashboard restore request body. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**DashboardBulkActionDataList**](DashboardBulkActionDataList.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardSummary.md b/docs/v1/DashboardSummary.md index 2fa874b7d3..faa3c42cda 100644 --- a/docs/v1/DashboardSummary.md +++ b/docs/v1/DashboardSummary.md @@ -6,7 +6,8 @@ Dashboard summary response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboards** | [**[DashboardSummaryDefinition]**](DashboardSummaryDefinition.md) | List of dashboard definitions. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardSummaryDefinition.md b/docs/v1/DashboardSummaryDefinition.md index 22566c135c..d002368555 100644 --- a/docs/v1/DashboardSummaryDefinition.md +++ b/docs/v1/DashboardSummaryDefinition.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **modified_at** | **datetime** | Modification date of the dashboard. | [optional] **title** | **str** | Title of the dashboard. | [optional] **url** | **str** | URL of the dashboard. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardTemplateVariable.md b/docs/v1/DashboardTemplateVariable.md index f7218c7950..5236da1a78 100644 --- a/docs/v1/DashboardTemplateVariable.md +++ b/docs/v1/DashboardTemplateVariable.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **name** | **str** | The name of the variable. | **default** | **str, none_type** | The default value for the template variable on dashboard load. | [optional] **prefix** | **str, none_type** | The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardTemplateVariablePreset.md b/docs/v1/DashboardTemplateVariablePreset.md index c3a4316171..0124eee438 100644 --- a/docs/v1/DashboardTemplateVariablePreset.md +++ b/docs/v1/DashboardTemplateVariablePreset.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the variable. | [optional] **template_variables** | [**[DashboardTemplateVariablePresetValue]**](DashboardTemplateVariablePresetValue.md) | List of variables. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardTemplateVariablePresetValue.md b/docs/v1/DashboardTemplateVariablePresetValue.md index 09473be9b2..73aee85807 100644 --- a/docs/v1/DashboardTemplateVariablePresetValue.md +++ b/docs/v1/DashboardTemplateVariablePresetValue.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The name of the variable. | [optional] **value** | **str** | The value of the template variable within the saved view. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DashboardsApi.md b/docs/v1/DashboardsApi.md index ae4c0ed308..c34f115420 100644 --- a/docs/v1/DashboardsApi.md +++ b/docs/v1/DashboardsApi.md @@ -38,13 +38,9 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = dashboards_api.DashboardsApi(api_client) body = Dashboard( - author_handle="test@datadoghq.com", - created_at=dateutil_parser('1970-01-01T00:00:00.00Z'), description="description_example", - id="123-abc-456", is_read_only=False, layout_type=DashboardLayoutType("ordered"), - modified_at=dateutil_parser('1970-01-01T00:00:00.00Z'), notify_list=[ "notify_list_example", ], @@ -71,7 +67,6 @@ with ApiClient(configuration) as api_client: ), ], title="", - url="/dashboard/123-abc-456/example-dashboard-title", widgets=[ Widget( definition=WidgetDefinition(), @@ -488,13 +483,9 @@ with ApiClient(configuration) as api_client: api_instance = dashboards_api.DashboardsApi(api_client) dashboard_id = "dashboard_id_example" # str | The ID of the dashboard. body = Dashboard( - author_handle="test@datadoghq.com", - created_at=dateutil_parser('1970-01-01T00:00:00.00Z'), description="description_example", - id="123-abc-456", is_read_only=False, layout_type=DashboardLayoutType("ordered"), - modified_at=dateutil_parser('1970-01-01T00:00:00.00Z'), notify_list=[ "notify_list_example", ], @@ -521,7 +512,6 @@ with ApiClient(configuration) as api_client: ), ], title="", - url="/dashboard/123-abc-456/example-dashboard-title", widgets=[ Widget( definition=WidgetDefinition(), diff --git a/docs/v1/DeletedMonitor.md b/docs/v1/DeletedMonitor.md index 32e380ee92..9a2d722343 100644 --- a/docs/v1/DeletedMonitor.md +++ b/docs/v1/DeletedMonitor.md @@ -6,7 +6,8 @@ Response from the delete monitor call. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted_monitor_id** | **int** | ID of the deleted monitor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DistributionWidgetDefinition.md b/docs/v1/DistributionWidgetDefinition.md index 91e221d4d8..264b1b0f69 100644 --- a/docs/v1/DistributionWidgetDefinition.md +++ b/docs/v1/DistributionWidgetDefinition.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **title_size** | **str** | Size of the title. | [optional] **xaxis** | [**DistributionWidgetXAxis**](DistributionWidgetXAxis.md) | | [optional] **yaxis** | [**DistributionWidgetYAxis**](DistributionWidgetYAxis.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DistributionWidgetDefinitionType.md b/docs/v1/DistributionWidgetDefinitionType.md index 7d5fb08a80..248b8f8cfa 100644 --- a/docs/v1/DistributionWidgetDefinitionType.md +++ b/docs/v1/DistributionWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the distribution widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the distribution widget. | defaults to "distribution", must be one of ["distribution", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DistributionWidgetRequest.md b/docs/v1/DistributionWidgetRequest.md index 4ab4e71f5f..a7072eff34 100644 --- a/docs/v1/DistributionWidgetRequest.md +++ b/docs/v1/DistributionWidgetRequest.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **style** | [**WidgetStyle**](WidgetStyle.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DistributionWidgetXAxis.md b/docs/v1/DistributionWidgetXAxis.md index 5857210081..a00b1e7867 100644 --- a/docs/v1/DistributionWidgetXAxis.md +++ b/docs/v1/DistributionWidgetXAxis.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **max** | **str** | Specifies maximum value to show on the x-axis. It takes a number, percentile (p90 === 90th percentile), or auto for default behavior. | [optional] if omitted the server will use the default value of "auto" **min** | **str** | Specifies minimum value to show on the x-axis. It takes a number, percentile (p90 === 90th percentile), or auto for default behavior. | [optional] if omitted the server will use the default value of "auto" **scale** | **str** | Specifies the scale type. Possible values are `linear`. | [optional] if omitted the server will use the default value of "linear" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DistributionWidgetYAxis.md b/docs/v1/DistributionWidgetYAxis.md index 717a5e18b5..ad4d5080b5 100644 --- a/docs/v1/DistributionWidgetYAxis.md +++ b/docs/v1/DistributionWidgetYAxis.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **max** | **str** | Specifies the maximum value to show on the y-axis. It takes a number, or auto for default behavior. | [optional] if omitted the server will use the default value of "auto" **min** | **str** | Specifies minimum value to show on the y-axis. It takes a number, or auto for default behavior. | [optional] if omitted the server will use the default value of "auto" **scale** | **str** | Specifies the scale type. Possible values are `linear` or `log`. | [optional] if omitted the server will use the default value of "linear" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Downtime.md b/docs/v1/Downtime.md index 0e397d631f..f4f6b9545c 100644 --- a/docs/v1/Downtime.md +++ b/docs/v1/Downtime.md @@ -22,7 +22,8 @@ Name | Type | Description | Notes **start** | **int** | POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created. | [optional] **timezone** | **str** | The timezone in which to display the downtime's start and end times in Datadog applications. | [optional] **updater_id** | **int, none_type** | ID of the last user that updated the downtime. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DowntimeChild.md b/docs/v1/DowntimeChild.md index 3c97a01143..71543adfee 100644 --- a/docs/v1/DowntimeChild.md +++ b/docs/v1/DowntimeChild.md @@ -21,7 +21,8 @@ Name | Type | Description | Notes **start** | **int** | POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created. | [optional] **timezone** | **str** | The timezone in which to display the downtime's start and end times in Datadog applications. | [optional] **updater_id** | **int, none_type** | ID of the last user that updated the downtime. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DowntimeRecurrence.md b/docs/v1/DowntimeRecurrence.md index 9950ea76ab..769a07f65b 100644 --- a/docs/v1/DowntimeRecurrence.md +++ b/docs/v1/DowntimeRecurrence.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **until_date** | **int, none_type** | The date at which the recurrence should end as a POSIX timestamp. `until_occurences` and `until_date` are mutually exclusive. | [optional] **until_occurrences** | **int, none_type** | How many times the downtime is rescheduled. `until_occurences` and `until_date` are mutually exclusive. | [optional] **week_days** | **[str]** | A list of week days to repeat on. Choose from `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when type is weeks. First letter must be capitalized. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/DowntimesApi.md b/docs/v1/DowntimesApi.md index fbb8d3812c..70445e69d3 100644 --- a/docs/v1/DowntimesApi.md +++ b/docs/v1/DowntimesApi.md @@ -167,38 +167,8 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = downtimes_api.DowntimesApi(api_client) body = Downtime( - active=True, - active_child=DowntimeChild( - active=True, - canceled=1412799983, - creator_id=123456, - disabled=False, - downtime_type=2, - end=1412793983, - id=1626, - message="Message on the downtime", - monitor_id=123456, - monitor_tags=["*"], - parent_id=123, - recurrence=DowntimeRecurrence( - period=1, - rrule="FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1", - type="weeks", - until_date=1447786293, - until_occurrences=2, - week_days=["Mon","Tue"], - ), - scope=["env:staging"], - start=1412792983, - timezone="America/New_York", - updater_id=123456, - ), - canceled=1412799983, - creator_id=123456, disabled=False, - downtime_type=2, end=1412793983, - id=1625, message="Message on the downtime", monitor_id=123456, monitor_tags=["*"], @@ -214,7 +184,6 @@ with ApiClient(configuration) as api_client: scope=["env:staging"], start=1412792983, timezone="America/New_York", - updater_id=123456, ) # Downtime | Schedule a downtime request body. # example passing only required values which don't have defaults set @@ -473,38 +442,8 @@ with ApiClient(configuration) as api_client: api_instance = downtimes_api.DowntimesApi(api_client) downtime_id = 123456 # int | ID of the downtime to update. body = Downtime( - active=True, - active_child=DowntimeChild( - active=True, - canceled=1412799983, - creator_id=123456, - disabled=False, - downtime_type=2, - end=1412793983, - id=1626, - message="Message on the downtime", - monitor_id=123456, - monitor_tags=["*"], - parent_id=123, - recurrence=DowntimeRecurrence( - period=1, - rrule="FREQ=MONTHLY;BYSETPOS=3;BYDAY=WE;INTERVAL=1", - type="weeks", - until_date=1447786293, - until_occurrences=2, - week_days=["Mon","Tue"], - ), - scope=["env:staging"], - start=1412792983, - timezone="America/New_York", - updater_id=123456, - ), - canceled=1412799983, - creator_id=123456, disabled=False, - downtime_type=2, end=1412793983, - id=1625, message="Message on the downtime", monitor_id=123456, monitor_tags=["*"], @@ -520,7 +459,6 @@ with ApiClient(configuration) as api_client: scope=["env:staging"], start=1412792983, timezone="America/New_York", - updater_id=123456, ) # Downtime | Update a downtime request body. # example passing only required values which don't have defaults set diff --git a/docs/v1/Event.md b/docs/v1/Event.md index a227f0df7c..37a44f5445 100644 --- a/docs/v1/Event.md +++ b/docs/v1/Event.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **text** | **str** | The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with `%%% \\n` and end the text block with `\\n %%%`. Use `msg_text` with the Datadog Ruby library. | [optional] **title** | **str** | The event title. Limited to 100 characters. Use `msg_title` with the Datadog Ruby library. | [optional] **url** | **str** | URL of the event. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventAlertType.md b/docs/v1/EventAlertType.md index 2d72a8876d..ea65f7b24e 100644 --- a/docs/v1/EventAlertType.md +++ b/docs/v1/EventAlertType.md @@ -6,7 +6,8 @@ If an alert event is enabled, set its type. For example, `error`, `warning`, `in Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | If an alert event is enabled, set its type. For example, `error`, `warning`, `info`, `success`, `user_update`, `recommendation`, and `snapshot`. | must be one of ["error", "warning", "info", "success", "user_update", "recommendation", "snapshot", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventCreateRequest.md b/docs/v1/EventCreateRequest.md index 1848ab5029..adba5fb660 100644 --- a/docs/v1/EventCreateRequest.md +++ b/docs/v1/EventCreateRequest.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **source_type_name** | **str** | The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). | [optional] **tags** | **[str]** | A list of tags to apply to the event. | [optional] **url** | **str** | URL of the event. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventCreateResponse.md b/docs/v1/EventCreateResponse.md index 1d318ffd01..f91b34af56 100644 --- a/docs/v1/EventCreateResponse.md +++ b/docs/v1/EventCreateResponse.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **text** | **str** | The body of the event. Limited to 4000 characters. The text supports markdown. Use `msg_text` with the Datadog Ruby library. | [optional] **title** | **str** | The event title. Limited to 100 characters. Use `msg_title` with the Datadog Ruby library. | [optional] **url** | **str** | URL of the event. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventListResponse.md b/docs/v1/EventListResponse.md index dd8d3ae868..c91fe9cafc 100644 --- a/docs/v1/EventListResponse.md +++ b/docs/v1/EventListResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **events** | [**[Event]**](Event.md) | An array of events. | [optional] **status** | **str** | A status. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventPriority.md b/docs/v1/EventPriority.md index 1950c320e1..1f63c583af 100644 --- a/docs/v1/EventPriority.md +++ b/docs/v1/EventPriority.md @@ -6,7 +6,8 @@ The priority of the event. For example, `normal` or `low`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The priority of the event. For example, `normal` or `low`. | must be one of ["normal", "low", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventQueryDefinition.md b/docs/v1/EventQueryDefinition.md index 91f8f0d953..a630cd4794 100644 --- a/docs/v1/EventQueryDefinition.md +++ b/docs/v1/EventQueryDefinition.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **search** | **str** | The query being made on the event. | **tags_execution** | **str** | The execution method for multi-value filters. Can be either and or or. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventResponse.md b/docs/v1/EventResponse.md index 63e618d335..327a3c723b 100644 --- a/docs/v1/EventResponse.md +++ b/docs/v1/EventResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event** | [**Event**](Event.md) | | [optional] **status** | **str** | A status. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventStreamWidgetDefinition.md b/docs/v1/EventStreamWidgetDefinition.md index bf8a4268ab..845c2eeed6 100644 --- a/docs/v1/EventStreamWidgetDefinition.md +++ b/docs/v1/EventStreamWidgetDefinition.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventStreamWidgetDefinitionType.md b/docs/v1/EventStreamWidgetDefinitionType.md index 9756c633d0..a221020fe6 100644 --- a/docs/v1/EventStreamWidgetDefinitionType.md +++ b/docs/v1/EventStreamWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the event stream widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the event stream widget. | defaults to "event_stream", must be one of ["event_stream", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventTimelineWidgetDefinition.md b/docs/v1/EventTimelineWidgetDefinition.md index 7f2670c8fc..475840cd14 100644 --- a/docs/v1/EventTimelineWidgetDefinition.md +++ b/docs/v1/EventTimelineWidgetDefinition.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventTimelineWidgetDefinitionType.md b/docs/v1/EventTimelineWidgetDefinitionType.md index a9e8b8848d..85296f3712 100644 --- a/docs/v1/EventTimelineWidgetDefinitionType.md +++ b/docs/v1/EventTimelineWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the event timeline widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the event timeline widget. | defaults to "event_timeline", must be one of ["event_timeline", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/EventsApi.md b/docs/v1/EventsApi.md index 16c621b3d8..800a2ea98f 100644 --- a/docs/v1/EventsApi.md +++ b/docs/v1/EventsApi.md @@ -38,15 +38,12 @@ with ApiClient(configuration) as api_client: date_happened=1, device_name="device_name_example", host="host_example", - id=1, - payload="{}", priority=EventPriority("normal"), related_event_id=1, source_type_name="source_type_name_example", tags=["environment:test"], text="Oh boy!", title="Did you hear the news today?", - url="url_example", ) # EventCreateRequest | Event request object # example passing only required values which don't have defaults set diff --git a/docs/v1/FormulaAndFunctionEventAggregation.md b/docs/v1/FormulaAndFunctionEventAggregation.md index 9e47946ee8..51f1e8e399 100644 --- a/docs/v1/FormulaAndFunctionEventAggregation.md +++ b/docs/v1/FormulaAndFunctionEventAggregation.md @@ -6,7 +6,8 @@ Aggregation methods for event platform queries. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Aggregation methods for event platform queries. | must be one of ["count", "cardinality", "median", "pc75", "pc90", "pc95", "pc98", "pc99", "sum", "min", "max", "avg", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionEventQueryDefinition.md b/docs/v1/FormulaAndFunctionEventQueryDefinition.md index ee0ce7a5d1..15ae202b14 100644 --- a/docs/v1/FormulaAndFunctionEventQueryDefinition.md +++ b/docs/v1/FormulaAndFunctionEventQueryDefinition.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **group_by** | [**[FormulaAndFunctionEventQueryGroupBy]**](FormulaAndFunctionEventQueryGroupBy.md) | Group by options. | [optional] **indexes** | **[str]** | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once. | [optional] **search** | [**FormulaAndFunctionEventQueryDefinitionSearch**](FormulaAndFunctionEventQueryDefinitionSearch.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionEventQueryDefinitionCompute.md b/docs/v1/FormulaAndFunctionEventQueryDefinitionCompute.md index 96a6bfd586..dcf8a01793 100644 --- a/docs/v1/FormulaAndFunctionEventQueryDefinitionCompute.md +++ b/docs/v1/FormulaAndFunctionEventQueryDefinitionCompute.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **aggregation** | [**FormulaAndFunctionEventAggregation**](FormulaAndFunctionEventAggregation.md) | | **interval** | **int** | A time interval in milliseconds. | [optional] **metric** | **str** | Measurable attribute to compute. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionEventQueryDefinitionSearch.md b/docs/v1/FormulaAndFunctionEventQueryDefinitionSearch.md index f47245ac54..53920d7398 100644 --- a/docs/v1/FormulaAndFunctionEventQueryDefinitionSearch.md +++ b/docs/v1/FormulaAndFunctionEventQueryDefinitionSearch.md @@ -6,7 +6,8 @@ Search options. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **query** | **str** | Events search string. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionEventQueryGroupBy.md b/docs/v1/FormulaAndFunctionEventQueryGroupBy.md index 4b9e0d8c61..ea8ed5be14 100644 --- a/docs/v1/FormulaAndFunctionEventQueryGroupBy.md +++ b/docs/v1/FormulaAndFunctionEventQueryGroupBy.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **facet** | **str** | Event facet. | **limit** | **int** | Number of groups to return. | [optional] **sort** | [**FormulaAndFunctionEventQueryGroupBySort**](FormulaAndFunctionEventQueryGroupBySort.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionEventQueryGroupBySort.md b/docs/v1/FormulaAndFunctionEventQueryGroupBySort.md index 8a5024d63c..0474011235 100644 --- a/docs/v1/FormulaAndFunctionEventQueryGroupBySort.md +++ b/docs/v1/FormulaAndFunctionEventQueryGroupBySort.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **aggregation** | [**FormulaAndFunctionEventAggregation**](FormulaAndFunctionEventAggregation.md) | | **metric** | **str** | Metric used for sorting group by results. | [optional] **order** | [**QuerySortOrder**](QuerySortOrder.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionEventsDataSource.md b/docs/v1/FormulaAndFunctionEventsDataSource.md index 1525746684..632a6b7cb6 100644 --- a/docs/v1/FormulaAndFunctionEventsDataSource.md +++ b/docs/v1/FormulaAndFunctionEventsDataSource.md @@ -6,7 +6,8 @@ Data source for event platform-based queries. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Data source for event platform-based queries. | must be one of ["logs", "spans", "network", "rum", "security_signals", "profiles", "audit", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionMetricAggregation.md b/docs/v1/FormulaAndFunctionMetricAggregation.md index 0029cdf5ce..df3995a5de 100644 --- a/docs/v1/FormulaAndFunctionMetricAggregation.md +++ b/docs/v1/FormulaAndFunctionMetricAggregation.md @@ -6,7 +6,8 @@ The aggregation methods available for metrics queries. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The aggregation methods available for metrics queries. | must be one of ["avg", "min", "max", "sum", "last", "area", "l2norm", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionMetricDataSource.md b/docs/v1/FormulaAndFunctionMetricDataSource.md index 684dae2c66..52f9a7bd10 100644 --- a/docs/v1/FormulaAndFunctionMetricDataSource.md +++ b/docs/v1/FormulaAndFunctionMetricDataSource.md @@ -6,7 +6,8 @@ Data source for metrics queries. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Data source for metrics queries. | defaults to "metrics", must be one of ["metrics", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionMetricQueryDefinition.md b/docs/v1/FormulaAndFunctionMetricQueryDefinition.md index b085c376b0..0a0ede4034 100644 --- a/docs/v1/FormulaAndFunctionMetricQueryDefinition.md +++ b/docs/v1/FormulaAndFunctionMetricQueryDefinition.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **name** | **str** | Name of the query for use in formulas. | **query** | **str** | Metrics query definition. | **aggregator** | [**FormulaAndFunctionMetricAggregation**](FormulaAndFunctionMetricAggregation.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionProcessQueryDataSource.md b/docs/v1/FormulaAndFunctionProcessQueryDataSource.md index 087261185f..eb05924adc 100644 --- a/docs/v1/FormulaAndFunctionProcessQueryDataSource.md +++ b/docs/v1/FormulaAndFunctionProcessQueryDataSource.md @@ -6,7 +6,8 @@ Data sources that rely on the process backend. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Data sources that rely on the process backend. | must be one of ["process", "container", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionProcessQueryDefinition.md b/docs/v1/FormulaAndFunctionProcessQueryDefinition.md index 808bb6a3d4..11820b0799 100644 --- a/docs/v1/FormulaAndFunctionProcessQueryDefinition.md +++ b/docs/v1/FormulaAndFunctionProcessQueryDefinition.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **sort** | [**QuerySortOrder**](QuerySortOrder.md) | | [optional] **tag_filters** | **[str]** | An array of tags to filter by. | [optional] **text_filter** | **str** | Text to use as filter. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionQueryDefinition.md b/docs/v1/FormulaAndFunctionQueryDefinition.md index 7949abd143..4b0bab84b9 100644 --- a/docs/v1/FormulaAndFunctionQueryDefinition.md +++ b/docs/v1/FormulaAndFunctionQueryDefinition.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **FormulaAndFunctionMetricQueryDefinition** | [**FormulaAndFunctionMetricQueryDefinition**](FormulaAndFunctionMetricQueryDefinition.md) | Container class of the relevant properties. | **FormulaAndFunctionProcessQueryDefinition** | [**FormulaAndFunctionProcessQueryDefinition**](FormulaAndFunctionProcessQueryDefinition.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FormulaAndFunctionResponseFormat.md b/docs/v1/FormulaAndFunctionResponseFormat.md index 292dab0ee2..1806b35140 100644 --- a/docs/v1/FormulaAndFunctionResponseFormat.md +++ b/docs/v1/FormulaAndFunctionResponseFormat.md @@ -6,7 +6,8 @@ Timeseries or Scalar response. **This feature is currently in beta.** Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Timeseries or Scalar response. **This feature is currently in beta.** | must be one of ["timeseries", "scalar", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FreeTextWidgetDefinition.md b/docs/v1/FreeTextWidgetDefinition.md index 52192451a2..e5a2d4b9e0 100644 --- a/docs/v1/FreeTextWidgetDefinition.md +++ b/docs/v1/FreeTextWidgetDefinition.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **color** | **str** | Color of the text. | [optional] **font_size** | **str** | Size of the text. | [optional] **text_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/FreeTextWidgetDefinitionType.md b/docs/v1/FreeTextWidgetDefinitionType.md index 7616b4cb5e..db16c33d49 100644 --- a/docs/v1/FreeTextWidgetDefinitionType.md +++ b/docs/v1/FreeTextWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the free text widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the free text widget. | defaults to "free_text", must be one of ["free_text", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GCPAccount.md b/docs/v1/GCPAccount.md index 410e205cea..2f1cf1ea59 100644 --- a/docs/v1/GCPAccount.md +++ b/docs/v1/GCPAccount.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **project_id** | **str** | Your Google Cloud project ID found in your JSON service account key. | [optional] **token_uri** | **str** | Should be `https://accounts.google.com/o/oauth2/token`. | [optional] **type** | **str** | The value for service_account found in your JSON service account key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GCPAccountListResponse.md b/docs/v1/GCPAccountListResponse.md index ba5cf8609b..0f9eb2299d 100644 --- a/docs/v1/GCPAccountListResponse.md +++ b/docs/v1/GCPAccountListResponse.md @@ -6,7 +6,8 @@ Array of GCP account responses. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[GCPAccount]**](GCPAccount.md) | Array of GCP account responses. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GeomapWidgetDefinition.md b/docs/v1/GeomapWidgetDefinition.md index 2f4317c13b..58cf525f97 100644 --- a/docs/v1/GeomapWidgetDefinition.md +++ b/docs/v1/GeomapWidgetDefinition.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **title** | **str** | The title of your widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | The size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GeomapWidgetDefinitionStyle.md b/docs/v1/GeomapWidgetDefinitionStyle.md index a42323429f..978f72782d 100644 --- a/docs/v1/GeomapWidgetDefinitionStyle.md +++ b/docs/v1/GeomapWidgetDefinitionStyle.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **palette** | **str** | The color palette to apply to the widget. | **palette_flip** | **bool** | Whether to flip the palette tones. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GeomapWidgetDefinitionType.md b/docs/v1/GeomapWidgetDefinitionType.md index f34057ca49..4a317c79fe 100644 --- a/docs/v1/GeomapWidgetDefinitionType.md +++ b/docs/v1/GeomapWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the geomap widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the geomap widget. | defaults to "geomap", must be one of ["geomap", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GeomapWidgetDefinitionView.md b/docs/v1/GeomapWidgetDefinitionView.md index bc81e73fd9..6824207255 100644 --- a/docs/v1/GeomapWidgetDefinitionView.md +++ b/docs/v1/GeomapWidgetDefinitionView.md @@ -6,7 +6,8 @@ The view of the world that the map should render. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **focus** | **str** | The 2-letter ISO code of a country to focus the map on. Or `WORLD`. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GeomapWidgetRequest.md b/docs/v1/GeomapWidgetRequest.md index e40bf92a92..312dddd587 100644 --- a/docs/v1/GeomapWidgetRequest.md +++ b/docs/v1/GeomapWidgetRequest.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **response_format** | [**FormulaAndFunctionResponseFormat**](FormulaAndFunctionResponseFormat.md) | | [optional] **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GraphSnapshot.md b/docs/v1/GraphSnapshot.md index f4ad77ec0d..6c8d3d76d6 100644 --- a/docs/v1/GraphSnapshot.md +++ b/docs/v1/GraphSnapshot.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **graph_def** | **str** | A JSON document defining the graph. `graph_def` can be used instead of `metric_query`. The JSON document uses the [grammar defined here](https://docs.datadoghq.com/graphing/graphing_json/#grammar) and should be formatted to a single line then URL encoded. | [optional] **metric_query** | **str** | The metric query. One of `metric_query` or `graph_def` is required. | [optional] **snapshot_url** | **str** | URL of your [graph snapshot](https://docs.datadoghq.com/metrics/explorer/#snapshot). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GroupWidgetDefinition.md b/docs/v1/GroupWidgetDefinition.md index 5356a48b4b..a4ee6b869c 100644 --- a/docs/v1/GroupWidgetDefinition.md +++ b/docs/v1/GroupWidgetDefinition.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **show_title** | **bool** | Whether to show the title or not. | [optional] if omitted the server will use the default value of True **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/GroupWidgetDefinitionType.md b/docs/v1/GroupWidgetDefinitionType.md index 57ce99f154..8479896401 100644 --- a/docs/v1/GroupWidgetDefinitionType.md +++ b/docs/v1/GroupWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the group widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the group widget. | defaults to "group", must be one of ["group", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HTTPLog.md b/docs/v1/HTTPLog.md index d8949c3989..74ab84af24 100644 --- a/docs/v1/HTTPLog.md +++ b/docs/v1/HTTPLog.md @@ -6,7 +6,8 @@ Structured log message. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[HTTPLogItem]**](HTTPLogItem.md) | Structured log message. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HTTPLogError.md b/docs/v1/HTTPLogError.md index 8a87f6581a..88816bdebf 100644 --- a/docs/v1/HTTPLogError.md +++ b/docs/v1/HTTPLogError.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **int** | Error code. | **message** | **str** | Error message. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HTTPLogItem.md b/docs/v1/HTTPLogItem.md index b79fa92926..c892a592e1 100644 --- a/docs/v1/HTTPLogItem.md +++ b/docs/v1/HTTPLogItem.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **hostname** | **str** | The name of the originating host of the log. | [optional] **message** | **str** | The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes) of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry. That value is then highlighted and displayed in the Logstream, where it is indexed for full text search. | [optional] **service** | **str** | The name of the application or service generating the log events. It is used to switch from Logs to APM, so make sure you define the same value when you use both products. See [reserved attributes](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HTTPMethod.md b/docs/v1/HTTPMethod.md index 47394c9d25..8c96f72049 100644 --- a/docs/v1/HTTPMethod.md +++ b/docs/v1/HTTPMethod.md @@ -6,7 +6,8 @@ The HTTP method. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The HTTP method. | must be one of ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HeatMapWidgetDefinition.md b/docs/v1/HeatMapWidgetDefinition.md index d15ee914c9..e473473e81 100644 --- a/docs/v1/HeatMapWidgetDefinition.md +++ b/docs/v1/HeatMapWidgetDefinition.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] **yaxis** | [**WidgetAxis**](WidgetAxis.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HeatMapWidgetDefinitionType.md b/docs/v1/HeatMapWidgetDefinitionType.md index d31b0f2039..25cbda569c 100644 --- a/docs/v1/HeatMapWidgetDefinitionType.md +++ b/docs/v1/HeatMapWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the heat map widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the heat map widget. | defaults to "heatmap", must be one of ["heatmap", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HeatMapWidgetRequest.md b/docs/v1/HeatMapWidgetRequest.md index c2c8f2950c..f27b41329b 100644 --- a/docs/v1/HeatMapWidgetRequest.md +++ b/docs/v1/HeatMapWidgetRequest.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **style** | [**WidgetStyle**](WidgetStyle.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Host.md b/docs/v1/Host.md index 1bbf85fad8..f80098b113 100644 --- a/docs/v1/Host.md +++ b/docs/v1/Host.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **sources** | **[str]** | Source or cloud provider associated with your host. | [optional] **tags_by_source** | **{str: ([str],)}** | List of tags for each source (AWS, Datadog Agent, Chef..). | [optional] **up** | **bool** | Displays UP when the expected metrics are received and displays `???` if no metrics are received. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostListResponse.md b/docs/v1/HostListResponse.md index 614c9abd44..c0d6132447 100644 --- a/docs/v1/HostListResponse.md +++ b/docs/v1/HostListResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **host_list** | [**[Host]**](Host.md) | Array of hosts. | [optional] **total_matching** | **int** | Number of host matching the query. | [optional] **total_returned** | **int** | Number of host returned. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMapRequest.md b/docs/v1/HostMapRequest.md index 61ace7d389..e4c171e760 100644 --- a/docs/v1/HostMapRequest.md +++ b/docs/v1/HostMapRequest.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **q** | **str** | Query definition. | [optional] **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMapWidgetDefinition.md b/docs/v1/HostMapWidgetDefinition.md index 8fc53c86b6..060276b321 100644 --- a/docs/v1/HostMapWidgetDefinition.md +++ b/docs/v1/HostMapWidgetDefinition.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMapWidgetDefinitionRequests.md b/docs/v1/HostMapWidgetDefinitionRequests.md index 64fb3e44c3..113c1cc2e8 100644 --- a/docs/v1/HostMapWidgetDefinitionRequests.md +++ b/docs/v1/HostMapWidgetDefinitionRequests.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **fill** | [**HostMapRequest**](HostMapRequest.md) | | [optional] **size** | [**HostMapRequest**](HostMapRequest.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMapWidgetDefinitionStyle.md b/docs/v1/HostMapWidgetDefinitionStyle.md index 5955a503dc..68cb0749d4 100644 --- a/docs/v1/HostMapWidgetDefinitionStyle.md +++ b/docs/v1/HostMapWidgetDefinitionStyle.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **fill_min** | **str** | Min value to use to color the map. | [optional] **palette** | **str** | Color palette to apply to the widget. | [optional] **palette_flip** | **bool** | Whether to flip the palette tones. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMapWidgetDefinitionType.md b/docs/v1/HostMapWidgetDefinitionType.md index 135db7f6bf..f8d0ddd71f 100644 --- a/docs/v1/HostMapWidgetDefinitionType.md +++ b/docs/v1/HostMapWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the host map widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the host map widget. | defaults to "hostmap", must be one of ["hostmap", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMeta.md b/docs/v1/HostMeta.md index ee7e36837d..89c3bdc28a 100644 --- a/docs/v1/HostMeta.md +++ b/docs/v1/HostMeta.md @@ -6,7 +6,8 @@ Metadata associated with your host. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **nix_v** | **[str]** | Array of Unix versions. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMetrics.md b/docs/v1/HostMetrics.md index 7b95b9e3cc..5ec673f8d8 100644 --- a/docs/v1/HostMetrics.md +++ b/docs/v1/HostMetrics.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **cpu** | **float** | The percent of CPU used (everything but idle). | [optional] **iowait** | **float** | The percent of CPU spent waiting on the IO (not reported for all platforms). | [optional] **load** | **float** | The system load over the last 15 minutes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMuteResponse.md b/docs/v1/HostMuteResponse.md index 511ad369bd..4ad5566c7b 100644 --- a/docs/v1/HostMuteResponse.md +++ b/docs/v1/HostMuteResponse.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **end** | **int** | POSIX timestamp in seconds when the host is unmuted. | [optional] **hostname** | **str** | The host name. | [optional] **message** | **str** | Message associated with the mute. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostMuteSettings.md b/docs/v1/HostMuteSettings.md index cd9993f845..6ce0c7cc60 100644 --- a/docs/v1/HostMuteSettings.md +++ b/docs/v1/HostMuteSettings.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **end** | **int** | POSIX timestamp in seconds when the host is unmuted. If omitted, the host remains muted until explicitly unmuted. | [optional] **message** | **str** | Message to associate with the muting of this host. | [optional] **override** | **bool** | If true and the host is already muted, replaces existing host mute settings. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostTags.md b/docs/v1/HostTags.md index 6dc4c15ce7..b5c7e5463f 100644 --- a/docs/v1/HostTags.md +++ b/docs/v1/HostTags.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **host** | **str** | Your host name. | [optional] **tags** | **[str]** | A list of tags to apply to the host. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/HostTotals.md b/docs/v1/HostTotals.md index a290bdbd66..d1d318007f 100644 --- a/docs/v1/HostTotals.md +++ b/docs/v1/HostTotals.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_active** | **int** | Total number of active host (UP and ???) reporting to Datadog. | [optional] **total_up** | **int** | Number of host that are UP and reporting to Datadog. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IFrameWidgetDefinition.md b/docs/v1/IFrameWidgetDefinition.md index 70a0e3999c..9f990f6feb 100644 --- a/docs/v1/IFrameWidgetDefinition.md +++ b/docs/v1/IFrameWidgetDefinition.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**IFrameWidgetDefinitionType**](IFrameWidgetDefinitionType.md) | | **url** | **str** | URL of the iframe. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IFrameWidgetDefinitionType.md b/docs/v1/IFrameWidgetDefinitionType.md index 571c762ce8..de439746bb 100644 --- a/docs/v1/IFrameWidgetDefinitionType.md +++ b/docs/v1/IFrameWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the iframe widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the iframe widget. | defaults to "iframe", must be one of ["iframe", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesAPI.md b/docs/v1/IPPrefixesAPI.md index 0286edec29..244299a770 100644 --- a/docs/v1/IPPrefixesAPI.md +++ b/docs/v1/IPPrefixesAPI.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prefixes_ipv4** | **[str]** | List of IPv4 prefixes. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesAPM.md b/docs/v1/IPPrefixesAPM.md index 34784596fe..788d4c4dee 100644 --- a/docs/v1/IPPrefixesAPM.md +++ b/docs/v1/IPPrefixesAPM.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prefixes_ipv4** | **[str]** | List of IPv4 prefixes. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesAgents.md b/docs/v1/IPPrefixesAgents.md index ccbe8a2c4b..be66d18cad 100644 --- a/docs/v1/IPPrefixesAgents.md +++ b/docs/v1/IPPrefixesAgents.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prefixes_ipv4** | **[str]** | List of IPv4 prefixes. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesLogs.md b/docs/v1/IPPrefixesLogs.md index 6f19c409fd..b60484d2a7 100644 --- a/docs/v1/IPPrefixesLogs.md +++ b/docs/v1/IPPrefixesLogs.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prefixes_ipv4** | **[str]** | List of IPv4 prefixes. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesProcess.md b/docs/v1/IPPrefixesProcess.md index 4e489f0520..1d21c58076 100644 --- a/docs/v1/IPPrefixesProcess.md +++ b/docs/v1/IPPrefixesProcess.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prefixes_ipv4** | **[str]** | List of IPv4 prefixes. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesSynthetics.md b/docs/v1/IPPrefixesSynthetics.md index 3d0b88710d..92b69ce364 100644 --- a/docs/v1/IPPrefixesSynthetics.md +++ b/docs/v1/IPPrefixesSynthetics.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **prefixes_ipv4_by_location** | **{str: ([str],)}** | List of IPv4 prefixes by location. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] **prefixes_ipv6_by_location** | **{str: ([str],)}** | List of IPv6 prefixes by location. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPPrefixesWebhooks.md b/docs/v1/IPPrefixesWebhooks.md index 7e44db40bf..682915129e 100644 --- a/docs/v1/IPPrefixesWebhooks.md +++ b/docs/v1/IPPrefixesWebhooks.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **prefixes_ipv4** | **[str]** | List of IPv4 prefixes. | [optional] **prefixes_ipv6** | **[str]** | List of IPv6 prefixes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IPRanges.md b/docs/v1/IPRanges.md index defbbc14e8..d864dbd61f 100644 --- a/docs/v1/IPRanges.md +++ b/docs/v1/IPRanges.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **synthetics** | [**IPPrefixesSynthetics**](IPPrefixesSynthetics.md) | | [optional] **version** | **int** | Version of the IP list. | [optional] **webhooks** | [**IPPrefixesWebhooks**](IPPrefixesWebhooks.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IdpFormData.md b/docs/v1/IdpFormData.md index 95307a11b5..5a41a94259 100644 --- a/docs/v1/IdpFormData.md +++ b/docs/v1/IdpFormData.md @@ -6,7 +6,8 @@ Object describing the IdP configuration. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **idp_file** | **file_type** | The path to the XML metadata file you wish to upload. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IdpResponse.md b/docs/v1/IdpResponse.md index c345673a23..e2ba369fb6 100644 --- a/docs/v1/IdpResponse.md +++ b/docs/v1/IdpResponse.md @@ -6,7 +6,8 @@ The IdP response object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Identity provider response. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ImageWidgetDefinition.md b/docs/v1/ImageWidgetDefinition.md index 131be91c95..33afdfecc7 100644 --- a/docs/v1/ImageWidgetDefinition.md +++ b/docs/v1/ImageWidgetDefinition.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **sizing** | [**WidgetImageSizing**](WidgetImageSizing.md) | | [optional] **url_dark_theme** | **str** | URL of the image in dark mode. | [optional] **vertical_align** | [**WidgetVerticalAlign**](WidgetVerticalAlign.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ImageWidgetDefinitionType.md b/docs/v1/ImageWidgetDefinitionType.md index ed1fbb6093..cf5f41d7e3 100644 --- a/docs/v1/ImageWidgetDefinitionType.md +++ b/docs/v1/ImageWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the image widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the image widget. | defaults to "image", must be one of ["image", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/IntakePayloadAccepted.md b/docs/v1/IntakePayloadAccepted.md index 18e60bd511..05a44226fc 100644 --- a/docs/v1/IntakePayloadAccepted.md +++ b/docs/v1/IntakePayloadAccepted.md @@ -6,7 +6,8 @@ The payload accepted for intake. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | **str** | The status of the intake payload. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/KeyManagementApi.md b/docs/v1/KeyManagementApi.md index ef88a5b0fe..dd6c4fdca6 100644 --- a/docs/v1/KeyManagementApi.md +++ b/docs/v1/KeyManagementApi.md @@ -40,9 +40,6 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = key_management_api.KeyManagementApi(api_client) body = ApiKey( - created="2019-08-02 15:31:07", - created_by="john@example.com", - key="1234512345123456abcabc912349abcd", name="example user", ) # ApiKey | @@ -109,9 +106,7 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = key_management_api.KeyManagementApi(api_client) body = ApplicationKey( - hash="1234512345123459cda4eb9ced49a3d84fd0138c", name="example user", - owner="example.com", ) # ApplicationKey | # example passing only required values which don't have defaults set @@ -554,9 +549,6 @@ with ApiClient(configuration) as api_client: api_instance = key_management_api.KeyManagementApi(api_client) key = "key_example" # str | The specific API key you are working with. body = ApiKey( - created="2019-08-02 15:31:07", - created_by="john@example.com", - key="1234512345123456abcabc912349abcd", name="example user", ) # ApiKey | @@ -626,9 +618,7 @@ with ApiClient(configuration) as api_client: api_instance = key_management_api.KeyManagementApi(api_client) key = "key_example" # str | The specific APP key you are working with. body = ApplicationKey( - hash="1234512345123459cda4eb9ced49a3d84fd0138c", name="example user", - owner="example.com", ) # ApplicationKey | # example passing only required values which don't have defaults set diff --git a/docs/v1/ListStreamColumn.md b/docs/v1/ListStreamColumn.md index 8fa0e23267..c0a321fb49 100644 --- a/docs/v1/ListStreamColumn.md +++ b/docs/v1/ListStreamColumn.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **field** | **str** | Widget column field. | **width** | [**ListStreamColumnWidth**](ListStreamColumnWidth.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamColumnWidth.md b/docs/v1/ListStreamColumnWidth.md index 43f202246d..fc4de51aac 100644 --- a/docs/v1/ListStreamColumnWidth.md +++ b/docs/v1/ListStreamColumnWidth.md @@ -6,7 +6,8 @@ Widget column width. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Widget column width. | must be one of ["auto", "compact", "full", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamQuery.md b/docs/v1/ListStreamQuery.md index a014512dfe..8f4df04d4b 100644 --- a/docs/v1/ListStreamQuery.md +++ b/docs/v1/ListStreamQuery.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data_source** | [**ListStreamSource**](ListStreamSource.md) | | **query_string** | **str** | Widget query. | **indexes** | **[str]** | List of indexes. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamResponseFormat.md b/docs/v1/ListStreamResponseFormat.md index 056ea16471..57c91bed83 100644 --- a/docs/v1/ListStreamResponseFormat.md +++ b/docs/v1/ListStreamResponseFormat.md @@ -6,7 +6,8 @@ Widget response format. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Widget response format. | defaults to "event_list", must be one of ["event_list", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamSource.md b/docs/v1/ListStreamSource.md index 894ef62576..bc1a46b25a 100644 --- a/docs/v1/ListStreamSource.md +++ b/docs/v1/ListStreamSource.md @@ -6,7 +6,8 @@ Source from which to query items to display in the stream. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Source from which to query items to display in the stream. | defaults to "issue_stream", must be one of ["issue_stream", "logs_stream", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamWidgetDefinition.md b/docs/v1/ListStreamWidgetDefinition.md index b326b7f680..f6eb08fa65 100644 --- a/docs/v1/ListStreamWidgetDefinition.md +++ b/docs/v1/ListStreamWidgetDefinition.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamWidgetDefinitionType.md b/docs/v1/ListStreamWidgetDefinitionType.md index 8bceb20a44..a62041da8c 100644 --- a/docs/v1/ListStreamWidgetDefinitionType.md +++ b/docs/v1/ListStreamWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the list stream widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the list stream widget. | defaults to "list_stream", must be one of ["list_stream", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ListStreamWidgetRequest.md b/docs/v1/ListStreamWidgetRequest.md index 374e135782..fee12bfe7d 100644 --- a/docs/v1/ListStreamWidgetRequest.md +++ b/docs/v1/ListStreamWidgetRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **columns** | [**[ListStreamColumn]**](ListStreamColumn.md) | Widget columns. | **query** | [**ListStreamQuery**](ListStreamQuery.md) | | **response_format** | [**ListStreamResponseFormat**](ListStreamResponseFormat.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Log.md b/docs/v1/Log.md index a045f03d7f..1a00aa12a7 100644 --- a/docs/v1/Log.md +++ b/docs/v1/Log.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **content** | [**LogContent**](LogContent.md) | | [optional] **id** | **str** | Unique ID of the Log. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogContent.md b/docs/v1/LogContent.md index c35b736d44..f08d8646a9 100644 --- a/docs/v1/LogContent.md +++ b/docs/v1/LogContent.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **service** | **str** | The name of the application or service generating the log events. It is used to switch from Logs to APM, so make sure you define the same value when you use both products. | [optional] **tags** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | Array of tags associated with your log. | [optional] **timestamp** | **datetime** | Timestamp of your log. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogQueryDefinition.md b/docs/v1/LogQueryDefinition.md index c044e17d0a..ea877e3f6d 100644 --- a/docs/v1/LogQueryDefinition.md +++ b/docs/v1/LogQueryDefinition.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **index** | **str** | A coma separated-list of index names. Use \"*\" query all indexes at once. [Multiple Indexes](https://docs.datadoghq.com/logs/indexes/#multiple-indexes) | [optional] **multi_compute** | [**[LogsQueryCompute]**](LogsQueryCompute.md) | This field is mutually exclusive with `compute`. | [optional] **search** | [**LogQueryDefinitionSearch**](LogQueryDefinitionSearch.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogQueryDefinitionGroupBy.md b/docs/v1/LogQueryDefinitionGroupBy.md index 02775bd810..e20d4c08b5 100644 --- a/docs/v1/LogQueryDefinitionGroupBy.md +++ b/docs/v1/LogQueryDefinitionGroupBy.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **facet** | **str** | Facet name. | **limit** | **int** | Maximum number of items in the group. | [optional] **sort** | [**LogQueryDefinitionGroupBySort**](LogQueryDefinitionGroupBySort.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogQueryDefinitionGroupBySort.md b/docs/v1/LogQueryDefinitionGroupBySort.md index b75a27a7b7..1fea34936c 100644 --- a/docs/v1/LogQueryDefinitionGroupBySort.md +++ b/docs/v1/LogQueryDefinitionGroupBySort.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **aggregation** | **str** | The aggregation method. | **order** | [**WidgetSort**](WidgetSort.md) | | **facet** | **str** | Facet name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogQueryDefinitionSearch.md b/docs/v1/LogQueryDefinitionSearch.md index 7cd6db3a17..4e633fafe7 100644 --- a/docs/v1/LogQueryDefinitionSearch.md +++ b/docs/v1/LogQueryDefinitionSearch.md @@ -6,7 +6,8 @@ The query being made on the logs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **query** | **str** | Search value to apply. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogStreamWidgetDefinition.md b/docs/v1/LogStreamWidgetDefinition.md index 7f54310ff3..9cfd069e46 100644 --- a/docs/v1/LogStreamWidgetDefinition.md +++ b/docs/v1/LogStreamWidgetDefinition.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogStreamWidgetDefinitionType.md b/docs/v1/LogStreamWidgetDefinitionType.md index 5df4c4f49a..fc36fefeda 100644 --- a/docs/v1/LogStreamWidgetDefinitionType.md +++ b/docs/v1/LogStreamWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the log stream widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the log stream widget. | defaults to "log_stream", must be one of ["log_stream", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsAPIError.md b/docs/v1/LogsAPIError.md index 5bce92653d..f3d448227f 100644 --- a/docs/v1/LogsAPIError.md +++ b/docs/v1/LogsAPIError.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **code** | **str** | Code identifying the error | [optional] **details** | [**[LogsAPIError]**](LogsAPIError.md) | Additional error details | [optional] **message** | **str** | Error message | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsAPIErrorResponse.md b/docs/v1/LogsAPIErrorResponse.md index bd312a82de..c111c852bf 100644 --- a/docs/v1/LogsAPIErrorResponse.md +++ b/docs/v1/LogsAPIErrorResponse.md @@ -6,7 +6,8 @@ Response returned by the Logs API when errors occur. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | [**LogsAPIError**](LogsAPIError.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsArithmeticProcessor.md b/docs/v1/LogsArithmeticProcessor.md index 2f393fc52e..7d1b208069 100644 --- a/docs/v1/LogsArithmeticProcessor.md +++ b/docs/v1/LogsArithmeticProcessor.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **is_replace_missing** | **bool** | If `true`, it replaces all missing attributes of expression by `0`, `false` skip the operation if an attribute is missing. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsArithmeticProcessorType.md b/docs/v1/LogsArithmeticProcessorType.md index 0272f7aaf0..2d2a171be4 100644 --- a/docs/v1/LogsArithmeticProcessorType.md +++ b/docs/v1/LogsArithmeticProcessorType.md @@ -6,7 +6,8 @@ Type of logs arithmetic processor. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs arithmetic processor. | defaults to "arithmetic-processor", must be one of ["arithmetic-processor", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsAttributeRemapper.md b/docs/v1/LogsAttributeRemapper.md index e709485d1e..035cf3ab71 100644 --- a/docs/v1/LogsAttributeRemapper.md +++ b/docs/v1/LogsAttributeRemapper.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **source_type** | **str** | Defines if the sources are from log `attribute` or `tag`. | [optional] if omitted the server will use the default value of "attribute" **target_format** | [**TargetFormatType**](TargetFormatType.md) | | [optional] **target_type** | **str** | Defines if the final attribute or tag name is from log `attribute` or `tag`. | [optional] if omitted the server will use the default value of "attribute" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsAttributeRemapperType.md b/docs/v1/LogsAttributeRemapperType.md index 31188d944d..173b94d537 100644 --- a/docs/v1/LogsAttributeRemapperType.md +++ b/docs/v1/LogsAttributeRemapperType.md @@ -6,7 +6,8 @@ Type of logs attribute remapper. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs attribute remapper. | defaults to "attribute-remapper", must be one of ["attribute-remapper", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsByRetention.md b/docs/v1/LogsByRetention.md index 20c7198381..37cd57e2f5 100644 --- a/docs/v1/LogsByRetention.md +++ b/docs/v1/LogsByRetention.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **orgs** | [**LogsByRetentionOrgs**](LogsByRetentionOrgs.md) | | [optional] **usage** | [**[LogsRetentionAggSumUsage]**](LogsRetentionAggSumUsage.md) | Aggregated index logs usage for each retention period with usage. | [optional] **usage_by_month** | [**LogsByRetentionMonthlyUsage**](LogsByRetentionMonthlyUsage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsByRetentionMonthlyUsage.md b/docs/v1/LogsByRetentionMonthlyUsage.md index d03e62ebe3..82703f1178 100644 --- a/docs/v1/LogsByRetentionMonthlyUsage.md +++ b/docs/v1/LogsByRetentionMonthlyUsage.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **date** | **str** | The month for the usage. | [optional] **usage** | [**[LogsRetentionSumUsage]**](LogsRetentionSumUsage.md) | Indexed logs usage for each active retention for the month. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsByRetentionOrgUsage.md b/docs/v1/LogsByRetentionOrgUsage.md index f390b8708e..d751f226cf 100644 --- a/docs/v1/LogsByRetentionOrgUsage.md +++ b/docs/v1/LogsByRetentionOrgUsage.md @@ -6,7 +6,8 @@ Indexed logs usage by retention for a single organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[LogsRetentionSumUsage]**](LogsRetentionSumUsage.md) | Indexed logs usage for each active retention for the organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsByRetentionOrgs.md b/docs/v1/LogsByRetentionOrgs.md index 38cb8e2d7a..9d49e7234b 100644 --- a/docs/v1/LogsByRetentionOrgs.md +++ b/docs/v1/LogsByRetentionOrgs.md @@ -6,7 +6,8 @@ Indexed logs usage summary for each organization for each retention period with Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[LogsByRetentionOrgUsage]**](LogsByRetentionOrgUsage.md) | Indexed logs usage summary for each organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsCategoryProcessor.md b/docs/v1/LogsCategoryProcessor.md index ebbc316018..df903b405c 100644 --- a/docs/v1/LogsCategoryProcessor.md +++ b/docs/v1/LogsCategoryProcessor.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **type** | [**LogsCategoryProcessorType**](LogsCategoryProcessorType.md) | | **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsCategoryProcessorCategory.md b/docs/v1/LogsCategoryProcessorCategory.md index c4a32da83c..b3779a07d2 100644 --- a/docs/v1/LogsCategoryProcessorCategory.md +++ b/docs/v1/LogsCategoryProcessorCategory.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **filter** | [**LogsFilter**](LogsFilter.md) | | [optional] **name** | **str** | Value to assign to the target attribute. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsCategoryProcessorType.md b/docs/v1/LogsCategoryProcessorType.md index 37cf5d4ad3..a6e08a7cf9 100644 --- a/docs/v1/LogsCategoryProcessorType.md +++ b/docs/v1/LogsCategoryProcessorType.md @@ -6,7 +6,8 @@ Type of logs category processor. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs category processor. | defaults to "category-processor", must be one of ["category-processor", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsDateRemapper.md b/docs/v1/LogsDateRemapper.md index 1da2f743e0..4ff21cf263 100644 --- a/docs/v1/LogsDateRemapper.md +++ b/docs/v1/LogsDateRemapper.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**LogsDateRemapperType**](LogsDateRemapperType.md) | | **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsDateRemapperType.md b/docs/v1/LogsDateRemapperType.md index dd6126ec9d..cf65d8a89e 100644 --- a/docs/v1/LogsDateRemapperType.md +++ b/docs/v1/LogsDateRemapperType.md @@ -6,7 +6,8 @@ Type of logs date remapper. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs date remapper. | defaults to "date-remapper", must be one of ["date-remapper", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsExclusion.md b/docs/v1/LogsExclusion.md index 8927f3b0ca..702a2b11a1 100644 --- a/docs/v1/LogsExclusion.md +++ b/docs/v1/LogsExclusion.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **name** | **str** | Name of the index exclusion filter. | **filter** | [**LogsExclusionFilter**](LogsExclusionFilter.md) | | [optional] **is_enabled** | **bool** | Whether or not the exclusion filter is active. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsExclusionFilter.md b/docs/v1/LogsExclusionFilter.md index 0cc2a54093..5d28ebb3e4 100644 --- a/docs/v1/LogsExclusionFilter.md +++ b/docs/v1/LogsExclusionFilter.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **sample_rate** | **float** | Sample rate to apply to logs going through this exclusion filter, a value of 1 will exclude all logs matching the query. | **query** | **str** | Default query is `*`, meaning all logs flowing in the index would be excluded. Scope down exclusion filter to only a subset of logs with a log query. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsFilter.md b/docs/v1/LogsFilter.md index 564d489761..911c47df94 100644 --- a/docs/v1/LogsFilter.md +++ b/docs/v1/LogsFilter.md @@ -6,7 +6,8 @@ Filter for logs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **query** | **str** | The filter query. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsGeoIPParser.md b/docs/v1/LogsGeoIPParser.md index 5b2737bce2..d85db886f1 100644 --- a/docs/v1/LogsGeoIPParser.md +++ b/docs/v1/LogsGeoIPParser.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **target** | **str** | Name of the parent attribute that contains all the extracted details from the `sources`. | defaults to "network.client.geoip" **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsGeoIPParserType.md b/docs/v1/LogsGeoIPParserType.md index 5f9bd42711..f23c6a073b 100644 --- a/docs/v1/LogsGeoIPParserType.md +++ b/docs/v1/LogsGeoIPParserType.md @@ -6,7 +6,8 @@ Type of GeoIP parser. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of GeoIP parser. | defaults to "geo-ip-parser", must be one of ["geo-ip-parser", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsGrokParser.md b/docs/v1/LogsGrokParser.md index fd4f567e52..49bf698a74 100644 --- a/docs/v1/LogsGrokParser.md +++ b/docs/v1/LogsGrokParser.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] **samples** | **[str]** | List of sample logs to test this grok parser. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsGrokParserRules.md b/docs/v1/LogsGrokParserRules.md index fc8f2085c2..c3b24dbdfd 100644 --- a/docs/v1/LogsGrokParserRules.md +++ b/docs/v1/LogsGrokParserRules.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **match_rules** | **str** | List of match rules for the grok parser, separated by a new line. | **support_rules** | **str** | List of support rules for the grok parser, separated by a new line. | [optional] if omitted the server will use the default value of "" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsGrokParserType.md b/docs/v1/LogsGrokParserType.md index 0d262b58fc..7a3efc9423 100644 --- a/docs/v1/LogsGrokParserType.md +++ b/docs/v1/LogsGrokParserType.md @@ -6,7 +6,8 @@ Type of logs grok parser. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs grok parser. | defaults to "grok-parser", must be one of ["grok-parser", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsIndex.md b/docs/v1/LogsIndex.md index 4653746fe7..888a4ea512 100644 --- a/docs/v1/LogsIndex.md +++ b/docs/v1/LogsIndex.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **exclusion_filters** | [**[LogsExclusion]**](LogsExclusion.md) | An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored. | [optional] **is_rate_limited** | **bool** | A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC. | [optional] [readonly] **num_retention_days** | **int** | The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsIndexListResponse.md b/docs/v1/LogsIndexListResponse.md index b0ba7e0684..055ef3c14f 100644 --- a/docs/v1/LogsIndexListResponse.md +++ b/docs/v1/LogsIndexListResponse.md @@ -6,7 +6,8 @@ Object with all Index configurations for a given organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **indexes** | [**[LogsIndex]**](LogsIndex.md) | Array of Log index configurations. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsIndexUpdateRequest.md b/docs/v1/LogsIndexUpdateRequest.md index cb95eab898..eb4e3c396f 100644 --- a/docs/v1/LogsIndexUpdateRequest.md +++ b/docs/v1/LogsIndexUpdateRequest.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **disable_daily_limit** | **bool** | If true, sets the `daily_limit` value to null and the index is not limited on a daily basis (any specified `daily_limit` value in the request is ignored). If false or omitted, the index's current `daily_limit` is maintained. | [optional] **exclusion_filters** | [**[LogsExclusion]**](LogsExclusion.md) | An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored. | [optional] **num_retention_days** | **int** | The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions. **Note:** Changing the retention for an index adjusts the length of retention for all logs already in this index. It may also affect billing. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsIndexesApi.md b/docs/v1/LogsIndexesApi.md index f69cadd15e..9bfdc95940 100644 --- a/docs/v1/LogsIndexesApi.md +++ b/docs/v1/LogsIndexesApi.md @@ -50,7 +50,6 @@ with ApiClient(configuration) as api_client: filter=LogsFilter( query="source:python", ), - is_rate_limited=False, name="main", num_retention_days=15, ) # LogsIndex | Object containing the new index. diff --git a/docs/v1/LogsIndexesOrder.md b/docs/v1/LogsIndexesOrder.md index f4e724f8b7..8eec99ee42 100644 --- a/docs/v1/LogsIndexesOrder.md +++ b/docs/v1/LogsIndexesOrder.md @@ -6,7 +6,8 @@ Object containing the ordered list of log index names. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **index_names** | **[str]** | Array of strings identifying by their name(s) the index(es) of your organization. Logs are tested against the query filter of each index one by one, following the order of the array. Logs are eventually stored in the first matching index. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsListRequest.md b/docs/v1/LogsListRequest.md index 0630ea027e..a33b7d44e4 100644 --- a/docs/v1/LogsListRequest.md +++ b/docs/v1/LogsListRequest.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **query** | **str** | The search query - following the log search syntax. | [optional] **sort** | [**LogsSort**](LogsSort.md) | | [optional] **start_at** | **str** | Hash identifier of the first log to return in the list, available in a log `id` attribute. This parameter is used for the pagination feature. **Note**: This parameter is ignored if the corresponding log is out of the scope of the specified time window. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsListRequestTime.md b/docs/v1/LogsListRequestTime.md index fd81d5ed8e..0f75f47638 100644 --- a/docs/v1/LogsListRequestTime.md +++ b/docs/v1/LogsListRequestTime.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **_from** | **datetime** | Minimum timestamp for requested logs. | **to** | **datetime** | Maximum timestamp for requested logs. | **timezone** | **str** | Timezone can be specified both as an offset (e.g. \"UTC+03:00\") or a regional zone (e.g. \"Europe/Paris\"). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsListResponse.md b/docs/v1/LogsListResponse.md index 862faafe0d..0fc64ad288 100644 --- a/docs/v1/LogsListResponse.md +++ b/docs/v1/LogsListResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **logs** | [**[Log]**](Log.md) | Array of logs matching the request and the `nextLogId` if sent. | [optional] **next_log_id** | **str** | Hash identifier of the next log to return in the list. This parameter is used for the pagination feature. | [optional] **status** | **str** | Status of the response. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsLookupProcessor.md b/docs/v1/LogsLookupProcessor.md index 5e0db69870..9665cdb62f 100644 --- a/docs/v1/LogsLookupProcessor.md +++ b/docs/v1/LogsLookupProcessor.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **default_lookup** | **str** | Value to set the target attribute if the source value is not found in the list. | [optional] **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsLookupProcessorType.md b/docs/v1/LogsLookupProcessorType.md index 66b4784659..a948cde8fa 100644 --- a/docs/v1/LogsLookupProcessorType.md +++ b/docs/v1/LogsLookupProcessorType.md @@ -6,7 +6,8 @@ Type of logs lookup processor. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs lookup processor. | defaults to "lookup-processor", must be one of ["lookup-processor", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsMessageRemapper.md b/docs/v1/LogsMessageRemapper.md index 4c2f83fd02..8f431de351 100644 --- a/docs/v1/LogsMessageRemapper.md +++ b/docs/v1/LogsMessageRemapper.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **sources** | **[str]** | Array of source attributes. | defaults to ["msg"] **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsMessageRemapperType.md b/docs/v1/LogsMessageRemapperType.md index 13d5db22a3..05f721232f 100644 --- a/docs/v1/LogsMessageRemapperType.md +++ b/docs/v1/LogsMessageRemapperType.md @@ -6,7 +6,8 @@ Type of logs message remapper. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs message remapper. | defaults to "message-remapper", must be one of ["message-remapper", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsPipeline.md b/docs/v1/LogsPipeline.md index 0533414924..ad00f1547f 100644 --- a/docs/v1/LogsPipeline.md +++ b/docs/v1/LogsPipeline.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **is_read_only** | **bool** | Whether or not the pipeline can be edited. | [optional] [readonly] **processors** | [**[LogsProcessor]**](LogsProcessor.md) | Ordered list of processors in this pipeline. | [optional] **type** | **str** | Type of pipeline. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsPipelineList.md b/docs/v1/LogsPipelineList.md index 8629702c65..32479c2a06 100644 --- a/docs/v1/LogsPipelineList.md +++ b/docs/v1/LogsPipelineList.md @@ -6,7 +6,8 @@ Array of pipeline ID strings. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[LogsPipeline]**](LogsPipeline.md) | Array of pipeline ID strings. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsPipelineProcessor.md b/docs/v1/LogsPipelineProcessor.md index ac907912e9..2cfc0ab7ee 100644 --- a/docs/v1/LogsPipelineProcessor.md +++ b/docs/v1/LogsPipelineProcessor.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] **processors** | [**[LogsProcessor]**](LogsProcessor.md) | Ordered list of processors in this pipeline. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsPipelineProcessorType.md b/docs/v1/LogsPipelineProcessorType.md index 4d9ad03f0a..0464d4b3e3 100644 --- a/docs/v1/LogsPipelineProcessorType.md +++ b/docs/v1/LogsPipelineProcessorType.md @@ -6,7 +6,8 @@ Type of logs pipeline processor. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs pipeline processor. | defaults to "pipeline", must be one of ["pipeline", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsPipelinesApi.md b/docs/v1/LogsPipelinesApi.md index 26b75bbe97..3d828574a9 100644 --- a/docs/v1/LogsPipelinesApi.md +++ b/docs/v1/LogsPipelinesApi.md @@ -40,14 +40,11 @@ with ApiClient(configuration) as api_client: filter=LogsFilter( query="source:python", ), - id="id_example", is_enabled=True, - is_read_only=True, name="", processors=[ LogsProcessor(), ], - type="pipeline", ) # LogsPipeline | Definition of the new pipeline. # example passing only required values which don't have defaults set @@ -369,14 +366,11 @@ with ApiClient(configuration) as api_client: filter=LogsFilter( query="source:python", ), - id="id_example", is_enabled=True, - is_read_only=True, name="", processors=[ LogsProcessor(), ], - type="pipeline", ) # LogsPipeline | New definition of the pipeline. # example passing only required values which don't have defaults set diff --git a/docs/v1/LogsPipelinesOrder.md b/docs/v1/LogsPipelinesOrder.md index 7b6887d6fc..d953aa7f02 100644 --- a/docs/v1/LogsPipelinesOrder.md +++ b/docs/v1/LogsPipelinesOrder.md @@ -6,7 +6,8 @@ Object containing the ordered list of pipeline IDs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pipeline_ids** | **[str]** | Ordered Array of `<PIPELINE_ID>` strings, the order of pipeline IDs in the array define the overall Pipelines order for Datadog. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsProcessor.md b/docs/v1/LogsProcessor.md index 7ba9253b05..3d7d52a426 100644 --- a/docs/v1/LogsProcessor.md +++ b/docs/v1/LogsProcessor.md @@ -21,6 +21,6 @@ Name | Type | Description | Notes **LogsURLParser** | [**LogsURLParser**](LogsURLParser.md) | Container class of the relevant properties. | **LogsUserAgentParser** | [**LogsUserAgentParser**](LogsUserAgentParser.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsQueryCompute.md b/docs/v1/LogsQueryCompute.md index edf1b0747d..8844cd9104 100644 --- a/docs/v1/LogsQueryCompute.md +++ b/docs/v1/LogsQueryCompute.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **aggregation** | **str** | The aggregation method. | **facet** | **str** | Facet name. | [optional] **interval** | **int** | Define a time interval in seconds. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsRetentionAggSumUsage.md b/docs/v1/LogsRetentionAggSumUsage.md index a7766d67de..6f10548eb8 100644 --- a/docs/v1/LogsRetentionAggSumUsage.md +++ b/docs/v1/LogsRetentionAggSumUsage.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **logs_live_indexed_logs_usage_agg_sum** | **int** | Live indexed logs for this retention period. | [optional] **logs_rehydrated_indexed_logs_usage_agg_sum** | **int** | Rehydrated indexed logs for this retention period. | [optional] **retention** | **str** | The retention period in days or \"custom\" for all custom retention periods. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsRetentionSumUsage.md b/docs/v1/LogsRetentionSumUsage.md index 94e1b65c05..013e528849 100644 --- a/docs/v1/LogsRetentionSumUsage.md +++ b/docs/v1/LogsRetentionSumUsage.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **logs_live_indexed_logs_usage_sum** | **int** | Live indexed logs for this retention period. | [optional] **logs_rehydrated_indexed_logs_usage_sum** | **int** | Rehydrated indexed logs for this retention period. | [optional] **retention** | **str** | The retention period in days or \"custom\" for all custom retention periods. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsServiceRemapper.md b/docs/v1/LogsServiceRemapper.md index 9c036c6fb8..e1edd8819e 100644 --- a/docs/v1/LogsServiceRemapper.md +++ b/docs/v1/LogsServiceRemapper.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**LogsServiceRemapperType**](LogsServiceRemapperType.md) | | **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsServiceRemapperType.md b/docs/v1/LogsServiceRemapperType.md index 8f6712f3f0..cc312a8005 100644 --- a/docs/v1/LogsServiceRemapperType.md +++ b/docs/v1/LogsServiceRemapperType.md @@ -6,7 +6,8 @@ Type of logs service remapper. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs service remapper. | defaults to "service-remapper", must be one of ["service-remapper", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsSort.md b/docs/v1/LogsSort.md index 4dbab728d9..55ba5d076a 100644 --- a/docs/v1/LogsSort.md +++ b/docs/v1/LogsSort.md @@ -6,7 +6,8 @@ Time-ascending `asc` or time-descending `desc`results. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Time-ascending `asc` or time-descending `desc`results. | must be one of ["asc", "desc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsStatusRemapper.md b/docs/v1/LogsStatusRemapper.md index b30149b303..d5806d1497 100644 --- a/docs/v1/LogsStatusRemapper.md +++ b/docs/v1/LogsStatusRemapper.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**LogsStatusRemapperType**](LogsStatusRemapperType.md) | | **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsStatusRemapperType.md b/docs/v1/LogsStatusRemapperType.md index f22f2c945b..bbcbcb7796 100644 --- a/docs/v1/LogsStatusRemapperType.md +++ b/docs/v1/LogsStatusRemapperType.md @@ -6,7 +6,8 @@ Type of logs status remapper. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs status remapper. | defaults to "status-remapper", must be one of ["status-remapper", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsStringBuilderProcessor.md b/docs/v1/LogsStringBuilderProcessor.md index 9fc429d5db..33dc003017 100644 --- a/docs/v1/LogsStringBuilderProcessor.md +++ b/docs/v1/LogsStringBuilderProcessor.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **is_replace_missing** | **bool** | If true, it replaces all missing attributes of `template` by an empty string. If `false` (default), skips the operation for missing attributes. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsStringBuilderProcessorType.md b/docs/v1/LogsStringBuilderProcessorType.md index 8c09ed2a87..9e612dff44 100644 --- a/docs/v1/LogsStringBuilderProcessorType.md +++ b/docs/v1/LogsStringBuilderProcessorType.md @@ -6,7 +6,8 @@ Type of logs string builder processor. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs string builder processor. | defaults to "string-builder-processor", must be one of ["string-builder-processor", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsTraceRemapper.md b/docs/v1/LogsTraceRemapper.md index d3424e73e0..3d24e82151 100644 --- a/docs/v1/LogsTraceRemapper.md +++ b/docs/v1/LogsTraceRemapper.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] **sources** | **[str]** | Array of source attributes. | [optional] if omitted the server will use the default value of ["dd.trace_id"] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsTraceRemapperType.md b/docs/v1/LogsTraceRemapperType.md index 9ddf57d6c1..b6910f9704 100644 --- a/docs/v1/LogsTraceRemapperType.md +++ b/docs/v1/LogsTraceRemapperType.md @@ -6,7 +6,8 @@ Type of logs trace remapper. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs trace remapper. | defaults to "trace-id-remapper", must be one of ["trace-id-remapper", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsURLParser.md b/docs/v1/LogsURLParser.md index d7f75a76a6..83177ff4ef 100644 --- a/docs/v1/LogsURLParser.md +++ b/docs/v1/LogsURLParser.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] **normalize_ending_slashes** | **bool, none_type** | Normalize the ending slashes or not. | [optional] if omitted the server will use the default value of False +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsURLParserType.md b/docs/v1/LogsURLParserType.md index 64c7422d94..11199c3aba 100644 --- a/docs/v1/LogsURLParserType.md +++ b/docs/v1/LogsURLParserType.md @@ -6,7 +6,8 @@ Type of logs URL parser. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs URL parser. | defaults to "url-parser", must be one of ["url-parser", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsUserAgentParser.md b/docs/v1/LogsUserAgentParser.md index 361738ad0c..fd5ba06278 100644 --- a/docs/v1/LogsUserAgentParser.md +++ b/docs/v1/LogsUserAgentParser.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether or not the processor is enabled. | [optional] if omitted the server will use the default value of False **is_encoded** | **bool** | Define if the source attribute is URL encoded or not. | [optional] if omitted the server will use the default value of False **name** | **str** | Name of the processor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/LogsUserAgentParserType.md b/docs/v1/LogsUserAgentParserType.md index 34d92039d0..99a6460b57 100644 --- a/docs/v1/LogsUserAgentParserType.md +++ b/docs/v1/LogsUserAgentParserType.md @@ -6,7 +6,8 @@ Type of logs User-Agent parser. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of logs User-Agent parser. | defaults to "user-agent-parser", must be one of ["user-agent-parser", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricMetadata.md b/docs/v1/MetricMetadata.md index df7ab07f3a..3c1c0ddbf4 100644 --- a/docs/v1/MetricMetadata.md +++ b/docs/v1/MetricMetadata.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **statsd_interval** | **int** | StatsD flush interval of the metric in seconds if applicable. | [optional] **type** | **str** | Metric type such as `gauge` or `rate`. | [optional] **unit** | **str** | Primary unit of the metric such as `byte` or `operation`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricSearchResponse.md b/docs/v1/MetricSearchResponse.md index 2a7ca9550b..92545f3387 100644 --- a/docs/v1/MetricSearchResponse.md +++ b/docs/v1/MetricSearchResponse.md @@ -6,7 +6,8 @@ Object containing the list of metrics matching the search query. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **results** | [**MetricSearchResponseResults**](MetricSearchResponseResults.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricSearchResponseResults.md b/docs/v1/MetricSearchResponseResults.md index 83e1ed1407..047fa8bde5 100644 --- a/docs/v1/MetricSearchResponseResults.md +++ b/docs/v1/MetricSearchResponseResults.md @@ -6,7 +6,8 @@ Search result. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metrics** | **[str]** | List of metrics that match the search query. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricsApi.md b/docs/v1/MetricsApi.md index a2232dec10..d17d6cd328 100644 --- a/docs/v1/MetricsApi.md +++ b/docs/v1/MetricsApi.md @@ -399,7 +399,6 @@ with ApiClient(configuration) as api_client: metric_name = "metric_name_example" # str | Name of the metric for which to edit metadata. body = MetricMetadata( description="description_example", - integration="integration_example", per_unit="second", short_name="short_name_example", statsd_interval=1, diff --git a/docs/v1/MetricsListResponse.md b/docs/v1/MetricsListResponse.md index bda67f2dde..106cfaf7a2 100644 --- a/docs/v1/MetricsListResponse.md +++ b/docs/v1/MetricsListResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **_from** | **str** | Time when the metrics were active, seconds since the Unix epoch. | [optional] **metrics** | **[str]** | List of metric names. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricsPayload.md b/docs/v1/MetricsPayload.md index cc60bc8bdd..ab1fdd4eb3 100644 --- a/docs/v1/MetricsPayload.md +++ b/docs/v1/MetricsPayload.md @@ -6,7 +6,8 @@ The metrics' payload. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **series** | [**[Series]**](Series.md) | A list of time series to submit to Datadog. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricsQueryMetadata.md b/docs/v1/MetricsQueryMetadata.md index 18e041ce28..45889416d4 100644 --- a/docs/v1/MetricsQueryMetadata.md +++ b/docs/v1/MetricsQueryMetadata.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **start** | **int** | Start of the time window, milliseconds since Unix epoch. | [optional] [readonly] **tag_set** | **[str]** | Unique tags identifying this series. | [optional] [readonly] **unit** | [**[MetricsQueryUnit]**](MetricsQueryUnit.md) | Detailed information about the metric unit. First element describes the \"primary unit\" (for example, `bytes` in `bytes per second`), second describes the \"per unit\" (for example, `second` in `bytes per second`). | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricsQueryResponse.md b/docs/v1/MetricsQueryResponse.md index ed5fed2b63..8ab53bee28 100644 --- a/docs/v1/MetricsQueryResponse.md +++ b/docs/v1/MetricsQueryResponse.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **series** | [**[MetricsQueryMetadata]**](MetricsQueryMetadata.md) | List of timeseries queried. | [optional] [readonly] **status** | **str** | Status of the query. | [optional] [readonly] **to_date** | **int** | End of requested time window, milliseconds since Unix epoch. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MetricsQueryUnit.md b/docs/v1/MetricsQueryUnit.md index 013186e96f..d69757a198 100644 --- a/docs/v1/MetricsQueryUnit.md +++ b/docs/v1/MetricsQueryUnit.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **plural** | **str** | Plural form of the unit name. | [optional] [readonly] **scale_factor** | **float** | Factor for scaling between units of the same family. | [optional] [readonly] **short_name** | **str** | Abbreviation of the unit. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Monitor.md b/docs/v1/Monitor.md index f9b57329a3..5bc0de4dcc 100644 --- a/docs/v1/Monitor.md +++ b/docs/v1/Monitor.md @@ -21,7 +21,8 @@ Name | Type | Description | Notes **restricted_roles** | **[str]** | A list of role identifiers that can be pulled from the Roles API. Cannot be used with `locked` option. | [optional] **state** | [**MonitorState**](MonitorState.md) | | [optional] **tags** | **[str]** | Tags associated to your monitor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorDeviceID.md b/docs/v1/MonitorDeviceID.md index 4010d281e7..05098b5d49 100644 --- a/docs/v1/MonitorDeviceID.md +++ b/docs/v1/MonitorDeviceID.md @@ -6,7 +6,8 @@ ID of the device the Synthetics monitor is running on. Same as `SyntheticsDevice Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | ID of the device the Synthetics monitor is running on. Same as `SyntheticsDeviceID`. | must be one of ["laptop_large", "tablet", "mobile_small", "chrome.laptop_large", "chrome.tablet", "chrome.mobile_small", "firefox.laptop_large", "firefox.tablet", "firefox.mobile_small", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorGroupSearchResponse.md b/docs/v1/MonitorGroupSearchResponse.md index 26ebec431d..ce55983311 100644 --- a/docs/v1/MonitorGroupSearchResponse.md +++ b/docs/v1/MonitorGroupSearchResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **counts** | [**MonitorGroupSearchResponseCounts**](MonitorGroupSearchResponseCounts.md) | | [optional] **groups** | [**[MonitorGroupSearchResult]**](MonitorGroupSearchResult.md) | The list of found monitor groups. | [optional] [readonly] **metadata** | [**MonitorSearchResponseMetadata**](MonitorSearchResponseMetadata.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorGroupSearchResponseCounts.md b/docs/v1/MonitorGroupSearchResponseCounts.md index fc3815cc10..a5bd9061c3 100644 --- a/docs/v1/MonitorGroupSearchResponseCounts.md +++ b/docs/v1/MonitorGroupSearchResponseCounts.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**MonitorSearchCount**](MonitorSearchCount.md) | | [optional] **type** | [**MonitorSearchCount**](MonitorSearchCount.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorGroupSearchResult.md b/docs/v1/MonitorGroupSearchResult.md index 49e1817041..19e5e8edf3 100644 --- a/docs/v1/MonitorGroupSearchResult.md +++ b/docs/v1/MonitorGroupSearchResult.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **monitor_id** | **int** | The ID of the monitor. | [optional] [readonly] **monitor_name** | **str** | The name of the monitor. | [optional] [readonly] **status** | [**MonitorOverallStates**](MonitorOverallStates.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorOptions.md b/docs/v1/MonitorOptions.md index ea0b74c591..2c2d00671c 100644 --- a/docs/v1/MonitorOptions.md +++ b/docs/v1/MonitorOptions.md @@ -26,7 +26,8 @@ Name | Type | Description | Notes **threshold_windows** | [**MonitorThresholdWindowOptions**](MonitorThresholdWindowOptions.md) | | [optional] **thresholds** | [**MonitorThresholds**](MonitorThresholds.md) | | [optional] **timeout_h** | **int, none_type** | The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorOptionsAggregation.md b/docs/v1/MonitorOptionsAggregation.md index c9c671dd86..9756679518 100644 --- a/docs/v1/MonitorOptionsAggregation.md +++ b/docs/v1/MonitorOptionsAggregation.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **group_by** | **str** | Group to break down the monitor on. | [optional] **metric** | **str** | Metric name used in the monitor. | [optional] **type** | **str** | Metric type used in the monitor. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorOverallStates.md b/docs/v1/MonitorOverallStates.md index e5eaff56e8..3d5f19ed05 100644 --- a/docs/v1/MonitorOverallStates.md +++ b/docs/v1/MonitorOverallStates.md @@ -6,7 +6,8 @@ The different states your monitor can be in. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The different states your monitor can be in. | must be one of ["Alert", "Ignored", "No Data", "OK", "Skipped", "Unknown", "Warn", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSearchCount.md b/docs/v1/MonitorSearchCount.md index 1eac54111f..0877a37ae4 100644 --- a/docs/v1/MonitorSearchCount.md +++ b/docs/v1/MonitorSearchCount.md @@ -6,7 +6,8 @@ Search facets. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]** | Search facets. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSearchResponse.md b/docs/v1/MonitorSearchResponse.md index cf4e087cc1..befc1b87fb 100644 --- a/docs/v1/MonitorSearchResponse.md +++ b/docs/v1/MonitorSearchResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **counts** | [**MonitorSearchResponseCounts**](MonitorSearchResponseCounts.md) | | [optional] **metadata** | [**MonitorSearchResponseMetadata**](MonitorSearchResponseMetadata.md) | | [optional] **monitors** | [**[MonitorSearchResult]**](MonitorSearchResult.md) | The list of found monitors. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSearchResponseCounts.md b/docs/v1/MonitorSearchResponseCounts.md index 8e58674712..ed2d6c06ab 100644 --- a/docs/v1/MonitorSearchResponseCounts.md +++ b/docs/v1/MonitorSearchResponseCounts.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **status** | [**MonitorSearchCount**](MonitorSearchCount.md) | | [optional] **tag** | [**MonitorSearchCount**](MonitorSearchCount.md) | | [optional] **type** | [**MonitorSearchCount**](MonitorSearchCount.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSearchResponseMetadata.md b/docs/v1/MonitorSearchResponseMetadata.md index 7c424c1f9d..d2cd1fa82c 100644 --- a/docs/v1/MonitorSearchResponseMetadata.md +++ b/docs/v1/MonitorSearchResponseMetadata.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **page_count** | **int** | The number of pages. | [optional] [readonly] **per_page** | **int** | The number of monitors to return per page. | [optional] [readonly] **total_count** | **int** | The total number of monitors. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSearchResult.md b/docs/v1/MonitorSearchResult.md index 44a92ce616..53f0ced4be 100644 --- a/docs/v1/MonitorSearchResult.md +++ b/docs/v1/MonitorSearchResult.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **status** | [**MonitorOverallStates**](MonitorOverallStates.md) | | [optional] **tags** | **[str]** | Tags associated with the monitor. | [optional] [readonly] **type** | [**MonitorType**](MonitorType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSearchResultNotification.md b/docs/v1/MonitorSearchResultNotification.md index ab0fd0085a..59cfc1136d 100644 --- a/docs/v1/MonitorSearchResultNotification.md +++ b/docs/v1/MonitorSearchResultNotification.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **handle** | **str** | The email address that received the notification. | [optional] [readonly] **name** | **str** | The username receiving the notification | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorState.md b/docs/v1/MonitorState.md index ba61951e28..dc888c4c11 100644 --- a/docs/v1/MonitorState.md +++ b/docs/v1/MonitorState.md @@ -6,7 +6,8 @@ Wrapper object with the different monitor states. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **groups** | [**{str: (MonitorStateGroup,)}**](MonitorStateGroup.md) | Dictionary where the keys are groups (comma separated lists of tags) and the values are the list of groups your monitor is broken down on. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorStateGroup.md b/docs/v1/MonitorStateGroup.md index 22af64ad1b..5ee6b20f1d 100644 --- a/docs/v1/MonitorStateGroup.md +++ b/docs/v1/MonitorStateGroup.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **last_triggered_ts** | **int** | Latest timestamp the monitor group triggered. | [optional] **name** | **str** | The name of the monitor. | [optional] **status** | [**MonitorOverallStates**](MonitorOverallStates.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSummaryWidgetDefinition.md b/docs/v1/MonitorSummaryWidgetDefinition.md index 3ecb36d71f..8fd3c3fbcd 100644 --- a/docs/v1/MonitorSummaryWidgetDefinition.md +++ b/docs/v1/MonitorSummaryWidgetDefinition.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorSummaryWidgetDefinitionType.md b/docs/v1/MonitorSummaryWidgetDefinitionType.md index 6435602096..ed4a4551b3 100644 --- a/docs/v1/MonitorSummaryWidgetDefinitionType.md +++ b/docs/v1/MonitorSummaryWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the monitor summary widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the monitor summary widget. | defaults to "manage_status", must be one of ["manage_status", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorThresholdWindowOptions.md b/docs/v1/MonitorThresholdWindowOptions.md index 438423d3ad..e575f686d9 100644 --- a/docs/v1/MonitorThresholdWindowOptions.md +++ b/docs/v1/MonitorThresholdWindowOptions.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **recovery_window** | **str, none_type** | Describes how long an anomalous metric must be normal before the alert recovers. | [optional] **trigger_window** | **str, none_type** | Describes how long a metric must be anomalous before an alert triggers. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorThresholds.md b/docs/v1/MonitorThresholds.md index b1403f4d12..a0e186896f 100644 --- a/docs/v1/MonitorThresholds.md +++ b/docs/v1/MonitorThresholds.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **unknown** | **float, none_type** | The monitor UNKNOWN threshold. | [optional] **warning** | **float, none_type** | The monitor `WARNING` threshold. | [optional] **warning_recovery** | **float, none_type** | The monitor `WARNING` recovery threshold. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorType.md b/docs/v1/MonitorType.md index 2dc4d73828..2bab2af6b0 100644 --- a/docs/v1/MonitorType.md +++ b/docs/v1/MonitorType.md @@ -6,7 +6,8 @@ The type of the monitor. For more information about `type`, see the [monitor opt Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs. | must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorUpdateRequest.md b/docs/v1/MonitorUpdateRequest.md index de721b9e24..a405e83d51 100644 --- a/docs/v1/MonitorUpdateRequest.md +++ b/docs/v1/MonitorUpdateRequest.md @@ -21,7 +21,8 @@ Name | Type | Description | Notes **state** | [**MonitorState**](MonitorState.md) | | [optional] **tags** | **[str]** | Tags associated to your monitor. | [optional] **type** | [**MonitorType**](MonitorType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/MonitorsApi.md b/docs/v1/MonitorsApi.md index 667c912ad0..7ac776a672 100644 --- a/docs/v1/MonitorsApi.md +++ b/docs/v1/MonitorsApi.md @@ -237,27 +237,9 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = monitors_api.MonitorsApi(api_client) body = Monitor( - created=dateutil_parser('1970-01-01T00:00:00.00Z'), - creator=Creator( - email="email_example", - handle="handle_example", - name="name_example", - ), - deleted=dateutil_parser('1970-01-01T00:00:00.00Z'), - id=1, message="message_example", - modified=dateutil_parser('1970-01-01T00:00:00.00Z'), - multi=True, name="name_example", options=MonitorOptions( - aggregation=MonitorOptionsAggregation( - group_by="host", - metric="metrics.name", - type="count", - ), - device_ids=[ - MonitorDeviceID("laptop_large"), - ], enable_logs_sample=True, escalation_message="none", evaluation_delay=1, @@ -290,24 +272,11 @@ with ApiClient(configuration) as api_client: ), timeout_h=1, ), - overall_state=MonitorOverallStates("Alert"), priority=1, query="avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", restricted_roles=[ "restricted_roles_example", ], - state=MonitorState( - groups={ - "key": MonitorStateGroup( - last_nodata_ts=1, - last_notified_ts=1, - last_resolved_ts=1, - last_triggered_ts=1, - name="name_example", - status=MonitorOverallStates("Alert"), - ), - }, - ), tags=[ "tags_example", ], @@ -752,27 +721,9 @@ with ApiClient(configuration) as api_client: api_instance = monitors_api.MonitorsApi(api_client) monitor_id = 1 # int | The ID of the monitor. body = MonitorUpdateRequest( - created=dateutil_parser('1970-01-01T00:00:00.00Z'), - creator=Creator( - email="email_example", - handle="handle_example", - name="name_example", - ), - deleted=dateutil_parser('1970-01-01T00:00:00.00Z'), - id=1, message="message_example", - modified=dateutil_parser('1970-01-01T00:00:00.00Z'), - multi=True, name="name_example", options=MonitorOptions( - aggregation=MonitorOptionsAggregation( - group_by="host", - metric="metrics.name", - type="count", - ), - device_ids=[ - MonitorDeviceID("laptop_large"), - ], enable_logs_sample=True, escalation_message="none", evaluation_delay=1, @@ -805,24 +756,11 @@ with ApiClient(configuration) as api_client: ), timeout_h=1, ), - overall_state=MonitorOverallStates("Alert"), priority=1, query="query_example", restricted_roles=[ "restricted_roles_example", ], - state=MonitorState( - groups={ - "key": MonitorStateGroup( - last_nodata_ts=1, - last_notified_ts=1, - last_resolved_ts=1, - last_triggered_ts=1, - name="name_example", - status=MonitorOverallStates("Alert"), - ), - }, - ), tags=[ "tags_example", ], @@ -895,27 +833,9 @@ with ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = monitors_api.MonitorsApi(api_client) body = Monitor( - created=dateutil_parser('1970-01-01T00:00:00.00Z'), - creator=Creator( - email="email_example", - handle="handle_example", - name="name_example", - ), - deleted=dateutil_parser('1970-01-01T00:00:00.00Z'), - id=1, message="message_example", - modified=dateutil_parser('1970-01-01T00:00:00.00Z'), - multi=True, name="name_example", options=MonitorOptions( - aggregation=MonitorOptionsAggregation( - group_by="host", - metric="metrics.name", - type="count", - ), - device_ids=[ - MonitorDeviceID("laptop_large"), - ], enable_logs_sample=True, escalation_message="none", evaluation_delay=1, @@ -948,24 +868,11 @@ with ApiClient(configuration) as api_client: ), timeout_h=1, ), - overall_state=MonitorOverallStates("Alert"), priority=1, query="avg(last_5m):sum:system.net.bytes_rcvd{host:host0} > 100", restricted_roles=[ "restricted_roles_example", ], - state=MonitorState( - groups={ - "key": MonitorStateGroup( - last_nodata_ts=1, - last_notified_ts=1, - last_resolved_ts=1, - last_triggered_ts=1, - name="name_example", - status=MonitorOverallStates("Alert"), - ), - }, - ), tags=[ "tags_example", ], diff --git a/docs/v1/NoteWidgetDefinition.md b/docs/v1/NoteWidgetDefinition.md index 1091ea8589..4f258cb244 100644 --- a/docs/v1/NoteWidgetDefinition.md +++ b/docs/v1/NoteWidgetDefinition.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **tick_edge** | [**WidgetTickEdge**](WidgetTickEdge.md) | | [optional] **tick_pos** | **str** | Where to position the tick on an edge. | [optional] **vertical_align** | [**WidgetVerticalAlign**](WidgetVerticalAlign.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NoteWidgetDefinitionType.md b/docs/v1/NoteWidgetDefinitionType.md index d686931861..37a37de227 100644 --- a/docs/v1/NoteWidgetDefinitionType.md +++ b/docs/v1/NoteWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the note widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the note widget. | defaults to "note", must be one of ["note", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookAbsoluteTime.md b/docs/v1/NotebookAbsoluteTime.md index 67ec15a374..829972bc10 100644 --- a/docs/v1/NotebookAbsoluteTime.md +++ b/docs/v1/NotebookAbsoluteTime.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **end** | **datetime** | The end time. | **start** | **datetime** | The start time. | **live** | **bool** | Indicates whether the timeframe should be shifted to end at the current time. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookAuthor.md b/docs/v1/NotebookAuthor.md index f7d0cd33b2..4adee10c25 100644 --- a/docs/v1/NotebookAuthor.md +++ b/docs/v1/NotebookAuthor.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **status** | **str** | Status of the user. | [optional] **title** | **str** | Title of the user. | [optional] **verified** | **bool** | Whether the user is verified. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellCreateRequest.md b/docs/v1/NotebookCellCreateRequest.md index 854d16276b..27e30d67db 100644 --- a/docs/v1/NotebookCellCreateRequest.md +++ b/docs/v1/NotebookCellCreateRequest.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**NotebookCellCreateRequestAttributes**](NotebookCellCreateRequestAttributes.md) | | **type** | [**NotebookCellResourceType**](NotebookCellResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellCreateRequestAttributes.md b/docs/v1/NotebookCellCreateRequestAttributes.md index f6efa40e12..444cc5ff9e 100644 --- a/docs/v1/NotebookCellCreateRequestAttributes.md +++ b/docs/v1/NotebookCellCreateRequestAttributes.md @@ -12,6 +12,6 @@ Name | Type | Description | Notes **NotebookTimeseriesCellAttributes** | [**NotebookTimeseriesCellAttributes**](NotebookTimeseriesCellAttributes.md) | Container class of the relevant properties. | **NotebookToplistCellAttributes** | [**NotebookToplistCellAttributes**](NotebookToplistCellAttributes.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellResourceType.md b/docs/v1/NotebookCellResourceType.md index 6a7b6ef031..eb5a2777cf 100644 --- a/docs/v1/NotebookCellResourceType.md +++ b/docs/v1/NotebookCellResourceType.md @@ -6,7 +6,8 @@ Type of the Notebook Cell resource. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Notebook Cell resource. | defaults to "notebook_cells", must be one of ["notebook_cells", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellResponse.md b/docs/v1/NotebookCellResponse.md index 6f63b6d777..99797f26eb 100644 --- a/docs/v1/NotebookCellResponse.md +++ b/docs/v1/NotebookCellResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**NotebookCellResponseAttributes**](NotebookCellResponseAttributes.md) | | **id** | **str** | Notebook cell ID. | **type** | [**NotebookCellResourceType**](NotebookCellResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellResponseAttributes.md b/docs/v1/NotebookCellResponseAttributes.md index 950aa287a5..7696fb3282 100644 --- a/docs/v1/NotebookCellResponseAttributes.md +++ b/docs/v1/NotebookCellResponseAttributes.md @@ -12,6 +12,6 @@ Name | Type | Description | Notes **NotebookTimeseriesCellAttributes** | [**NotebookTimeseriesCellAttributes**](NotebookTimeseriesCellAttributes.md) | Container class of the relevant properties. | **NotebookToplistCellAttributes** | [**NotebookToplistCellAttributes**](NotebookToplistCellAttributes.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellTime.md b/docs/v1/NotebookCellTime.md index 1e8f1e61f7..0264e39ea5 100644 --- a/docs/v1/NotebookCellTime.md +++ b/docs/v1/NotebookCellTime.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **NotebookAbsoluteTime** | [**NotebookAbsoluteTime**](NotebookAbsoluteTime.md) | Container class of the relevant properties. | **NotebookRelativeTime** | [**NotebookRelativeTime**](NotebookRelativeTime.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellUpdateRequest.md b/docs/v1/NotebookCellUpdateRequest.md index f907524419..9102043a7d 100644 --- a/docs/v1/NotebookCellUpdateRequest.md +++ b/docs/v1/NotebookCellUpdateRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**NotebookCellUpdateRequestAttributes**](NotebookCellUpdateRequestAttributes.md) | | **id** | **str** | Notebook cell ID. | **type** | [**NotebookCellResourceType**](NotebookCellResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCellUpdateRequestAttributes.md b/docs/v1/NotebookCellUpdateRequestAttributes.md index 2f76f7e056..de8c862198 100644 --- a/docs/v1/NotebookCellUpdateRequestAttributes.md +++ b/docs/v1/NotebookCellUpdateRequestAttributes.md @@ -12,6 +12,6 @@ Name | Type | Description | Notes **NotebookTimeseriesCellAttributes** | [**NotebookTimeseriesCellAttributes**](NotebookTimeseriesCellAttributes.md) | Container class of the relevant properties. | **NotebookToplistCellAttributes** | [**NotebookToplistCellAttributes**](NotebookToplistCellAttributes.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCreateData.md b/docs/v1/NotebookCreateData.md index 57b02d0da5..2351746c8e 100644 --- a/docs/v1/NotebookCreateData.md +++ b/docs/v1/NotebookCreateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**NotebookCreateDataAttributes**](NotebookCreateDataAttributes.md) | | **type** | [**NotebookResourceType**](NotebookResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCreateDataAttributes.md b/docs/v1/NotebookCreateDataAttributes.md index 1985a3a212..c583b3b0cc 100644 --- a/docs/v1/NotebookCreateDataAttributes.md +++ b/docs/v1/NotebookCreateDataAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **name** | **str** | The name of the notebook. | **time** | [**NotebookGlobalTime**](NotebookGlobalTime.md) | | **status** | [**NotebookStatus**](NotebookStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookCreateRequest.md b/docs/v1/NotebookCreateRequest.md index d5f2641fda..9f221748ce 100644 --- a/docs/v1/NotebookCreateRequest.md +++ b/docs/v1/NotebookCreateRequest.md @@ -6,7 +6,8 @@ The description of a notebook create request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**NotebookCreateData**](NotebookCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookDistributionCellAttributes.md b/docs/v1/NotebookDistributionCellAttributes.md index 0c5fe9e12d..fab650f764 100644 --- a/docs/v1/NotebookDistributionCellAttributes.md +++ b/docs/v1/NotebookDistributionCellAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **graph_size** | [**NotebookGraphSize**](NotebookGraphSize.md) | | [optional] **split_by** | [**NotebookSplitBy**](NotebookSplitBy.md) | | [optional] **time** | [**NotebookCellTime**](NotebookCellTime.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookGlobalTime.md b/docs/v1/NotebookGlobalTime.md index 1247dc3591..5622779412 100644 --- a/docs/v1/NotebookGlobalTime.md +++ b/docs/v1/NotebookGlobalTime.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **NotebookAbsoluteTime** | [**NotebookAbsoluteTime**](NotebookAbsoluteTime.md) | Container class of the relevant properties. | **NotebookRelativeTime** | [**NotebookRelativeTime**](NotebookRelativeTime.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookGraphSize.md b/docs/v1/NotebookGraphSize.md index e6b3a97cb9..2d4d4ef14a 100644 --- a/docs/v1/NotebookGraphSize.md +++ b/docs/v1/NotebookGraphSize.md @@ -6,7 +6,8 @@ The size of the graph. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The size of the graph. | must be one of ["xs", "s", "m", "l", "xl", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookHeatMapCellAttributes.md b/docs/v1/NotebookHeatMapCellAttributes.md index ab014c0fe3..6822e1d806 100644 --- a/docs/v1/NotebookHeatMapCellAttributes.md +++ b/docs/v1/NotebookHeatMapCellAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **graph_size** | [**NotebookGraphSize**](NotebookGraphSize.md) | | [optional] **split_by** | [**NotebookSplitBy**](NotebookSplitBy.md) | | [optional] **time** | [**NotebookCellTime**](NotebookCellTime.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookLogStreamCellAttributes.md b/docs/v1/NotebookLogStreamCellAttributes.md index 718f037b72..f294f142be 100644 --- a/docs/v1/NotebookLogStreamCellAttributes.md +++ b/docs/v1/NotebookLogStreamCellAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **definition** | [**LogStreamWidgetDefinition**](LogStreamWidgetDefinition.md) | | **graph_size** | [**NotebookGraphSize**](NotebookGraphSize.md) | | [optional] **time** | [**NotebookCellTime**](NotebookCellTime.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookMarkdownCellAttributes.md b/docs/v1/NotebookMarkdownCellAttributes.md index 1475019585..8c42e0fbc9 100644 --- a/docs/v1/NotebookMarkdownCellAttributes.md +++ b/docs/v1/NotebookMarkdownCellAttributes.md @@ -6,7 +6,8 @@ The attributes of a notebook `markdown` cell. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **definition** | [**NotebookMarkdownCellDefinition**](NotebookMarkdownCellDefinition.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookMarkdownCellDefinition.md b/docs/v1/NotebookMarkdownCellDefinition.md index 4f8b8822fe..b1b7aa4693 100644 --- a/docs/v1/NotebookMarkdownCellDefinition.md +++ b/docs/v1/NotebookMarkdownCellDefinition.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **text** | **str** | The markdown content. | **type** | [**NotebookMarkdownCellDefinitionType**](NotebookMarkdownCellDefinitionType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookMarkdownCellDefinitionType.md b/docs/v1/NotebookMarkdownCellDefinitionType.md index 85d7368732..f3bc640b28 100644 --- a/docs/v1/NotebookMarkdownCellDefinitionType.md +++ b/docs/v1/NotebookMarkdownCellDefinitionType.md @@ -6,7 +6,8 @@ Type of the markdown cell. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the markdown cell. | defaults to "markdown", must be one of ["markdown", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookRelativeTime.md b/docs/v1/NotebookRelativeTime.md index 7c705234f1..1847d14eb6 100644 --- a/docs/v1/NotebookRelativeTime.md +++ b/docs/v1/NotebookRelativeTime.md @@ -6,7 +6,8 @@ Relative timeframe. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **live_span** | [**WidgetLiveSpan**](WidgetLiveSpan.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookResourceType.md b/docs/v1/NotebookResourceType.md index c015fc575a..4029500344 100644 --- a/docs/v1/NotebookResourceType.md +++ b/docs/v1/NotebookResourceType.md @@ -6,7 +6,8 @@ Type of the Notebook resource. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Notebook resource. | defaults to "notebooks", must be one of ["notebooks", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookResponse.md b/docs/v1/NotebookResponse.md index 255d061533..ea6f918059 100644 --- a/docs/v1/NotebookResponse.md +++ b/docs/v1/NotebookResponse.md @@ -6,7 +6,8 @@ The description of a notebook response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**NotebookResponseData**](NotebookResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookResponseData.md b/docs/v1/NotebookResponseData.md index af2e11e75a..69aa973956 100644 --- a/docs/v1/NotebookResponseData.md +++ b/docs/v1/NotebookResponseData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**NotebookResponseDataAttributes**](NotebookResponseDataAttributes.md) | | **id** | **int** | Unique notebook ID, assigned when you create the notebook. | [readonly] **type** | [**NotebookResourceType**](NotebookResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookResponseDataAttributes.md b/docs/v1/NotebookResponseDataAttributes.md index 53a2059573..5114250163 100644 --- a/docs/v1/NotebookResponseDataAttributes.md +++ b/docs/v1/NotebookResponseDataAttributes.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **created** | **datetime** | UTC time stamp for when the notebook was created. | [optional] [readonly] **modified** | **datetime** | UTC time stamp for when the notebook was last modified. | [optional] [readonly] **status** | [**NotebookStatus**](NotebookStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookSplitBy.md b/docs/v1/NotebookSplitBy.md index 04e843e1bb..804c2635fa 100644 --- a/docs/v1/NotebookSplitBy.md +++ b/docs/v1/NotebookSplitBy.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **keys** | **[str]** | Keys to split on. | **tags** | **[str]** | Tags to split on. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookStatus.md b/docs/v1/NotebookStatus.md index 0accc2f5ab..fdd862f17f 100644 --- a/docs/v1/NotebookStatus.md +++ b/docs/v1/NotebookStatus.md @@ -6,7 +6,8 @@ Publication status of the notebook. For now, always \"published\". Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Publication status of the notebook. For now, always \"published\". | defaults to "published", must be one of ["published", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookTimeseriesCellAttributes.md b/docs/v1/NotebookTimeseriesCellAttributes.md index af2498d141..fc67e91173 100644 --- a/docs/v1/NotebookTimeseriesCellAttributes.md +++ b/docs/v1/NotebookTimeseriesCellAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **graph_size** | [**NotebookGraphSize**](NotebookGraphSize.md) | | [optional] **split_by** | [**NotebookSplitBy**](NotebookSplitBy.md) | | [optional] **time** | [**NotebookCellTime**](NotebookCellTime.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookToplistCellAttributes.md b/docs/v1/NotebookToplistCellAttributes.md index 42873d84bb..1018f2038f 100644 --- a/docs/v1/NotebookToplistCellAttributes.md +++ b/docs/v1/NotebookToplistCellAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **graph_size** | [**NotebookGraphSize**](NotebookGraphSize.md) | | [optional] **split_by** | [**NotebookSplitBy**](NotebookSplitBy.md) | | [optional] **time** | [**NotebookCellTime**](NotebookCellTime.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookUpdateCell.md b/docs/v1/NotebookUpdateCell.md index 7e9bc4d76c..ce55f026bb 100644 --- a/docs/v1/NotebookUpdateCell.md +++ b/docs/v1/NotebookUpdateCell.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **NotebookCellCreateRequest** | [**NotebookCellCreateRequest**](NotebookCellCreateRequest.md) | Container class of the relevant properties. | **NotebookCellUpdateRequest** | [**NotebookCellUpdateRequest**](NotebookCellUpdateRequest.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookUpdateData.md b/docs/v1/NotebookUpdateData.md index 2aab416cd3..5d82fbe75c 100644 --- a/docs/v1/NotebookUpdateData.md +++ b/docs/v1/NotebookUpdateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**NotebookUpdateDataAttributes**](NotebookUpdateDataAttributes.md) | | **type** | [**NotebookResourceType**](NotebookResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookUpdateDataAttributes.md b/docs/v1/NotebookUpdateDataAttributes.md index c2ecadbb06..0f0684cffd 100644 --- a/docs/v1/NotebookUpdateDataAttributes.md +++ b/docs/v1/NotebookUpdateDataAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **name** | **str** | The name of the notebook. | **time** | [**NotebookGlobalTime**](NotebookGlobalTime.md) | | **status** | [**NotebookStatus**](NotebookStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebookUpdateRequest.md b/docs/v1/NotebookUpdateRequest.md index 57e6fc3a23..555705da9b 100644 --- a/docs/v1/NotebookUpdateRequest.md +++ b/docs/v1/NotebookUpdateRequest.md @@ -6,7 +6,8 @@ The description of a notebook update request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**NotebookUpdateData**](NotebookUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebooksResponse.md b/docs/v1/NotebooksResponse.md index 88f1f62676..dd3927b85b 100644 --- a/docs/v1/NotebooksResponse.md +++ b/docs/v1/NotebooksResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[NotebooksResponseData]**](NotebooksResponseData.md) | List of notebook definitions. | [optional] **meta** | [**NotebooksResponseMeta**](NotebooksResponseMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebooksResponseData.md b/docs/v1/NotebooksResponseData.md index ec906f2bf4..d53af08026 100644 --- a/docs/v1/NotebooksResponseData.md +++ b/docs/v1/NotebooksResponseData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**NotebooksResponseDataAttributes**](NotebooksResponseDataAttributes.md) | | **id** | **int** | Unique notebook ID, assigned when you create the notebook. | [readonly] **type** | [**NotebookResourceType**](NotebookResourceType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebooksResponseDataAttributes.md b/docs/v1/NotebooksResponseDataAttributes.md index 858051a502..d62d2a0bff 100644 --- a/docs/v1/NotebooksResponseDataAttributes.md +++ b/docs/v1/NotebooksResponseDataAttributes.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **modified** | **datetime** | UTC time stamp for when the notebook was last modified. | [optional] [readonly] **status** | [**NotebookStatus**](NotebookStatus.md) | | [optional] **time** | [**NotebookGlobalTime**](NotebookGlobalTime.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebooksResponseMeta.md b/docs/v1/NotebooksResponseMeta.md index 0acf8ab79c..3ac49fcd15 100644 --- a/docs/v1/NotebooksResponseMeta.md +++ b/docs/v1/NotebooksResponseMeta.md @@ -6,7 +6,8 @@ Metadata returned by the API. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**NotebooksResponsePage**](NotebooksResponsePage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/NotebooksResponsePage.md b/docs/v1/NotebooksResponsePage.md index e6b8f6fcaa..a95717bcef 100644 --- a/docs/v1/NotebooksResponsePage.md +++ b/docs/v1/NotebooksResponsePage.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_count** | **int** | The total number of notebooks that would be returned if the request was not filtered by `start` and `count` parameters. | [optional] **total_filtered_count** | **int** | The total number of notebooks returned. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Organization.md b/docs/v1/Organization.md index a933834143..2448b20c55 100644 --- a/docs/v1/Organization.md +++ b/docs/v1/Organization.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **public_id** | **str** | The `public_id` of the organization you are operating within. | [optional] **settings** | [**OrganizationSettings**](OrganizationSettings.md) | | [optional] **subscription** | [**OrganizationSubscription**](OrganizationSubscription.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationBilling.md b/docs/v1/OrganizationBilling.md index 53747c90e7..de7be4b2b1 100644 --- a/docs/v1/OrganizationBilling.md +++ b/docs/v1/OrganizationBilling.md @@ -6,7 +6,8 @@ A JSON array of billing type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | The type of billing. Only `parent_billing` is supported. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationCreateBody.md b/docs/v1/OrganizationCreateBody.md index 4f79b29321..1c4e4395e4 100644 --- a/docs/v1/OrganizationCreateBody.md +++ b/docs/v1/OrganizationCreateBody.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **name** | **str** | The name of the new child-organization, limited to 32 characters. | **billing** | [**OrganizationBilling**](OrganizationBilling.md) | | [optional] **subscription** | [**OrganizationSubscription**](OrganizationSubscription.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationCreateResponse.md b/docs/v1/OrganizationCreateResponse.md index 02ced763a8..ccfb402a84 100644 --- a/docs/v1/OrganizationCreateResponse.md +++ b/docs/v1/OrganizationCreateResponse.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **application_key** | [**ApplicationKey**](ApplicationKey.md) | | [optional] **org** | [**Organization**](Organization.md) | | [optional] **user** | [**User**](User.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationListResponse.md b/docs/v1/OrganizationListResponse.md index 79a7be61ef..ebeb90adaa 100644 --- a/docs/v1/OrganizationListResponse.md +++ b/docs/v1/OrganizationListResponse.md @@ -6,7 +6,8 @@ Response with the list of organizations. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **orgs** | [**[Organization]**](Organization.md) | Array of organization objects. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationResponse.md b/docs/v1/OrganizationResponse.md index d74bf83190..9c4f81665f 100644 --- a/docs/v1/OrganizationResponse.md +++ b/docs/v1/OrganizationResponse.md @@ -6,7 +6,8 @@ Response with an organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **org** | [**Organization**](Organization.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationSettings.md b/docs/v1/OrganizationSettings.md index 8fa7a62829..b4c95d44dd 100644 --- a/docs/v1/OrganizationSettings.md +++ b/docs/v1/OrganizationSettings.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **saml_idp_metadata_uploaded** | **bool** | Whether or not a SAML identity provider metadata file was provided to the Datadog organization. | [optional] **saml_login_url** | **str** | URL for SAML logging. | [optional] **saml_strict_mode** | [**OrganizationSettingsSamlStrictMode**](OrganizationSettingsSamlStrictMode.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationSettingsSaml.md b/docs/v1/OrganizationSettingsSaml.md index 1d04260b70..9c4f9815f4 100644 --- a/docs/v1/OrganizationSettingsSaml.md +++ b/docs/v1/OrganizationSettingsSaml.md @@ -6,7 +6,8 @@ Set the boolean property enabled to enable or disable single sign on with SAML. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | Whether or not SAML is enabled for this organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationSettingsSamlAutocreateUsersDomains.md b/docs/v1/OrganizationSettingsSamlAutocreateUsersDomains.md index e51d6a781e..2972dac7fc 100644 --- a/docs/v1/OrganizationSettingsSamlAutocreateUsersDomains.md +++ b/docs/v1/OrganizationSettingsSamlAutocreateUsersDomains.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **domains** | **[str]** | List of domains where the SAML automated user creation is enabled. | [optional] **enabled** | **bool** | Whether or not the automated user creation based on SAML domain is enabled. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationSettingsSamlIdpInitiatedLogin.md b/docs/v1/OrganizationSettingsSamlIdpInitiatedLogin.md index 1fd5258be1..0ec41410d0 100644 --- a/docs/v1/OrganizationSettingsSamlIdpInitiatedLogin.md +++ b/docs/v1/OrganizationSettingsSamlIdpInitiatedLogin.md @@ -6,7 +6,8 @@ Has one property enabled (boolean). Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | Whether SAML IdP initiated login is enabled, learn more in the [SAML documentation](https://docs.datadoghq.com/account_management/saml/#idp-initiated-login). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationSettingsSamlStrictMode.md b/docs/v1/OrganizationSettingsSamlStrictMode.md index 1c05fb1901..56cce09aba 100644 --- a/docs/v1/OrganizationSettingsSamlStrictMode.md +++ b/docs/v1/OrganizationSettingsSamlStrictMode.md @@ -6,7 +6,8 @@ Has one property enabled (boolean). Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enabled** | **bool** | Whether or not the SAML strict mode is enabled. If true, all users must log in with SAML. Learn more on the [SAML Strict documentation](https://docs.datadoghq.com/account_management/saml/#saml-strict). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationSubscription.md b/docs/v1/OrganizationSubscription.md index a11535ba83..1027e935cf 100644 --- a/docs/v1/OrganizationSubscription.md +++ b/docs/v1/OrganizationSubscription.md @@ -6,7 +6,8 @@ Subscription definition. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | The subscription type. Types available are `trial`, `free`, and `pro`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/OrganizationsApi.md b/docs/v1/OrganizationsApi.md index cbe1e13caf..5574febfbe 100644 --- a/docs/v1/OrganizationsApi.md +++ b/docs/v1/OrganizationsApi.md @@ -243,7 +243,6 @@ with ApiClient(configuration) as api_client: billing=OrganizationBilling( type="type_example", ), - created="2019-09-26T17:28:28Z", description="some description", name="New child org", public_id="abcdef12345", diff --git a/docs/v1/PagerDutyService.md b/docs/v1/PagerDutyService.md index 05b47ba9c0..76e2d379b9 100644 --- a/docs/v1/PagerDutyService.md +++ b/docs/v1/PagerDutyService.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **service_key** | **str** | Your service key in PagerDuty. | **service_name** | **str** | Your service name associated with a service key in PagerDuty. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/PagerDutyServiceKey.md b/docs/v1/PagerDutyServiceKey.md index 40003e794b..9e67e22958 100644 --- a/docs/v1/PagerDutyServiceKey.md +++ b/docs/v1/PagerDutyServiceKey.md @@ -6,7 +6,8 @@ PagerDuty service object key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **service_key** | **str** | Your service key in PagerDuty. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/PagerDutyServiceName.md b/docs/v1/PagerDutyServiceName.md index cc9f0fab63..59df7f7db0 100644 --- a/docs/v1/PagerDutyServiceName.md +++ b/docs/v1/PagerDutyServiceName.md @@ -6,7 +6,8 @@ PagerDuty service object name. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **service_name** | **str** | Your service name associated service key in PagerDuty. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Pagination.md b/docs/v1/Pagination.md index ed882c10a2..5b389aeb67 100644 --- a/docs/v1/Pagination.md +++ b/docs/v1/Pagination.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_count** | **int** | Total count. | [optional] **total_filtered_count** | **int** | Total count of elements matched by the filter. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Point.md b/docs/v1/Point.md index 15d57144a7..b52e723327 100644 --- a/docs/v1/Point.md +++ b/docs/v1/Point.md @@ -6,7 +6,8 @@ Array of timeseries points. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **[float, none_type]** | Array of timeseries points. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ProcessQueryDefinition.md b/docs/v1/ProcessQueryDefinition.md index c057a3a9db..4bf8b5477f 100644 --- a/docs/v1/ProcessQueryDefinition.md +++ b/docs/v1/ProcessQueryDefinition.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **filter_by** | **[str]** | List of processes. | [optional] **limit** | **int** | Max number of items in the filter list. | [optional] **search_by** | **str** | Your chosen search term. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/QuerySortOrder.md b/docs/v1/QuerySortOrder.md index 286472ed01..93a385e5e1 100644 --- a/docs/v1/QuerySortOrder.md +++ b/docs/v1/QuerySortOrder.md @@ -6,7 +6,8 @@ Direction of sort. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Direction of sort. | defaults to "desc", must be one of ["asc", "desc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/QueryValueWidgetDefinition.md b/docs/v1/QueryValueWidgetDefinition.md index 85e6e0c2b6..b6cafa97c8 100644 --- a/docs/v1/QueryValueWidgetDefinition.md +++ b/docs/v1/QueryValueWidgetDefinition.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **title** | **str** | Title of your widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/QueryValueWidgetDefinitionType.md b/docs/v1/QueryValueWidgetDefinitionType.md index f7f2ed9196..8043706b2f 100644 --- a/docs/v1/QueryValueWidgetDefinitionType.md +++ b/docs/v1/QueryValueWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the query value widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the query value widget. | defaults to "query_value", must be one of ["query_value", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/QueryValueWidgetRequest.md b/docs/v1/QueryValueWidgetRequest.md index a1b2d403f5..5ee2663157 100644 --- a/docs/v1/QueryValueWidgetRequest.md +++ b/docs/v1/QueryValueWidgetRequest.md @@ -20,7 +20,8 @@ Name | Type | Description | Notes **response_format** | [**FormulaAndFunctionResponseFormat**](FormulaAndFunctionResponseFormat.md) | | [optional] **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ResponseMetaAttributes.md b/docs/v1/ResponseMetaAttributes.md index 6ee5f4e819..bec772186f 100644 --- a/docs/v1/ResponseMetaAttributes.md +++ b/docs/v1/ResponseMetaAttributes.md @@ -6,7 +6,8 @@ Object describing meta attributes of response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**Pagination**](Pagination.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOBulkDelete.md b/docs/v1/SLOBulkDelete.md index a76df1229d..173c241534 100644 --- a/docs/v1/SLOBulkDelete.md +++ b/docs/v1/SLOBulkDelete.md @@ -5,8 +5,8 @@ A map of service level objective object IDs to arrays of timeframes, which indic ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**any string name** | **[SLOTimeframe]** | any string name can be used but the value must be the correct type | [optional] +**any string name** | [**[SLOTimeframe]**](SLOTimeframe.md) | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOBulkDeleteError.md b/docs/v1/SLOBulkDeleteError.md index 0683597181..805ef284d8 100644 --- a/docs/v1/SLOBulkDeleteError.md +++ b/docs/v1/SLOBulkDeleteError.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **id** | **str** | The ID of the service level objective object associated with this error. | **message** | **str** | The error message. | **timeframe** | [**SLOErrorTimeframe**](SLOErrorTimeframe.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOBulkDeleteResponse.md b/docs/v1/SLOBulkDeleteResponse.md index 56b49f34a3..67a6275c98 100644 --- a/docs/v1/SLOBulkDeleteResponse.md +++ b/docs/v1/SLOBulkDeleteResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SLOBulkDeleteResponseData**](SLOBulkDeleteResponseData.md) | | [optional] **errors** | [**[SLOBulkDeleteError]**](SLOBulkDeleteError.md) | Array of errors object returned. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOBulkDeleteResponseData.md b/docs/v1/SLOBulkDeleteResponseData.md index 8c071fbe5e..c00b561685 100644 --- a/docs/v1/SLOBulkDeleteResponseData.md +++ b/docs/v1/SLOBulkDeleteResponseData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted** | **[str]** | An array of service level objective object IDs that indicates which objects that were completely deleted. | [optional] **updated** | **[str]** | An array of service level objective object IDs that indicates which objects that were modified (objects for which at least one threshold was deleted, but that were not completely deleted). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrection.md b/docs/v1/SLOCorrection.md index 9008d8256c..ae42c3ebd7 100644 --- a/docs/v1/SLOCorrection.md +++ b/docs/v1/SLOCorrection.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**SLOCorrectionResponseAttributes**](SLOCorrectionResponseAttributes.md) | | [optional] **id** | **str** | The ID of the SLO correction | [optional] **type** | [**SLOCorrectionType**](SLOCorrectionType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionCategory.md b/docs/v1/SLOCorrectionCategory.md index 375c2cf973..761a180e9e 100644 --- a/docs/v1/SLOCorrectionCategory.md +++ b/docs/v1/SLOCorrectionCategory.md @@ -6,7 +6,8 @@ Category the SLO correction belongs to Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Category the SLO correction belongs to | must be one of ["Scheduled Maintenance", "Outside Business Hours", "Deployment", "Other", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionCreateData.md b/docs/v1/SLOCorrectionCreateData.md index 4bfe0edce7..d314194cec 100644 --- a/docs/v1/SLOCorrectionCreateData.md +++ b/docs/v1/SLOCorrectionCreateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**SLOCorrectionCreateRequestAttributes**](SLOCorrectionCreateRequestAttributes.md) | | [optional] **type** | [**SLOCorrectionType**](SLOCorrectionType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionCreateRequest.md b/docs/v1/SLOCorrectionCreateRequest.md index 2f74974d00..86f56d6bc7 100644 --- a/docs/v1/SLOCorrectionCreateRequest.md +++ b/docs/v1/SLOCorrectionCreateRequest.md @@ -6,7 +6,8 @@ An object that defines a correction to be applied to an SLO Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SLOCorrectionCreateData**](SLOCorrectionCreateData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionCreateRequestAttributes.md b/docs/v1/SLOCorrectionCreateRequestAttributes.md index 877ab2cdcb..ad1d0882cc 100644 --- a/docs/v1/SLOCorrectionCreateRequestAttributes.md +++ b/docs/v1/SLOCorrectionCreateRequestAttributes.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **start** | **int** | Starting time of the correction in epoch seconds | **description** | **str** | Description of the correction being made. | [optional] **timezone** | **str** | The timezone to display in the UI for the correction times (defaults to \"UTC\") | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionListResponse.md b/docs/v1/SLOCorrectionListResponse.md index c1e4fb7d83..ba0ed50d99 100644 --- a/docs/v1/SLOCorrectionListResponse.md +++ b/docs/v1/SLOCorrectionListResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[SLOCorrection]**](SLOCorrection.md) | The list of of SLO corrections objects | [optional] **meta** | [**ResponseMetaAttributes**](ResponseMetaAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionResponse.md b/docs/v1/SLOCorrectionResponse.md index ae05ec9690..69a6fcf4fd 100644 --- a/docs/v1/SLOCorrectionResponse.md +++ b/docs/v1/SLOCorrectionResponse.md @@ -6,7 +6,8 @@ The response object of an SLO correction Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SLOCorrection**](SLOCorrection.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionResponseAttributes.md b/docs/v1/SLOCorrectionResponseAttributes.md index e3791c5c92..50a7ec0410 100644 --- a/docs/v1/SLOCorrectionResponseAttributes.md +++ b/docs/v1/SLOCorrectionResponseAttributes.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **slo_id** | **str** | ID of the SLO that this correction will be applied to | [optional] **start** | **int** | Starting time of the correction in epoch seconds | [optional] **timezone** | **str** | The timezone to display in the UI for the correction times (defaults to \"UTC\") | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionType.md b/docs/v1/SLOCorrectionType.md index 5fd4066672..fb1b97bc86 100644 --- a/docs/v1/SLOCorrectionType.md +++ b/docs/v1/SLOCorrectionType.md @@ -6,7 +6,8 @@ SLO correction resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | SLO correction resource type. | defaults to "correction", must be one of ["correction", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionUpdateData.md b/docs/v1/SLOCorrectionUpdateData.md index 9f50add8d8..190956bb3c 100644 --- a/docs/v1/SLOCorrectionUpdateData.md +++ b/docs/v1/SLOCorrectionUpdateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**SLOCorrectionUpdateRequestAttributes**](SLOCorrectionUpdateRequestAttributes.md) | | [optional] **type** | [**SLOCorrectionType**](SLOCorrectionType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionUpdateRequest.md b/docs/v1/SLOCorrectionUpdateRequest.md index bbb815ab13..c79e64bf4a 100644 --- a/docs/v1/SLOCorrectionUpdateRequest.md +++ b/docs/v1/SLOCorrectionUpdateRequest.md @@ -6,7 +6,8 @@ An object that defines a correction to be applied to an SLO Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SLOCorrectionUpdateData**](SLOCorrectionUpdateData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOCorrectionUpdateRequestAttributes.md b/docs/v1/SLOCorrectionUpdateRequestAttributes.md index 10904c1a74..d4227a5a4c 100644 --- a/docs/v1/SLOCorrectionUpdateRequestAttributes.md +++ b/docs/v1/SLOCorrectionUpdateRequestAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **end** | **int** | Ending time of the correction in epoch seconds | [optional] **start** | **int** | Starting time of the correction in epoch seconds | [optional] **timezone** | **str** | The timezone to display in the UI for the correction times (defaults to \"UTC\") | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLODeleteResponse.md b/docs/v1/SLODeleteResponse.md index fe25c57f2e..56edbb4dd8 100644 --- a/docs/v1/SLODeleteResponse.md +++ b/docs/v1/SLODeleteResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | **[str]** | An array containing the ID of the deleted service level objective object. | [optional] **errors** | **{str: (str,)}** | An dictionary containing the ID of the SLO as key and a deletion error as value. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOErrorBudgetRemainingData.md b/docs/v1/SLOErrorBudgetRemainingData.md index 76f6461112..59237c63ba 100644 --- a/docs/v1/SLOErrorBudgetRemainingData.md +++ b/docs/v1/SLOErrorBudgetRemainingData.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **any string name** | **float** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOErrorTimeframe.md b/docs/v1/SLOErrorTimeframe.md index b6d9c26368..b69643e11d 100644 --- a/docs/v1/SLOErrorTimeframe.md +++ b/docs/v1/SLOErrorTimeframe.md @@ -6,7 +6,8 @@ The timeframe of the threshold associated with this error or \"all\" if all thre Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The timeframe of the threshold associated with this error or \"all\" if all thresholds are affected. | must be one of ["7d", "30d", "90d", "all", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryMetrics.md b/docs/v1/SLOHistoryMetrics.md index 040b26f8e2..e139f60753 100644 --- a/docs/v1/SLOHistoryMetrics.md +++ b/docs/v1/SLOHistoryMetrics.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **resp_version** | **int** | The series response version type. This mimics `batch_query` response type. | **times** | **[float]** | An array of query timestamps in EPOCH milliseconds | **message** | **str** | Optional message if there are specific query issues/warnings. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryMetricsSeries.md b/docs/v1/SLOHistoryMetricsSeries.md index 4906d8b992..18567c7d8d 100644 --- a/docs/v1/SLOHistoryMetricsSeries.md +++ b/docs/v1/SLOHistoryMetricsSeries.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **metadata** | [**SLOHistoryMetricsSeriesMetadata**](SLOHistoryMetricsSeriesMetadata.md) | | **sum** | **float** | Total sum of the query. | **values** | **[float]** | The query values for each metric. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryMetricsSeriesMetadata.md b/docs/v1/SLOHistoryMetricsSeriesMetadata.md index 6a22b05792..561053f996 100644 --- a/docs/v1/SLOHistoryMetricsSeriesMetadata.md +++ b/docs/v1/SLOHistoryMetricsSeriesMetadata.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **query_index** | **int** | Query index from original combined query. | [optional] **scope** | **str** | Query scope. | [optional] **unit** | [**[SLOHistoryMetricsSeriesMetadataUnit], none_type**](SLOHistoryMetricsSeriesMetadataUnit.md) | An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryMetricsSeriesMetadataUnit.md b/docs/v1/SLOHistoryMetricsSeriesMetadataUnit.md index 7c30f47432..7ec26580bf 100644 --- a/docs/v1/SLOHistoryMetricsSeriesMetadataUnit.md +++ b/docs/v1/SLOHistoryMetricsSeriesMetadataUnit.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **plural** | **str, none_type** | The plural Unit of metric, for instance `bytes`. | [optional] **scale_factor** | **float** | The scale factor of metric unit, for instance `1.0`. | [optional] **short_name** | **str, none_type** | A shorter and abbreviated version of the metric unit, for instance `B`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryResponse.md b/docs/v1/SLOHistoryResponse.md index 58d9ed4af7..9da1b54bb1 100644 --- a/docs/v1/SLOHistoryResponse.md +++ b/docs/v1/SLOHistoryResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SLOHistoryResponseData**](SLOHistoryResponseData.md) | | [optional] **errors** | [**[SLOHistoryResponseError]**](SLOHistoryResponseError.md) | A list of errors while querying the history data for the service level objective. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryResponseData.md b/docs/v1/SLOHistoryResponseData.md index c37414ebf7..3c346b2f62 100644 --- a/docs/v1/SLOHistoryResponseData.md +++ b/docs/v1/SLOHistoryResponseData.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **to_ts** | **int** | The `to` timestamp in epoch seconds. | [optional] **type** | [**SLOType**](SLOType.md) | | [optional] **type_id** | [**SLOTypeNumeric**](SLOTypeNumeric.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistoryResponseError.md b/docs/v1/SLOHistoryResponseError.md index 62597db9ae..44969cfc58 100644 --- a/docs/v1/SLOHistoryResponseError.md +++ b/docs/v1/SLOHistoryResponseError.md @@ -6,7 +6,8 @@ A service level objective response containing the requested history. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | **str** | Human readable error. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOHistorySLIData.md b/docs/v1/SLOHistorySLIData.md index 90dc71595c..1f44eab0ad 100644 --- a/docs/v1/SLOHistorySLIData.md +++ b/docs/v1/SLOHistorySLIData.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **sli_value** | **float** | The current SLI value of the SLO over the history window. | [optional] **span_precision** | **float** | The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp. | [optional] **uptime** | **float** | Use `sli_value` instead. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOListResponse.md b/docs/v1/SLOListResponse.md index e925b31501..9176c9e2ce 100644 --- a/docs/v1/SLOListResponse.md +++ b/docs/v1/SLOListResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[ServiceLevelObjective]**](ServiceLevelObjective.md) | An array of service level objective objects. | [optional] **errors** | **[str]** | An array of error messages. Each endpoint documents how/whether this field is used. | [optional] **metadata** | [**SLOListResponseMetadata**](SLOListResponseMetadata.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOListResponseMetadata.md b/docs/v1/SLOListResponseMetadata.md index 1653323b01..b11f3e7e9f 100644 --- a/docs/v1/SLOListResponseMetadata.md +++ b/docs/v1/SLOListResponseMetadata.md @@ -6,7 +6,8 @@ The metadata object containing additional information about the list of SLOs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**SLOListResponseMetadataPage**](SLOListResponseMetadataPage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOListResponseMetadataPage.md b/docs/v1/SLOListResponseMetadataPage.md index e6791bd692..cf06143821 100644 --- a/docs/v1/SLOListResponseMetadataPage.md +++ b/docs/v1/SLOListResponseMetadataPage.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_count** | **int** | The total number of resources that could be retrieved ignoring the parameters and filters in the request. | [optional] **total_filtered_count** | **int** | The total number of resources that match the parameters and filters in the request. This attribute can be used by a client to determine the total number of pages. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOResponse.md b/docs/v1/SLOResponse.md index 887b3b094d..c9bc05470c 100644 --- a/docs/v1/SLOResponse.md +++ b/docs/v1/SLOResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SLOResponseData**](SLOResponseData.md) | | [optional] **errors** | **[str]** | An array of error messages. Each endpoint documents how/whether this field is used. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOResponseData.md b/docs/v1/SLOResponseData.md index 8933b63455..b9dc01a721 100644 --- a/docs/v1/SLOResponseData.md +++ b/docs/v1/SLOResponseData.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **tags** | **[str]** | A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. | [optional] **thresholds** | [**[SLOThreshold]**](SLOThreshold.md) | The thresholds (timeframes and associated targets) for this service level objective object. | [optional] **type** | [**SLOType**](SLOType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOThreshold.md b/docs/v1/SLOThreshold.md index 4c47c85373..19a4e36153 100644 --- a/docs/v1/SLOThreshold.md +++ b/docs/v1/SLOThreshold.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **target_display** | **str** | A string representation of the target that indicates its precision. It uses trailing zeros to show significant decimal places (e.g. `98.00`). Always included in service level objective responses. Ignored in create/update requests. | [optional] **warning** | **float** | The warning value for the service level objective. | [optional] **warning_display** | **str** | A string representation of the warning target (see the description of the `target_display` field for details). Included in service level objective responses if a warning target exists. Ignored in create/update requests. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOTimeframe.md b/docs/v1/SLOTimeframe.md index 1d6d5acb61..259f38002b 100644 --- a/docs/v1/SLOTimeframe.md +++ b/docs/v1/SLOTimeframe.md @@ -6,7 +6,8 @@ The SLO time window options. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The SLO time window options. | must be one of ["7d", "30d", "90d", "custom", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOType.md b/docs/v1/SLOType.md index 46b8d8e8a0..58a9770f64 100644 --- a/docs/v1/SLOType.md +++ b/docs/v1/SLOType.md @@ -6,7 +6,8 @@ The type of the service level objective. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of the service level objective. | must be one of ["metric", "monitor", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOTypeNumeric.md b/docs/v1/SLOTypeNumeric.md index 6ce75424aa..59a36a17e9 100644 --- a/docs/v1/SLOTypeNumeric.md +++ b/docs/v1/SLOTypeNumeric.md @@ -6,7 +6,8 @@ A numeric representation of the type of the service level objective (`0` for mon Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | A numeric representation of the type of the service level objective (`0` for monitor, `1` for metric). Always included in service level objective responses. Ignored in create/update requests. | must be one of [0, 1, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOWidgetDefinition.md b/docs/v1/SLOWidgetDefinition.md index 6ff0840a7e..ca08e3ce39 100644 --- a/docs/v1/SLOWidgetDefinition.md +++ b/docs/v1/SLOWidgetDefinition.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] **view_mode** | [**WidgetViewMode**](WidgetViewMode.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SLOWidgetDefinitionType.md b/docs/v1/SLOWidgetDefinitionType.md index a87837ab5f..85d3fbe823 100644 --- a/docs/v1/SLOWidgetDefinitionType.md +++ b/docs/v1/SLOWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the SLO widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the SLO widget. | defaults to "slo", must be one of ["slo", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ScatterPlotRequest.md b/docs/v1/ScatterPlotRequest.md index 25a1ec5f12..7cde9116ce 100644 --- a/docs/v1/ScatterPlotRequest.md +++ b/docs/v1/ScatterPlotRequest.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **q** | **str** | Query definition. | [optional] **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ScatterPlotWidgetDefinition.md b/docs/v1/ScatterPlotWidgetDefinition.md index f4d3eb2bf7..0fac06a857 100644 --- a/docs/v1/ScatterPlotWidgetDefinition.md +++ b/docs/v1/ScatterPlotWidgetDefinition.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **title_size** | **str** | Size of the title. | [optional] **xaxis** | [**WidgetAxis**](WidgetAxis.md) | | [optional] **yaxis** | [**WidgetAxis**](WidgetAxis.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ScatterPlotWidgetDefinitionRequests.md b/docs/v1/ScatterPlotWidgetDefinitionRequests.md index 3ae535c4ba..2fb2222155 100644 --- a/docs/v1/ScatterPlotWidgetDefinitionRequests.md +++ b/docs/v1/ScatterPlotWidgetDefinitionRequests.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **x** | [**ScatterPlotRequest**](ScatterPlotRequest.md) | | **y** | [**ScatterPlotRequest**](ScatterPlotRequest.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ScatterPlotWidgetDefinitionType.md b/docs/v1/ScatterPlotWidgetDefinitionType.md index e3b305cb53..282c0ac7e3 100644 --- a/docs/v1/ScatterPlotWidgetDefinitionType.md +++ b/docs/v1/ScatterPlotWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the scatter plot widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the scatter plot widget. | defaults to "scatterplot", must be one of ["scatterplot", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/Series.md b/docs/v1/Series.md index b9de852985..3e6a0f36c2 100644 --- a/docs/v1/Series.md +++ b/docs/v1/Series.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **interval** | **int, none_type** | If the type of the metric is rate or count, define the corresponding interval. | [optional] **tags** | **[str]** | A list of tags associated with the metric. | [optional] **type** | **str** | The type of the metric either `count`, `gauge`, or `rate`. | [optional] if omitted the server will use the default value of "gauge" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceCheck.md b/docs/v1/ServiceCheck.md index c8b060e6a1..4dbc186e1c 100644 --- a/docs/v1/ServiceCheck.md +++ b/docs/v1/ServiceCheck.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **tags** | **[str]** | Tags related to a check. | **message** | **str** | Message containing check status. | [optional] **timestamp** | **int** | Time of check. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceCheckStatus.md b/docs/v1/ServiceCheckStatus.md index 0895f3a6ed..6b3ce1dc9a 100644 --- a/docs/v1/ServiceCheckStatus.md +++ b/docs/v1/ServiceCheckStatus.md @@ -6,7 +6,8 @@ The status of a service check. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | The status of a service check. | must be one of [0, 1, 2, 3, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceChecks.md b/docs/v1/ServiceChecks.md index f5c7012236..d57c3b8d91 100644 --- a/docs/v1/ServiceChecks.md +++ b/docs/v1/ServiceChecks.md @@ -6,7 +6,8 @@ The service checks. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[ServiceCheck]**](ServiceCheck.md) | The service checks. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceLevelObjective.md b/docs/v1/ServiceLevelObjective.md index 77cf2c3d8c..4038622306 100644 --- a/docs/v1/ServiceLevelObjective.md +++ b/docs/v1/ServiceLevelObjective.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **monitor_tags** | **[str]** | The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field). | [optional] **query** | [**ServiceLevelObjectiveQuery**](ServiceLevelObjectiveQuery.md) | | [optional] **tags** | **[str]** | A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceLevelObjectiveQuery.md b/docs/v1/ServiceLevelObjectiveQuery.md index 2f14bba1a3..5c5d8d93bb 100644 --- a/docs/v1/ServiceLevelObjectiveQuery.md +++ b/docs/v1/ServiceLevelObjectiveQuery.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **denominator** | **str** | A Datadog metric query for total (valid) events. | **numerator** | **str** | A Datadog metric query for good events. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceLevelObjectiveRequest.md b/docs/v1/ServiceLevelObjectiveRequest.md index 352d8333ce..119f07a438 100644 --- a/docs/v1/ServiceLevelObjectiveRequest.md +++ b/docs/v1/ServiceLevelObjectiveRequest.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **monitor_ids** | **[int]** | A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**. | [optional] **query** | [**ServiceLevelObjectiveQuery**](ServiceLevelObjectiveQuery.md) | | [optional] **tags** | **[str]** | A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceLevelObjectivesApi.md b/docs/v1/ServiceLevelObjectivesApi.md index 99c68b9316..15638cb0f5 100644 --- a/docs/v1/ServiceLevelObjectivesApi.md +++ b/docs/v1/ServiceLevelObjectivesApi.md @@ -581,16 +581,8 @@ with ApiClient(configuration) as api_client: api_instance = service_level_objectives_api.ServiceLevelObjectivesApi(api_client) slo_id = "slo_id_example" # str | The ID of the service level objective object. body = ServiceLevelObjective( - created_at=1, - creator=Creator( - email="email_example", - handle="handle_example", - name="name_example", - ), description="description_example", groups=["env:prod","role:mysql"], - id="id_example", - modified_at=1, monitor_ids=[ 1, ], diff --git a/docs/v1/ServiceMapWidgetDefinition.md b/docs/v1/ServiceMapWidgetDefinition.md index acbd8e6802..8df2345b44 100644 --- a/docs/v1/ServiceMapWidgetDefinition.md +++ b/docs/v1/ServiceMapWidgetDefinition.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **title** | **str** | The title of your widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceMapWidgetDefinitionType.md b/docs/v1/ServiceMapWidgetDefinitionType.md index 04bc621267..09628602cb 100644 --- a/docs/v1/ServiceMapWidgetDefinitionType.md +++ b/docs/v1/ServiceMapWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the service map widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the service map widget. | defaults to "servicemap", must be one of ["servicemap", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceSummaryWidgetDefinition.md b/docs/v1/ServiceSummaryWidgetDefinition.md index 3670a210b9..f5c3300531 100644 --- a/docs/v1/ServiceSummaryWidgetDefinition.md +++ b/docs/v1/ServiceSummaryWidgetDefinition.md @@ -21,7 +21,8 @@ Name | Type | Description | Notes **title** | **str** | Title of the widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ServiceSummaryWidgetDefinitionType.md b/docs/v1/ServiceSummaryWidgetDefinitionType.md index be32f02010..0245078530 100644 --- a/docs/v1/ServiceSummaryWidgetDefinitionType.md +++ b/docs/v1/ServiceSummaryWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the service summary widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the service summary widget. | defaults to "trace_service", must be one of ["trace_service", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SlackIntegrationChannel.md b/docs/v1/SlackIntegrationChannel.md index 43a535623f..867c467d3e 100644 --- a/docs/v1/SlackIntegrationChannel.md +++ b/docs/v1/SlackIntegrationChannel.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **display** | [**SlackIntegrationChannelDisplay**](SlackIntegrationChannelDisplay.md) | | [optional] **name** | **str** | Your channel name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SlackIntegrationChannelDisplay.md b/docs/v1/SlackIntegrationChannelDisplay.md index 2089c86bfb..9d7be88d3c 100644 --- a/docs/v1/SlackIntegrationChannelDisplay.md +++ b/docs/v1/SlackIntegrationChannelDisplay.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **notified** | **bool** | Show the list of @-handles in the alert event. | [optional] if omitted the server will use the default value of True **snapshot** | **bool** | Show the alert event's snapshot image. | [optional] if omitted the server will use the default value of True **tags** | **bool** | Show the scopes on which the monitor alerted. | [optional] if omitted the server will use the default value of True +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SlackIntegrationChannels.md b/docs/v1/SlackIntegrationChannels.md index 1cfdbb4baf..8ea5c6b6fc 100644 --- a/docs/v1/SlackIntegrationChannels.md +++ b/docs/v1/SlackIntegrationChannels.md @@ -6,7 +6,8 @@ A list of configured Slack channels. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[SlackIntegrationChannel]**](SlackIntegrationChannel.md) | A list of configured Slack channels. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPIStep.md b/docs/v1/SyntheticsAPIStep.md index e60b9c3937..90efd1444b 100644 --- a/docs/v1/SyntheticsAPIStep.md +++ b/docs/v1/SyntheticsAPIStep.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **name** | **str** | The name of the step. | [optional] **request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | [optional] **subtype** | [**SyntheticsAPIStepSubtype**](SyntheticsAPIStepSubtype.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPIStepSubtype.md b/docs/v1/SyntheticsAPIStepSubtype.md index 6863591942..ae2e32ee1a 100644 --- a/docs/v1/SyntheticsAPIStepSubtype.md +++ b/docs/v1/SyntheticsAPIStepSubtype.md @@ -6,7 +6,8 @@ The subtype of the Synthetic multistep API test step, currently only supporting Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The subtype of the Synthetic multistep API test step, currently only supporting `http`. | defaults to "http", must be one of ["http", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITest.md b/docs/v1/SyntheticsAPITest.md index cb243fd5da..868dfe06ab 100644 --- a/docs/v1/SyntheticsAPITest.md +++ b/docs/v1/SyntheticsAPITest.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **subtype** | [**SyntheticsTestDetailsSubType**](SyntheticsTestDetailsSubType.md) | | [optional] **tags** | **[str]** | Array of tags attached to the test. | [optional] **type** | [**SyntheticsAPITestType**](SyntheticsAPITestType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestConfig.md b/docs/v1/SyntheticsAPITestConfig.md index da9fafaf4b..d418d16961 100644 --- a/docs/v1/SyntheticsAPITestConfig.md +++ b/docs/v1/SyntheticsAPITestConfig.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **config_variables** | [**[SyntheticsConfigVariable]**](SyntheticsConfigVariable.md) | Array of variables used for the test. | [optional] **request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | [optional] **steps** | [**[SyntheticsAPIStep]**](SyntheticsAPIStep.md) | When the test subtype is `multi`, the steps of the test. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestResultData.md b/docs/v1/SyntheticsAPITestResultData.md index a7875050ee..9eee91b3e1 100644 --- a/docs/v1/SyntheticsAPITestResultData.md +++ b/docs/v1/SyntheticsAPITestResultData.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **response_headers** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}** | Response headers returned for the API test. | [optional] **response_size** | **int** | Global size in byte of the API test response. | [optional] **timings** | [**SyntheticsTiming**](SyntheticsTiming.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestResultFull.md b/docs/v1/SyntheticsAPITestResultFull.md index 624f1244b4..fbffcd36b6 100644 --- a/docs/v1/SyntheticsAPITestResultFull.md +++ b/docs/v1/SyntheticsAPITestResultFull.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **result** | [**SyntheticsAPITestResultData**](SyntheticsAPITestResultData.md) | | [optional] **result_id** | **str** | ID of the API test result. | [optional] **status** | [**SyntheticsTestMonitorStatus**](SyntheticsTestMonitorStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestResultFullCheck.md b/docs/v1/SyntheticsAPITestResultFullCheck.md index d19154da18..0459d58d92 100644 --- a/docs/v1/SyntheticsAPITestResultFullCheck.md +++ b/docs/v1/SyntheticsAPITestResultFullCheck.md @@ -6,7 +6,8 @@ Object describing the API test configuration. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **config** | [**SyntheticsTestConfig**](SyntheticsTestConfig.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestResultShort.md b/docs/v1/SyntheticsAPITestResultShort.md index 8d7d5da005..fea8755259 100644 --- a/docs/v1/SyntheticsAPITestResultShort.md +++ b/docs/v1/SyntheticsAPITestResultShort.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **result** | [**SyntheticsAPITestResultShortResult**](SyntheticsAPITestResultShortResult.md) | | [optional] **result_id** | **str** | ID of the API test result. | [optional] **status** | [**SyntheticsTestMonitorStatus**](SyntheticsTestMonitorStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestResultShortResult.md b/docs/v1/SyntheticsAPITestResultShortResult.md index aef8fc7104..4bb7b03212 100644 --- a/docs/v1/SyntheticsAPITestResultShortResult.md +++ b/docs/v1/SyntheticsAPITestResultShortResult.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **passed** | **bool** | Describes if the test run has passed or failed. | [optional] **timings** | [**SyntheticsTiming**](SyntheticsTiming.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAPITestType.md b/docs/v1/SyntheticsAPITestType.md index 58afc87011..049ad41b78 100644 --- a/docs/v1/SyntheticsAPITestType.md +++ b/docs/v1/SyntheticsAPITestType.md @@ -6,7 +6,8 @@ Type of the Synthetic test, `api`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Synthetic test, `api`. | defaults to "api", must be one of ["api", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsApi.md b/docs/v1/SyntheticsApi.md index 2c8974869a..10d2167f0b 100644 --- a/docs/v1/SyntheticsApi.md +++ b/docs/v1/SyntheticsApi.md @@ -56,7 +56,6 @@ with ApiClient(configuration) as api_client: api_instance = synthetics_api.SyntheticsApi(api_client) body = SyntheticsGlobalVariable( description="Example description", - id="id_example", name="MY_VARIABLE", parse_test_options=SyntheticsGlobalVariableParseTestOptions( field="content-type", @@ -138,17 +137,7 @@ with ApiClient(configuration) as api_client: api_instance = synthetics_api.SyntheticsApi(api_client) body = SyntheticsPrivateLocation( description="Description of private location", - id="id_example", name="New private location", - secrets=SyntheticsPrivateLocationSecrets( - authentication=SyntheticsPrivateLocationSecretsAuthentication( - id="id_example", - key="key_example", - ), - config_decryption=SyntheticsPrivateLocationSecretsConfigDecryption( - key="key_example", - ), - ), tags=["team:front"], ) # SyntheticsPrivateLocation | Details of the private location to create. @@ -265,7 +254,9 @@ with ApiClient(configuration) as api_client: steps=[ SyntheticsAPIStep( allow_failure=True, - assertions=[], + assertions=[ + SyntheticsAssertion(), + ], extracted_values=[ SyntheticsParsingOptions( field="content-type", @@ -300,7 +291,9 @@ with ApiClient(configuration) as api_client: ), dns_server="dns_server_example", dns_server_port=1, - headers=SyntheticsTestHeaders(SyntheticsTestHeaders), + headers=SyntheticsTestHeaders( + key="key_example", + ), host="host_example", method=HTTPMethod("GET"), no_saving_response_body=True, @@ -319,7 +312,6 @@ with ApiClient(configuration) as api_client: "locations_example", ], message="message_example", - monitor_id=1, name="name_example", options=SyntheticsTestOptions( accept_self_signed=True, @@ -343,7 +335,6 @@ with ApiClient(configuration) as api_client: ), tick_every=30, ), - public_id="public_id_example", status=SyntheticsTestPauseStatus("live"), subtype=SyntheticsTestDetailsSubType("http"), tags=[ @@ -469,7 +460,6 @@ with ApiClient(configuration) as api_client: "locations_example", ], message="", - monitor_id=1, name="name_example", options=SyntheticsTestOptions( accept_self_signed=True, @@ -493,7 +483,6 @@ with ApiClient(configuration) as api_client: ), tick_every=30, ), - public_id="public_id_example", status=SyntheticsTestPauseStatus("live"), steps=[ SyntheticsStep( @@ -769,7 +758,6 @@ with ApiClient(configuration) as api_client: variable_id = "variable_id_example" # str | The ID of the global variable. body = SyntheticsGlobalVariable( description="Example description", - id="id_example", name="MY_VARIABLE", parse_test_options=SyntheticsGlobalVariableParseTestOptions( field="content-type", @@ -1800,7 +1788,9 @@ with ApiClient(configuration) as api_client: steps=[ SyntheticsAPIStep( allow_failure=True, - assertions=[], + assertions=[ + SyntheticsAssertion(), + ], extracted_values=[ SyntheticsParsingOptions( field="content-type", @@ -1835,7 +1825,9 @@ with ApiClient(configuration) as api_client: ), dns_server="dns_server_example", dns_server_port=1, - headers=SyntheticsTestHeaders(SyntheticsTestHeaders), + headers=SyntheticsTestHeaders( + key="key_example", + ), host="host_example", method=HTTPMethod("GET"), no_saving_response_body=True, @@ -1854,7 +1846,6 @@ with ApiClient(configuration) as api_client: "locations_example", ], message="message_example", - monitor_id=1, name="name_example", options=SyntheticsTestOptions( accept_self_signed=True, @@ -1878,7 +1869,6 @@ with ApiClient(configuration) as api_client: ), tick_every=30, ), - public_id="public_id_example", status=SyntheticsTestPauseStatus("live"), subtype=SyntheticsTestDetailsSubType("http"), tags=[ @@ -2006,7 +1996,6 @@ with ApiClient(configuration) as api_client: "locations_example", ], message="", - monitor_id=1, name="name_example", options=SyntheticsTestOptions( accept_self_signed=True, @@ -2030,7 +2019,6 @@ with ApiClient(configuration) as api_client: ), tick_every=30, ), - public_id="public_id_example", status=SyntheticsTestPauseStatus("live"), steps=[ SyntheticsStep( @@ -2114,17 +2102,7 @@ with ApiClient(configuration) as api_client: location_id = "location_id_example" # str | The ID of the private location. body = SyntheticsPrivateLocation( description="Description of private location", - id="id_example", name="New private location", - secrets=SyntheticsPrivateLocationSecrets( - authentication=SyntheticsPrivateLocationSecretsAuthentication( - id="id_example", - key="key_example", - ), - config_decryption=SyntheticsPrivateLocationSecretsConfigDecryption( - key="key_example", - ), - ), tags=["team:front"], ) # SyntheticsPrivateLocation | Details of the private location to be updated. diff --git a/docs/v1/SyntheticsAssertion.md b/docs/v1/SyntheticsAssertion.md index 6c5bc3712b..eb22e72f73 100644 --- a/docs/v1/SyntheticsAssertion.md +++ b/docs/v1/SyntheticsAssertion.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **SyntheticsAssertionJSONPathTarget** | [**SyntheticsAssertionJSONPathTarget**](SyntheticsAssertionJSONPathTarget.md) | Container class of the relevant properties. | **SyntheticsAssertionTarget** | [**SyntheticsAssertionTarget**](SyntheticsAssertionTarget.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAssertionJSONPathOperator.md b/docs/v1/SyntheticsAssertionJSONPathOperator.md index 12102d5159..736f214436 100644 --- a/docs/v1/SyntheticsAssertionJSONPathOperator.md +++ b/docs/v1/SyntheticsAssertionJSONPathOperator.md @@ -6,7 +6,8 @@ Assertion operator to apply. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Assertion operator to apply. | defaults to "validatesJSONPath", must be one of ["validatesJSONPath", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAssertionJSONPathTarget.md b/docs/v1/SyntheticsAssertionJSONPathTarget.md index bb0fc0472a..7a8b10fee7 100644 --- a/docs/v1/SyntheticsAssertionJSONPathTarget.md +++ b/docs/v1/SyntheticsAssertionJSONPathTarget.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**SyntheticsAssertionType**](SyntheticsAssertionType.md) | | **_property** | **str** | The associated assertion property. | [optional] **target** | [**SyntheticsAssertionJSONPathTargetTarget**](SyntheticsAssertionJSONPathTargetTarget.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAssertionJSONPathTargetTarget.md b/docs/v1/SyntheticsAssertionJSONPathTargetTarget.md index 1b27df709c..bc39a9bc22 100644 --- a/docs/v1/SyntheticsAssertionJSONPathTargetTarget.md +++ b/docs/v1/SyntheticsAssertionJSONPathTargetTarget.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **json_path** | **str** | The JSON path to assert. | [optional] **operator** | **str** | The specific operator to use on the path. | [optional] **target_value** | **bool, date, datetime, dict, float, int, list, str, none_type** | The path target value to compare to. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAssertionOperator.md b/docs/v1/SyntheticsAssertionOperator.md index 5ccc82e926..217d976c18 100644 --- a/docs/v1/SyntheticsAssertionOperator.md +++ b/docs/v1/SyntheticsAssertionOperator.md @@ -6,7 +6,8 @@ Assertion operator to apply. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Assertion operator to apply. | must be one of ["contains", "doesNotContain", "is", "isNot", "lessThan", "lessThanOrEqual", "moreThan", "moreThanOrEqual", "matches", "doesNotMatch", "validates", "isInMoreThan", "isInLessThan", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAssertionTarget.md b/docs/v1/SyntheticsAssertionTarget.md index cbe08b5c5b..1a47f6df2c 100644 --- a/docs/v1/SyntheticsAssertionTarget.md +++ b/docs/v1/SyntheticsAssertionTarget.md @@ -8,8 +8,9 @@ Name | Type | Description | Notes **operator** | [**SyntheticsAssertionOperator**](SyntheticsAssertionOperator.md) | | **type** | [**SyntheticsAssertionType**](SyntheticsAssertionType.md) | | **_property** | **str** | The associated assertion property. | [optional] -**target** | **bool, date, datetime, dict, float, int, list, str** | Value used by the operator. | [optional] +**target** | **bool, date, datetime, dict, float, int, list, str, none_type** | Value used by the operator. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsAssertionType.md b/docs/v1/SyntheticsAssertionType.md index b8384fbf28..07fdaac528 100644 --- a/docs/v1/SyntheticsAssertionType.md +++ b/docs/v1/SyntheticsAssertionType.md @@ -6,7 +6,8 @@ Type of the assertion. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the assertion. | must be one of ["body", "header", "statusCode", "certificate", "responseTime", "property", "recordEvery", "recordSome", "tlsVersion", "minTlsVersion", "latency", "packetLossPercentage", "packetsReceived", "networkHop", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBasicAuth.md b/docs/v1/SyntheticsBasicAuth.md index 222dd6b20d..e5d78ab750 100644 --- a/docs/v1/SyntheticsBasicAuth.md +++ b/docs/v1/SyntheticsBasicAuth.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **password** | **str** | Password to use for the basic authentication. | **username** | **str** | Username to use for the basic authentication. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserError.md b/docs/v1/SyntheticsBrowserError.md index 2443b4e188..e4f1535727 100644 --- a/docs/v1/SyntheticsBrowserError.md +++ b/docs/v1/SyntheticsBrowserError.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **name** | **str** | Name of the error. | **type** | [**SyntheticsBrowserErrorType**](SyntheticsBrowserErrorType.md) | | **status** | **int** | Status Code of the error. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserErrorType.md b/docs/v1/SyntheticsBrowserErrorType.md index 04a63e054e..8764b54b90 100644 --- a/docs/v1/SyntheticsBrowserErrorType.md +++ b/docs/v1/SyntheticsBrowserErrorType.md @@ -6,7 +6,8 @@ Error type returned by a browser test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Error type returned by a browser test. | must be one of ["network", "js", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTest.md b/docs/v1/SyntheticsBrowserTest.md index bd93bcad61..17e77eb3f7 100644 --- a/docs/v1/SyntheticsBrowserTest.md +++ b/docs/v1/SyntheticsBrowserTest.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **steps** | [**[SyntheticsStep]**](SyntheticsStep.md) | The steps of the test. | [optional] **tags** | **[str]** | Array of tags attached to the test. | [optional] **type** | [**SyntheticsBrowserTestType**](SyntheticsBrowserTestType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestConfig.md b/docs/v1/SyntheticsBrowserTestConfig.md index 4359fe6df7..c0f22d2211 100644 --- a/docs/v1/SyntheticsBrowserTestConfig.md +++ b/docs/v1/SyntheticsBrowserTestConfig.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **assertions** | [**[SyntheticsAssertion]**](SyntheticsAssertion.md) | Array of assertions used for the test. | defaults to [] **set_cookie** | **str** | Cookies to be used for the request, using the [Set-Cookie](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) syntax. | [optional] **variables** | [**[SyntheticsBrowserVariable]**](SyntheticsBrowserVariable.md) | Array of variables used for the test steps. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestResultData.md b/docs/v1/SyntheticsBrowserTestResultData.md index 62e57cc309..e0cef7e9ef 100644 --- a/docs/v1/SyntheticsBrowserTestResultData.md +++ b/docs/v1/SyntheticsBrowserTestResultData.md @@ -16,7 +16,8 @@ Name | Type | Description | Notes **step_details** | [**[SyntheticsStepDetail]**](SyntheticsStepDetail.md) | Array containing the different browser test steps. | [optional] **thumbnails_bucket_key** | **bool** | Whether or not a thumbnail is associated with the browser test. | [optional] **time_to_interactive** | **float** | Time in second to wait before the browser test starts after reaching the start URL. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestResultFull.md b/docs/v1/SyntheticsBrowserTestResultFull.md index 5b95596a64..9b069e1e8a 100644 --- a/docs/v1/SyntheticsBrowserTestResultFull.md +++ b/docs/v1/SyntheticsBrowserTestResultFull.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **result** | [**SyntheticsBrowserTestResultData**](SyntheticsBrowserTestResultData.md) | | [optional] **result_id** | **str** | ID of the browser test result. | [optional] **status** | [**SyntheticsTestMonitorStatus**](SyntheticsTestMonitorStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestResultFullCheck.md b/docs/v1/SyntheticsBrowserTestResultFullCheck.md index 6ad5cd1bc7..689a41e2f7 100644 --- a/docs/v1/SyntheticsBrowserTestResultFullCheck.md +++ b/docs/v1/SyntheticsBrowserTestResultFullCheck.md @@ -6,7 +6,8 @@ Object describing the browser test configuration. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **config** | [**SyntheticsTestConfig**](SyntheticsTestConfig.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestResultShort.md b/docs/v1/SyntheticsBrowserTestResultShort.md index 335a64e1c0..934b3ea49d 100644 --- a/docs/v1/SyntheticsBrowserTestResultShort.md +++ b/docs/v1/SyntheticsBrowserTestResultShort.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **result** | [**SyntheticsBrowserTestResultShortResult**](SyntheticsBrowserTestResultShortResult.md) | | [optional] **result_id** | **str** | ID of the browser test result. | [optional] **status** | [**SyntheticsTestMonitorStatus**](SyntheticsTestMonitorStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestResultShortResult.md b/docs/v1/SyntheticsBrowserTestResultShortResult.md index 0125d957e3..63aa0fc997 100644 --- a/docs/v1/SyntheticsBrowserTestResultShortResult.md +++ b/docs/v1/SyntheticsBrowserTestResultShortResult.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **error_count** | **int** | Amount of errors collected for a single browser test run. | [optional] **step_count_completed** | **int** | Amount of browser test steps completed before failing. | [optional] **step_count_total** | **int** | Total amount of browser test steps. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserTestType.md b/docs/v1/SyntheticsBrowserTestType.md index cea3a5c92b..b7bcecae9b 100644 --- a/docs/v1/SyntheticsBrowserTestType.md +++ b/docs/v1/SyntheticsBrowserTestType.md @@ -6,7 +6,8 @@ Type of the Synthetic test, `browser`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Synthetic test, `browser`. | defaults to "browser", must be one of ["browser", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserVariable.md b/docs/v1/SyntheticsBrowserVariable.md index 627204b7a0..2cb36fda43 100644 --- a/docs/v1/SyntheticsBrowserVariable.md +++ b/docs/v1/SyntheticsBrowserVariable.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **example** | **str** | Example for the variable. | [optional] **id** | **str** | ID for the variable. | [optional] **pattern** | **str** | Pattern of the variable. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsBrowserVariableType.md b/docs/v1/SyntheticsBrowserVariableType.md index d5bc54dc0c..a6bfd0ab50 100644 --- a/docs/v1/SyntheticsBrowserVariableType.md +++ b/docs/v1/SyntheticsBrowserVariableType.md @@ -6,7 +6,8 @@ Type of browser test variable. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of browser test variable. | must be one of ["element", "email", "global", "javascript", "text", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCITest.md b/docs/v1/SyntheticsCITest.md index d02c15f970..54810d3842 100644 --- a/docs/v1/SyntheticsCITest.md +++ b/docs/v1/SyntheticsCITest.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **retry** | [**SyntheticsTestOptionsRetry**](SyntheticsTestOptionsRetry.md) | | [optional] **start_url** | **str** | Starting URL for the browser test. | [optional] **variables** | **{str: (str,)}** | Variables to replace in the test. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCITestBody.md b/docs/v1/SyntheticsCITestBody.md index 89909331e4..6f6b2ae0cc 100644 --- a/docs/v1/SyntheticsCITestBody.md +++ b/docs/v1/SyntheticsCITestBody.md @@ -6,7 +6,8 @@ Object describing the synthetics tests to trigger. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tests** | [**[SyntheticsCITest]**](SyntheticsCITest.md) | Individual synthetics test. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCITestMetadata.md b/docs/v1/SyntheticsCITestMetadata.md index 9c1571b309..785b5b7548 100644 --- a/docs/v1/SyntheticsCITestMetadata.md +++ b/docs/v1/SyntheticsCITestMetadata.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ci** | [**SyntheticsCITestMetadataCi**](SyntheticsCITestMetadataCi.md) | | [optional] **git** | [**SyntheticsCITestMetadataGit**](SyntheticsCITestMetadataGit.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCITestMetadataCi.md b/docs/v1/SyntheticsCITestMetadataCi.md index 1e96bec7f0..8cd76940ba 100644 --- a/docs/v1/SyntheticsCITestMetadataCi.md +++ b/docs/v1/SyntheticsCITestMetadataCi.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pipeline** | **str** | Name of the pipeline. | [optional] **provider** | **str** | Name of the CI provider. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCITestMetadataGit.md b/docs/v1/SyntheticsCITestMetadataGit.md index 590d4181de..5d100c94ca 100644 --- a/docs/v1/SyntheticsCITestMetadataGit.md +++ b/docs/v1/SyntheticsCITestMetadataGit.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **branch** | **str** | Branch name. | [optional] **commit_sha** | **str** | Commit SHA. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCheckType.md b/docs/v1/SyntheticsCheckType.md index 74a482aced..3b3a082538 100644 --- a/docs/v1/SyntheticsCheckType.md +++ b/docs/v1/SyntheticsCheckType.md @@ -6,7 +6,8 @@ Type of assertion to apply in an API test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of assertion to apply in an API test. | must be one of ["equals", "notEquals", "contains", "notContains", "startsWith", "notStartsWith", "greater", "lower", "greaterEquals", "lowerEquals", "matchRegex", "between", "isEmpty", "notIsEmpty", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsConfigVariable.md b/docs/v1/SyntheticsConfigVariable.md index e2a87f0022..79c9a6566d 100644 --- a/docs/v1/SyntheticsConfigVariable.md +++ b/docs/v1/SyntheticsConfigVariable.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **example** | **str** | Example for the variable. | [optional] **id** | **str** | ID of the variable for global variables. | [optional] **pattern** | **str** | Pattern of the variable. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsConfigVariableType.md b/docs/v1/SyntheticsConfigVariableType.md index 49f3475742..96284fa668 100644 --- a/docs/v1/SyntheticsConfigVariableType.md +++ b/docs/v1/SyntheticsConfigVariableType.md @@ -6,7 +6,8 @@ Type of the configuration variable. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the configuration variable. | must be one of ["global", "text", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsCoreWebVitals.md b/docs/v1/SyntheticsCoreWebVitals.md index 14cf24e63f..191c562aa9 100644 --- a/docs/v1/SyntheticsCoreWebVitals.md +++ b/docs/v1/SyntheticsCoreWebVitals.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **cls** | **int** | Cumulative Layout Shift. | [optional] **lcp** | **int** | Largest Contentful Paint in milliseconds. | [optional] **url** | **str** | URL attached to the metrics. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsDeleteTestsPayload.md b/docs/v1/SyntheticsDeleteTestsPayload.md index fab53f28b7..1450521714 100644 --- a/docs/v1/SyntheticsDeleteTestsPayload.md +++ b/docs/v1/SyntheticsDeleteTestsPayload.md @@ -6,7 +6,8 @@ A JSON list of the ID or IDs of the Synthetic tests that you want to delete. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **public_ids** | **[str]** | An array of Synthetic test IDs you want to delete. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsDeleteTestsResponse.md b/docs/v1/SyntheticsDeleteTestsResponse.md index b1131d567a..072f9886b4 100644 --- a/docs/v1/SyntheticsDeleteTestsResponse.md +++ b/docs/v1/SyntheticsDeleteTestsResponse.md @@ -6,7 +6,8 @@ Response object for deleting Synthetic tests. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted_tests** | [**[SyntheticsDeletedTest]**](SyntheticsDeletedTest.md) | Array of objects containing a deleted Synthetic test ID with the associated deletion timestamp. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsDeletedTest.md b/docs/v1/SyntheticsDeletedTest.md index 8b6aec3def..2c746e5317 100644 --- a/docs/v1/SyntheticsDeletedTest.md +++ b/docs/v1/SyntheticsDeletedTest.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted_at** | **datetime** | Deletion timestamp of the Synthetic test ID. | [optional] **public_id** | **str** | The Synthetic test ID deleted. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsDevice.md b/docs/v1/SyntheticsDevice.md index cc0790376f..470b15cd77 100644 --- a/docs/v1/SyntheticsDevice.md +++ b/docs/v1/SyntheticsDevice.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **name** | **str** | The device name. | **width** | **int** | Screen width of the device. | **is_mobile** | **bool** | Whether or not the device is a mobile. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsDeviceID.md b/docs/v1/SyntheticsDeviceID.md index 601fae53fd..3573369d34 100644 --- a/docs/v1/SyntheticsDeviceID.md +++ b/docs/v1/SyntheticsDeviceID.md @@ -6,7 +6,8 @@ The device ID. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The device ID. | must be one of ["laptop_large", "tablet", "mobile_small", "chrome.laptop_large", "chrome.tablet", "chrome.mobile_small", "firefox.laptop_large", "firefox.tablet", "firefox.mobile_small", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsErrorCode.md b/docs/v1/SyntheticsErrorCode.md index a302eef0d1..6e59ac85b5 100644 --- a/docs/v1/SyntheticsErrorCode.md +++ b/docs/v1/SyntheticsErrorCode.md @@ -6,7 +6,8 @@ Error code that can be returned by a Synthetic test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Error code that can be returned by a Synthetic test. | must be one of ["NO_ERROR", "UNKNOWN", "DNS", "SSL", "TIMEOUT", "DENIED", "INCORRECT_ASSERTION", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGetAPITestLatestResultsResponse.md b/docs/v1/SyntheticsGetAPITestLatestResultsResponse.md index 7a59f15ace..acb367277d 100644 --- a/docs/v1/SyntheticsGetAPITestLatestResultsResponse.md +++ b/docs/v1/SyntheticsGetAPITestLatestResultsResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **last_timestamp_fetched** | **int** | Timestamp of the latest API test run. | [optional] **results** | [**[SyntheticsAPITestResultShort]**](SyntheticsAPITestResultShort.md) | Result of the latest API test run. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGetBrowserTestLatestResultsResponse.md b/docs/v1/SyntheticsGetBrowserTestLatestResultsResponse.md index b4807f2571..98f27fe807 100644 --- a/docs/v1/SyntheticsGetBrowserTestLatestResultsResponse.md +++ b/docs/v1/SyntheticsGetBrowserTestLatestResultsResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **last_timestamp_fetched** | **int** | Timestamp of the latest browser test run. | [optional] **results** | [**[SyntheticsBrowserTestResultShort]**](SyntheticsBrowserTestResultShort.md) | Result of the latest browser test run. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGlobalVariable.md b/docs/v1/SyntheticsGlobalVariable.md index b611cb75f7..7433229f01 100644 --- a/docs/v1/SyntheticsGlobalVariable.md +++ b/docs/v1/SyntheticsGlobalVariable.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **id** | **str** | Unique identifier of the global variable. | [optional] [readonly] **parse_test_options** | [**SyntheticsGlobalVariableParseTestOptions**](SyntheticsGlobalVariableParseTestOptions.md) | | [optional] **parse_test_public_id** | **str** | A Synthetic test ID to use as a test to generate the variable value. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGlobalVariableParseTestOptions.md b/docs/v1/SyntheticsGlobalVariableParseTestOptions.md index e59e337b9b..c091b54ee6 100644 --- a/docs/v1/SyntheticsGlobalVariableParseTestOptions.md +++ b/docs/v1/SyntheticsGlobalVariableParseTestOptions.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **parser** | [**SyntheticsVariableParser**](SyntheticsVariableParser.md) | | **type** | [**SyntheticsGlobalVariableParseTestOptionsType**](SyntheticsGlobalVariableParseTestOptionsType.md) | | **field** | **str** | When type is `http_header`, name of the header to use to extract the value. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGlobalVariableParseTestOptionsType.md b/docs/v1/SyntheticsGlobalVariableParseTestOptionsType.md index 4f3684ec2e..4abda3649e 100644 --- a/docs/v1/SyntheticsGlobalVariableParseTestOptionsType.md +++ b/docs/v1/SyntheticsGlobalVariableParseTestOptionsType.md @@ -6,7 +6,8 @@ Property of the Synthetics Test Response to use for a Synthetics global variable Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Property of the Synthetics Test Response to use for a Synthetics global variable. | must be one of ["http_body", "http_header", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGlobalVariableParserType.md b/docs/v1/SyntheticsGlobalVariableParserType.md index 2386fd81f0..43aa86f9d4 100644 --- a/docs/v1/SyntheticsGlobalVariableParserType.md +++ b/docs/v1/SyntheticsGlobalVariableParserType.md @@ -6,7 +6,8 @@ Type of parser for a Synthetics global variable from a synthetics test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of parser for a Synthetics global variable from a synthetics test. | must be one of ["raw", "json_path", "regex", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsGlobalVariableValue.md b/docs/v1/SyntheticsGlobalVariableValue.md index 2bfa75a584..be99043005 100644 --- a/docs/v1/SyntheticsGlobalVariableValue.md +++ b/docs/v1/SyntheticsGlobalVariableValue.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **secure** | **bool** | Determines if the variable is secure. | [optional] **value** | **str** | Value of the global variable. When reading a global variable, the value will not be present if the variable is secure. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsListGlobalVariablesResponse.md b/docs/v1/SyntheticsListGlobalVariablesResponse.md index 6272a1ef92..8fcfa1d5fb 100644 --- a/docs/v1/SyntheticsListGlobalVariablesResponse.md +++ b/docs/v1/SyntheticsListGlobalVariablesResponse.md @@ -6,7 +6,8 @@ Object containing an array of Synthetic global variables. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **variables** | [**[SyntheticsGlobalVariable]**](SyntheticsGlobalVariable.md) | Array of Synthetic global variables. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsListTestsResponse.md b/docs/v1/SyntheticsListTestsResponse.md index e2a4125457..a662dcdaf7 100644 --- a/docs/v1/SyntheticsListTestsResponse.md +++ b/docs/v1/SyntheticsListTestsResponse.md @@ -6,7 +6,8 @@ Object containing an array of Synthetic tests configuration. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tests** | [**[SyntheticsTestDetails]**](SyntheticsTestDetails.md) | Array of Synthetic tests configuration. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsLocation.md b/docs/v1/SyntheticsLocation.md index 451d299301..9080f0129e 100644 --- a/docs/v1/SyntheticsLocation.md +++ b/docs/v1/SyntheticsLocation.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique identifier of the location. | [optional] **name** | **str** | Name of the location. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsLocations.md b/docs/v1/SyntheticsLocations.md index 14b498a89a..9a682ce6f9 100644 --- a/docs/v1/SyntheticsLocations.md +++ b/docs/v1/SyntheticsLocations.md @@ -6,7 +6,8 @@ List of Synthetics locations. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **locations** | [**[SyntheticsLocation]**](SyntheticsLocation.md) | List of Synthetics locations. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsParsingOptions.md b/docs/v1/SyntheticsParsingOptions.md index 5151528301..e9e3a1609b 100644 --- a/docs/v1/SyntheticsParsingOptions.md +++ b/docs/v1/SyntheticsParsingOptions.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **name** | **str** | Name of the variable to extract. | [optional] **parser** | [**SyntheticsVariableParser**](SyntheticsVariableParser.md) | | [optional] **type** | [**SyntheticsGlobalVariableParseTestOptionsType**](SyntheticsGlobalVariableParseTestOptionsType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPlayingTab.md b/docs/v1/SyntheticsPlayingTab.md index 1fdd5b2b65..81f908bd9c 100644 --- a/docs/v1/SyntheticsPlayingTab.md +++ b/docs/v1/SyntheticsPlayingTab.md @@ -6,7 +6,8 @@ Navigate between different tabs for your browser test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | Navigate between different tabs for your browser test. | must be one of [-1, 0, 1, 2, 3, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPrivateLocation.md b/docs/v1/SyntheticsPrivateLocation.md index 2bddb04a91..6e1af69886 100644 --- a/docs/v1/SyntheticsPrivateLocation.md +++ b/docs/v1/SyntheticsPrivateLocation.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **tags** | **[str]** | Array of tags attached to the private location. | **id** | **str** | Unique identifier of the private location. | [optional] [readonly] **secrets** | [**SyntheticsPrivateLocationSecrets**](SyntheticsPrivateLocationSecrets.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPrivateLocationCreationResponse.md b/docs/v1/SyntheticsPrivateLocationCreationResponse.md index bdae0b575a..6c2218037f 100644 --- a/docs/v1/SyntheticsPrivateLocationCreationResponse.md +++ b/docs/v1/SyntheticsPrivateLocationCreationResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **config** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Configuration skeleton for the private location. See installation instructions of the private location on how to use this configuration. | [optional] **private_location** | [**SyntheticsPrivateLocation**](SyntheticsPrivateLocation.md) | | [optional] **result_encryption** | [**SyntheticsPrivateLocationCreationResponseResultEncryption**](SyntheticsPrivateLocationCreationResponseResultEncryption.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPrivateLocationCreationResponseResultEncryption.md b/docs/v1/SyntheticsPrivateLocationCreationResponseResultEncryption.md index ecb1f993b7..36fa5533ec 100644 --- a/docs/v1/SyntheticsPrivateLocationCreationResponseResultEncryption.md +++ b/docs/v1/SyntheticsPrivateLocationCreationResponseResultEncryption.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Fingerprint for the encryption key. | [optional] **key** | **str** | Public key for result encryption. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPrivateLocationSecrets.md b/docs/v1/SyntheticsPrivateLocationSecrets.md index 66a63079f5..bcdbaebd70 100644 --- a/docs/v1/SyntheticsPrivateLocationSecrets.md +++ b/docs/v1/SyntheticsPrivateLocationSecrets.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **authentication** | [**SyntheticsPrivateLocationSecretsAuthentication**](SyntheticsPrivateLocationSecretsAuthentication.md) | | [optional] **config_decryption** | [**SyntheticsPrivateLocationSecretsConfigDecryption**](SyntheticsPrivateLocationSecretsConfigDecryption.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPrivateLocationSecretsAuthentication.md b/docs/v1/SyntheticsPrivateLocationSecretsAuthentication.md index 3b7e07f1c8..759763fac5 100644 --- a/docs/v1/SyntheticsPrivateLocationSecretsAuthentication.md +++ b/docs/v1/SyntheticsPrivateLocationSecretsAuthentication.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Access key for the private location. | [optional] [readonly] **key** | **str** | Secret access key for the private location. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsPrivateLocationSecretsConfigDecryption.md b/docs/v1/SyntheticsPrivateLocationSecretsConfigDecryption.md index ba352668a2..083a5aafc1 100644 --- a/docs/v1/SyntheticsPrivateLocationSecretsConfigDecryption.md +++ b/docs/v1/SyntheticsPrivateLocationSecretsConfigDecryption.md @@ -6,7 +6,8 @@ Private key for the private location. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **key** | **str** | Private key for the private location. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsSSLCertificate.md b/docs/v1/SyntheticsSSLCertificate.md index 38d07f3219..abe2924cfe 100644 --- a/docs/v1/SyntheticsSSLCertificate.md +++ b/docs/v1/SyntheticsSSLCertificate.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **subject** | [**SyntheticsSSLCertificateSubject**](SyntheticsSSLCertificateSubject.md) | | [optional] **valid_from** | **datetime** | Date from which the SSL certificate is valid. | [optional] **valid_to** | **datetime** | Date until which the SSL certificate is valid. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsSSLCertificateIssuer.md b/docs/v1/SyntheticsSSLCertificateIssuer.md index 141ce83fc0..4ac04660d5 100644 --- a/docs/v1/SyntheticsSSLCertificateIssuer.md +++ b/docs/v1/SyntheticsSSLCertificateIssuer.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **o** | **str** | Organization that issued the certificate. | [optional] **ou** | **str** | Organizational Unit that issued the certificate. | [optional] **st** | **str** | State Or Province Name that issued the certificate. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsSSLCertificateSubject.md b/docs/v1/SyntheticsSSLCertificateSubject.md index 5fbbed88bf..2928edbde6 100644 --- a/docs/v1/SyntheticsSSLCertificateSubject.md +++ b/docs/v1/SyntheticsSSLCertificateSubject.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **ou** | **str** | Organizational Unit associated with the certificate. | [optional] **st** | **str** | State Or Province Name associated with the certificate. | [optional] **alt_name** | **str** | Subject Alternative Name associated with the certificate. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsStep.md b/docs/v1/SyntheticsStep.md index dcfb8740db..5c32e4343a 100644 --- a/docs/v1/SyntheticsStep.md +++ b/docs/v1/SyntheticsStep.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **params** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | The parameters of the step. | [optional] **timeout** | **int** | The time before declaring a step failed. | [optional] **type** | [**SyntheticsStepType**](SyntheticsStepType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsStepDetail.md b/docs/v1/SyntheticsStepDetail.md index 72f5f52441..429b674abd 100644 --- a/docs/v1/SyntheticsStepDetail.md +++ b/docs/v1/SyntheticsStepDetail.md @@ -22,7 +22,8 @@ Name | Type | Description | Notes **value** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | Value for the step. | [optional] **vitals_metrics** | [**[SyntheticsCoreWebVitals]**](SyntheticsCoreWebVitals.md) | Array of Core Web Vitals metrics for the step. | [optional] **warnings** | [**[SyntheticsStepDetailWarning]**](SyntheticsStepDetailWarning.md) | Warning collected that didn't failed the step. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsStepDetailWarning.md b/docs/v1/SyntheticsStepDetailWarning.md index 0f5534624d..bf661672a0 100644 --- a/docs/v1/SyntheticsStepDetailWarning.md +++ b/docs/v1/SyntheticsStepDetailWarning.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Message for the warning. | **type** | [**SyntheticsWarningType**](SyntheticsWarningType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsStepType.md b/docs/v1/SyntheticsStepType.md index 83feae5a6e..2ff6f7187e 100644 --- a/docs/v1/SyntheticsStepType.md +++ b/docs/v1/SyntheticsStepType.md @@ -6,7 +6,8 @@ Step type used in your Synthetic test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Step type used in your Synthetic test. | must be one of ["assertCurrentUrl", "assertElementAttribute", "assertElementContent", "assertElementPresent", "assertEmail", "assertFileDownload", "assertFromJavascript", "assertPageContains", "assertPageLacks", "click", "extractFromJavascript", "extractVariable", "goToEmailLink", "goToUrl", "goToUrlAndMeasureTti", "hover", "playSubTest", "pressKey", "refresh", "runApiTest", "scroll", "selectOption", "typeText", "uploadFiles", "wait", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestConfig.md b/docs/v1/SyntheticsTestConfig.md index 1893bb5be8..9f04b4cb6e 100644 --- a/docs/v1/SyntheticsTestConfig.md +++ b/docs/v1/SyntheticsTestConfig.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **config_variables** | [**[SyntheticsConfigVariable]**](SyntheticsConfigVariable.md) | API tests only - array of variables used for the test. | [optional] **request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | [optional] **variables** | [**[SyntheticsBrowserVariable]**](SyntheticsBrowserVariable.md) | Browser tests only - array of variables used for the test steps. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestDetails.md b/docs/v1/SyntheticsTestDetails.md index 68bb9a1bca..14d4a302f6 100644 --- a/docs/v1/SyntheticsTestDetails.md +++ b/docs/v1/SyntheticsTestDetails.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **subtype** | [**SyntheticsTestDetailsSubType**](SyntheticsTestDetailsSubType.md) | | [optional] **tags** | **[str]** | Array of tags attached to the test. | [optional] **type** | [**SyntheticsTestDetailsType**](SyntheticsTestDetailsType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestDetailsSubType.md b/docs/v1/SyntheticsTestDetailsSubType.md index a4c93ae982..98654d4cbe 100644 --- a/docs/v1/SyntheticsTestDetailsSubType.md +++ b/docs/v1/SyntheticsTestDetailsSubType.md @@ -6,7 +6,8 @@ The subtype of the Synthetic API test, `http`, `ssl`, `tcp`, `dns`, `icmp` or `m Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The subtype of the Synthetic API test, `http`, `ssl`, `tcp`, `dns`, `icmp` or `multi`. | must be one of ["http", "ssl", "tcp", "dns", "multi", "icmp", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestDetailsType.md b/docs/v1/SyntheticsTestDetailsType.md index 051b6f9be4..f54e69f5fd 100644 --- a/docs/v1/SyntheticsTestDetailsType.md +++ b/docs/v1/SyntheticsTestDetailsType.md @@ -6,7 +6,8 @@ Type of the Synthetic test, either `api` or `browser`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Synthetic test, either `api` or `browser`. | must be one of ["api", "browser", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestHeaders.md b/docs/v1/SyntheticsTestHeaders.md index 093e51f3ed..6c843b842d 100644 --- a/docs/v1/SyntheticsTestHeaders.md +++ b/docs/v1/SyntheticsTestHeaders.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **any string name** | **str** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestMonitorStatus.md b/docs/v1/SyntheticsTestMonitorStatus.md index 1de96cdbe8..5252e8c1dc 100644 --- a/docs/v1/SyntheticsTestMonitorStatus.md +++ b/docs/v1/SyntheticsTestMonitorStatus.md @@ -6,7 +6,8 @@ The status of your Synthetic monitor. * `O` for not triggered * `1` for triggere Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | The status of your Synthetic monitor. * `O` for not triggered * `1` for triggered * `2` for no data | must be one of [0, 1, 2, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestOptions.md b/docs/v1/SyntheticsTestOptions.md index 51611bf850..b6028ffa25 100644 --- a/docs/v1/SyntheticsTestOptions.md +++ b/docs/v1/SyntheticsTestOptions.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **no_screenshot** | **bool** | Prevents saving screenshots of the steps. | [optional] **retry** | [**SyntheticsTestOptionsRetry**](SyntheticsTestOptionsRetry.md) | | [optional] **tick_every** | **int** | The frequency at which to run the Synthetic test (in seconds). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestOptionsMonitorOptions.md b/docs/v1/SyntheticsTestOptionsMonitorOptions.md index c5a9792588..48ae74c9be 100644 --- a/docs/v1/SyntheticsTestOptionsMonitorOptions.md +++ b/docs/v1/SyntheticsTestOptionsMonitorOptions.md @@ -6,7 +6,8 @@ Object containing the options for a Synthetic test as a monitor (for example, re Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **renotify_interval** | **int** | Time interval before renotifying if the test is still failing (in minutes). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestOptionsRetry.md b/docs/v1/SyntheticsTestOptionsRetry.md index 33d0dd4165..e4b6c2eaf2 100644 --- a/docs/v1/SyntheticsTestOptionsRetry.md +++ b/docs/v1/SyntheticsTestOptionsRetry.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **count** | **int** | Number of times a test needs to be retried before marking a location as failed. Defaults to 0. | [optional] **interval** | **float** | Time interval between retries (in milliseconds). Defaults to 300ms. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestPauseStatus.md b/docs/v1/SyntheticsTestPauseStatus.md index 74df3ac4ad..6a029042fd 100644 --- a/docs/v1/SyntheticsTestPauseStatus.md +++ b/docs/v1/SyntheticsTestPauseStatus.md @@ -6,7 +6,8 @@ Define whether you want to start (`live`) or pause (`paused`) a Synthetic test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Define whether you want to start (`live`) or pause (`paused`) a Synthetic test. | must be one of ["live", "paused", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestProcessStatus.md b/docs/v1/SyntheticsTestProcessStatus.md index 047e4ec8ae..d81b878e6c 100644 --- a/docs/v1/SyntheticsTestProcessStatus.md +++ b/docs/v1/SyntheticsTestProcessStatus.md @@ -6,7 +6,8 @@ Status of a Synthetic test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Status of a Synthetic test. | must be one of ["not_scheduled", "scheduled", "started", "finished", "finished_with_error", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestRequest.md b/docs/v1/SyntheticsTestRequest.md index 9bba1e132d..6c41ed03ba 100644 --- a/docs/v1/SyntheticsTestRequest.md +++ b/docs/v1/SyntheticsTestRequest.md @@ -21,7 +21,8 @@ Name | Type | Description | Notes **should_track_hops** | **bool** | Turns on a traceroute probe to discover all gateways along the path to the host destination. | [optional] **timeout** | **float** | Timeout in seconds for the test. | [optional] **url** | **str** | URL to perform the test with. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestRequestCertificate.md b/docs/v1/SyntheticsTestRequestCertificate.md index 85b11ccca7..cfc45fcb3d 100644 --- a/docs/v1/SyntheticsTestRequestCertificate.md +++ b/docs/v1/SyntheticsTestRequestCertificate.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cert** | [**SyntheticsTestRequestCertificateItem**](SyntheticsTestRequestCertificateItem.md) | | [optional] **key** | [**SyntheticsTestRequestCertificateItem**](SyntheticsTestRequestCertificateItem.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTestRequestCertificateItem.md b/docs/v1/SyntheticsTestRequestCertificateItem.md index 6f32248bbf..d63addda5d 100644 --- a/docs/v1/SyntheticsTestRequestCertificateItem.md +++ b/docs/v1/SyntheticsTestRequestCertificateItem.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **content** | **str** | Content of the certificate or key. | [optional] **filename** | **str** | File name for the certificate or key. | [optional] **updated_at** | **str** | Date of update of the certificate or key, ISO format. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTiming.md b/docs/v1/SyntheticsTiming.md index 6b1bcce92f..b18d2ba39e 100644 --- a/docs/v1/SyntheticsTiming.md +++ b/docs/v1/SyntheticsTiming.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **tcp** | **float** | Time in millisecond to establish the TCP connection. | [optional] **total** | **float** | The overall time in millisecond the request took to be processed. | [optional] **wait** | **float** | Time spent in millisecond waiting for a response. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTriggerCITestLocation.md b/docs/v1/SyntheticsTriggerCITestLocation.md index 653a5f6470..565bc1bed1 100644 --- a/docs/v1/SyntheticsTriggerCITestLocation.md +++ b/docs/v1/SyntheticsTriggerCITestLocation.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | Unique identifier of the location. | [optional] **name** | **str** | Name of the location. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTriggerCITestRunResult.md b/docs/v1/SyntheticsTriggerCITestRunResult.md index 2231af64ec..6584d999ed 100644 --- a/docs/v1/SyntheticsTriggerCITestRunResult.md +++ b/docs/v1/SyntheticsTriggerCITestRunResult.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **location** | **int** | The location ID of the test run. | [optional] **public_id** | **str** | The public ID of the Synthetics test. | [optional] **result_id** | **str** | ID of the result. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsTriggerCITestsResponse.md b/docs/v1/SyntheticsTriggerCITestsResponse.md index 7037240ede..805f56083e 100644 --- a/docs/v1/SyntheticsTriggerCITestsResponse.md +++ b/docs/v1/SyntheticsTriggerCITestsResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **locations** | [**[SyntheticsTriggerCITestLocation]**](SyntheticsTriggerCITestLocation.md) | List of Synthetics locations. | [optional] **results** | [**[SyntheticsTriggerCITestRunResult]**](SyntheticsTriggerCITestRunResult.md) | Information about the tests runs. | [optional] **triggered_check_ids** | **[str]** | The public IDs of the Synthetics test triggered. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsUpdateTestPauseStatusPayload.md b/docs/v1/SyntheticsUpdateTestPauseStatusPayload.md index bc8bb4632a..4a9f101bde 100644 --- a/docs/v1/SyntheticsUpdateTestPauseStatusPayload.md +++ b/docs/v1/SyntheticsUpdateTestPauseStatusPayload.md @@ -6,7 +6,8 @@ Object to start or pause an existing Synthetic test. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **new_status** | [**SyntheticsTestPauseStatus**](SyntheticsTestPauseStatus.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsVariableParser.md b/docs/v1/SyntheticsVariableParser.md index 564ecc21ee..8623e00028 100644 --- a/docs/v1/SyntheticsVariableParser.md +++ b/docs/v1/SyntheticsVariableParser.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**SyntheticsGlobalVariableParserType**](SyntheticsGlobalVariableParserType.md) | | **value** | **str** | Regex or JSON path used for the parser. Not used with type `raw`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/SyntheticsWarningType.md b/docs/v1/SyntheticsWarningType.md index 2055a69fca..eed2a01b22 100644 --- a/docs/v1/SyntheticsWarningType.md +++ b/docs/v1/SyntheticsWarningType.md @@ -6,7 +6,8 @@ User locator used. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | User locator used. | defaults to "user_locator", must be one of ["user_locator", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TableWidgetCellDisplayMode.md b/docs/v1/TableWidgetCellDisplayMode.md index 580632366f..3a473d5520 100644 --- a/docs/v1/TableWidgetCellDisplayMode.md +++ b/docs/v1/TableWidgetCellDisplayMode.md @@ -6,7 +6,8 @@ Define a display mode for the table cell. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Define a display mode for the table cell. | must be one of ["number", "bar", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TableWidgetDefinition.md b/docs/v1/TableWidgetDefinition.md index 377568a134..f8a12a39ea 100644 --- a/docs/v1/TableWidgetDefinition.md +++ b/docs/v1/TableWidgetDefinition.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **title** | **str** | Title of your widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TableWidgetDefinitionType.md b/docs/v1/TableWidgetDefinitionType.md index ff7593a212..86cd18e3d7 100644 --- a/docs/v1/TableWidgetDefinitionType.md +++ b/docs/v1/TableWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the table widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the table widget. | defaults to "query_table", must be one of ["query_table", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TableWidgetHasSearchBar.md b/docs/v1/TableWidgetHasSearchBar.md index 0105ec0c05..54766b29a7 100644 --- a/docs/v1/TableWidgetHasSearchBar.md +++ b/docs/v1/TableWidgetHasSearchBar.md @@ -6,7 +6,8 @@ Controls the display of the search bar. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Controls the display of the search bar. | must be one of ["always", "never", "auto", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TableWidgetRequest.md b/docs/v1/TableWidgetRequest.md index add94211c7..ab8c6f681d 100644 --- a/docs/v1/TableWidgetRequest.md +++ b/docs/v1/TableWidgetRequest.md @@ -24,7 +24,8 @@ Name | Type | Description | Notes **response_format** | [**FormulaAndFunctionResponseFormat**](FormulaAndFunctionResponseFormat.md) | | [optional] **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TagToHosts.md b/docs/v1/TagToHosts.md index 43a8a19f86..5609b3d717 100644 --- a/docs/v1/TagToHosts.md +++ b/docs/v1/TagToHosts.md @@ -6,7 +6,8 @@ In this object, the key is the tag, the value is a list of host names that are r Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tags** | **{str: ([str],)}** | A list of tags to apply to the host. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TargetFormatType.md b/docs/v1/TargetFormatType.md index 66940d9fda..5744443540 100644 --- a/docs/v1/TargetFormatType.md +++ b/docs/v1/TargetFormatType.md @@ -6,7 +6,8 @@ If the `target_type` of the remapper is `attribute`, try to cast the value to a Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | If the `target_type` of the remapper is `attribute`, try to cast the value to a new specific type. If the cast is not possible, the original type is kept. `string`, `integer`, or `double` are the possible types. If the `target_type` is `tag`, this parameter may not be specified. | must be one of ["auto", "string", "integer", "double", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TimeseriesWidgetDefinition.md b/docs/v1/TimeseriesWidgetDefinition.md index f87927a894..ddd0491e41 100644 --- a/docs/v1/TimeseriesWidgetDefinition.md +++ b/docs/v1/TimeseriesWidgetDefinition.md @@ -20,7 +20,8 @@ Name | Type | Description | Notes **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] **yaxis** | [**WidgetAxis**](WidgetAxis.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TimeseriesWidgetDefinitionType.md b/docs/v1/TimeseriesWidgetDefinitionType.md index 59e424dd3b..91f24ceb4d 100644 --- a/docs/v1/TimeseriesWidgetDefinitionType.md +++ b/docs/v1/TimeseriesWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the timeseries widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the timeseries widget. | defaults to "timeseries", must be one of ["timeseries", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TimeseriesWidgetExpressionAlias.md b/docs/v1/TimeseriesWidgetExpressionAlias.md index 3280570c51..546a05f300 100644 --- a/docs/v1/TimeseriesWidgetExpressionAlias.md +++ b/docs/v1/TimeseriesWidgetExpressionAlias.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **expression** | **str** | Expression name. | **alias_name** | **str** | Expression alias. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TimeseriesWidgetLegendColumn.md b/docs/v1/TimeseriesWidgetLegendColumn.md index 2877dde1cb..4683b0a161 100644 --- a/docs/v1/TimeseriesWidgetLegendColumn.md +++ b/docs/v1/TimeseriesWidgetLegendColumn.md @@ -6,7 +6,8 @@ Legend column. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Legend column. | must be one of ["value", "avg", "sum", "min", "max", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TimeseriesWidgetLegendLayout.md b/docs/v1/TimeseriesWidgetLegendLayout.md index 955494a709..01be545cde 100644 --- a/docs/v1/TimeseriesWidgetLegendLayout.md +++ b/docs/v1/TimeseriesWidgetLegendLayout.md @@ -6,7 +6,8 @@ Layout of the legend. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Layout of the legend. | must be one of ["auto", "horizontal", "vertical", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TimeseriesWidgetRequest.md b/docs/v1/TimeseriesWidgetRequest.md index 2fe2004973..4977e571d2 100644 --- a/docs/v1/TimeseriesWidgetRequest.md +++ b/docs/v1/TimeseriesWidgetRequest.md @@ -22,7 +22,8 @@ Name | Type | Description | Notes **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **style** | [**WidgetRequestStyle**](WidgetRequestStyle.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ToplistWidgetDefinition.md b/docs/v1/ToplistWidgetDefinition.md index 9c61264973..c8f817053d 100644 --- a/docs/v1/ToplistWidgetDefinition.md +++ b/docs/v1/ToplistWidgetDefinition.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **title** | **str** | Title of your widget. | [optional] **title_align** | [**WidgetTextAlign**](WidgetTextAlign.md) | | [optional] **title_size** | **str** | Size of the title. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ToplistWidgetDefinitionType.md b/docs/v1/ToplistWidgetDefinitionType.md index 6582ed5fcf..ffebc4f865 100644 --- a/docs/v1/ToplistWidgetDefinitionType.md +++ b/docs/v1/ToplistWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the top list widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the top list widget. | defaults to "toplist", must be one of ["toplist", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/ToplistWidgetRequest.md b/docs/v1/ToplistWidgetRequest.md index 80adffd83a..0baeb9d33e 100644 --- a/docs/v1/ToplistWidgetRequest.md +++ b/docs/v1/ToplistWidgetRequest.md @@ -20,7 +20,8 @@ Name | Type | Description | Notes **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] **style** | [**WidgetRequestStyle**](WidgetRequestStyle.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TreeMapColorBy.md b/docs/v1/TreeMapColorBy.md index 2a5c96f7e2..9cc188bfa7 100644 --- a/docs/v1/TreeMapColorBy.md +++ b/docs/v1/TreeMapColorBy.md @@ -6,7 +6,8 @@ The attribute used to determine color in the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The attribute used to determine color in the widget. | defaults to "user", must be one of ["user", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TreeMapGroupBy.md b/docs/v1/TreeMapGroupBy.md index 7ccd2d1a52..ffa1ee20a4 100644 --- a/docs/v1/TreeMapGroupBy.md +++ b/docs/v1/TreeMapGroupBy.md @@ -6,7 +6,8 @@ The attribute used to group elements in the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The attribute used to group elements in the widget. | must be one of ["user", "family", "process", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TreeMapSizeBy.md b/docs/v1/TreeMapSizeBy.md index 684e58ec98..62a3d47461 100644 --- a/docs/v1/TreeMapSizeBy.md +++ b/docs/v1/TreeMapSizeBy.md @@ -6,7 +6,8 @@ The attribute used to determine size in the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The attribute used to determine size in the widget. | must be one of ["pct_cpu", "pct_mem", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TreeMapWidgetDefinition.md b/docs/v1/TreeMapWidgetDefinition.md index 310a1b06b1..811e71ea1a 100644 --- a/docs/v1/TreeMapWidgetDefinition.md +++ b/docs/v1/TreeMapWidgetDefinition.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **size_by** | [**TreeMapSizeBy**](TreeMapSizeBy.md) | | **type** | [**TreeMapWidgetDefinitionType**](TreeMapWidgetDefinitionType.md) | | **title** | **str** | Title of your widget. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TreeMapWidgetDefinitionType.md b/docs/v1/TreeMapWidgetDefinitionType.md index bf45b270dc..11fbeda480 100644 --- a/docs/v1/TreeMapWidgetDefinitionType.md +++ b/docs/v1/TreeMapWidgetDefinitionType.md @@ -6,7 +6,8 @@ Type of the treemap widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the treemap widget. | defaults to "treemap", must be one of ["treemap", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/TreeMapWidgetRequest.md b/docs/v1/TreeMapWidgetRequest.md index cc1a3606a7..b2fb6d25a3 100644 --- a/docs/v1/TreeMapWidgetRequest.md +++ b/docs/v1/TreeMapWidgetRequest.md @@ -6,7 +6,8 @@ An updated treemap widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **q** | **str** | The widget metrics query. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAnalyzedLogsHour.md b/docs/v1/UsageAnalyzedLogsHour.md index 05af0e13bb..8e72812886 100644 --- a/docs/v1/UsageAnalyzedLogsHour.md +++ b/docs/v1/UsageAnalyzedLogsHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **analyzed_logs** | **int** | Contains the number of analyzed logs. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAnalyzedLogsResponse.md b/docs/v1/UsageAnalyzedLogsResponse.md index 1045561261..76fc8009db 100644 --- a/docs/v1/UsageAnalyzedLogsResponse.md +++ b/docs/v1/UsageAnalyzedLogsResponse.md @@ -6,7 +6,8 @@ A response containing the number of analyzed logs for each hour for a given orga Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageAnalyzedLogsHour]**](UsageAnalyzedLogsHour.md) | Get hourly usage for analyzed logs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionAggregates.md b/docs/v1/UsageAttributionAggregates.md index ecaf169de6..77f017ef29 100644 --- a/docs/v1/UsageAttributionAggregates.md +++ b/docs/v1/UsageAttributionAggregates.md @@ -6,7 +6,8 @@ An array of available aggregates. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[UsageAttributionAggregatesBody]**](UsageAttributionAggregatesBody.md) | An array of available aggregates. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionAggregatesBody.md b/docs/v1/UsageAttributionAggregatesBody.md index d63a430c78..3411da20fd 100644 --- a/docs/v1/UsageAttributionAggregatesBody.md +++ b/docs/v1/UsageAttributionAggregatesBody.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **agg_type** | **str** | The aggregate type. | [optional] **field** | **str** | The field. | [optional] **value** | **float** | The value for a given field. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionBody.md b/docs/v1/UsageAttributionBody.md index 62996c8276..828373cd6e 100644 --- a/docs/v1/UsageAttributionBody.md +++ b/docs/v1/UsageAttributionBody.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **tags** | [**UsageAttributionTagNames**](UsageAttributionTagNames.md) | | [optional] **updated_at** | **str** | Shows the the most recent hour in the current months for all organizations for which all usages were calculated. | [optional] **values** | [**UsageAttributionValues**](UsageAttributionValues.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionMetadata.md b/docs/v1/UsageAttributionMetadata.md index ef6d2b772e..2767bafe5c 100644 --- a/docs/v1/UsageAttributionMetadata.md +++ b/docs/v1/UsageAttributionMetadata.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **aggregates** | [**UsageAttributionAggregates**](UsageAttributionAggregates.md) | | [optional] **pagination** | [**UsageAttributionPagination**](UsageAttributionPagination.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionPagination.md b/docs/v1/UsageAttributionPagination.md index 5477961949..73ab555ab5 100644 --- a/docs/v1/UsageAttributionPagination.md +++ b/docs/v1/UsageAttributionPagination.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **limit** | **int** | Maximum amount of records to be returned. | [optional] **next_record_id** | **str** | The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of this next_record_id. | [optional] **total_number_of_records** | **int** | Total number of records. (deprecated after May 1st, 2021) | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionResponse.md b/docs/v1/UsageAttributionResponse.md index 1507b8cd5c..f2b253a109 100644 --- a/docs/v1/UsageAttributionResponse.md +++ b/docs/v1/UsageAttributionResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | [**UsageAttributionMetadata**](UsageAttributionMetadata.md) | | [optional] **usage** | [**[UsageAttributionBody]**](UsageAttributionBody.md) | Get Usage Summary by tag(s). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionSort.md b/docs/v1/UsageAttributionSort.md index e5bcf1763a..bf2a3db866 100644 --- a/docs/v1/UsageAttributionSort.md +++ b/docs/v1/UsageAttributionSort.md @@ -6,7 +6,8 @@ The field to sort by. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The field to sort by. | defaults to "custom_timeseries_usage", must be one of ["api_percentage", "snmp_usage", "apm_host_usage", "api_usage", "container_usage", "custom_timeseries_percentage", "container_percentage", "apm_host_percentage", "npm_host_percentage", "browser_percentage", "browser_usage", "infra_host_percentage", "snmp_percentage", "npm_host_usage", "infra_host_usage", "custom_timeseries_usage", "lambda_functions_usage", "lambda_functions_percentage", "lambda_invocations_usage", "lambda_invocations_percentage", "lambda_usage", "lambda_percentage", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionSupportedMetrics.md b/docs/v1/UsageAttributionSupportedMetrics.md index 7207849d4f..bdda1e7c5d 100644 --- a/docs/v1/UsageAttributionSupportedMetrics.md +++ b/docs/v1/UsageAttributionSupportedMetrics.md @@ -6,7 +6,8 @@ Supported fields for usage attribution requests (valid requests contain one or m Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Supported fields for usage attribution requests (valid requests contain one or more metrics, or `*` for all). | must be one of ["custom_timeseries_usage", "container_usage", "snmp_percentage", "apm_host_usage", "browser_usage", "npm_host_percentage", "infra_host_usage", "custom_timeseries_percentage", "container_percentage", "lambda_usage", "api_usage", "apm_host_percentage", "infra_host_percentage", "snmp_usage", "browser_percentage", "api_percentage", "lambda_percentage", "npm_host_usage", "lambda_functions_usage", "lambda_functions_percentage", "lambda_invocations_usage", "lambda_invocations_percentage", "fargate_usage", "fargate_percentage", "profiled_host_usage", "profiled_host_percentage", "profiled_container_usage", "profiled_container_percentage", "*", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionTagNames.md b/docs/v1/UsageAttributionTagNames.md index 9e9e20fe5d..36dfbf020b 100644 --- a/docs/v1/UsageAttributionTagNames.md +++ b/docs/v1/UsageAttributionTagNames.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **any string name** | **[str]** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAttributionValues.md b/docs/v1/UsageAttributionValues.md index 2e2489d099..f616d87161 100644 --- a/docs/v1/UsageAttributionValues.md +++ b/docs/v1/UsageAttributionValues.md @@ -39,7 +39,8 @@ Name | Type | Description | Notes **profiled_hosts_usage** | **float** | The profiled host usage by tag(s). | [optional] **snmp_percentage** | **float** | The percentage of network device usage by tag(s). | [optional] **snmp_usage** | **float** | The network device usage by tag(s). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAuditLogsHour.md b/docs/v1/UsageAuditLogsHour.md index 0608d96089..c291eead7b 100644 --- a/docs/v1/UsageAuditLogsHour.md +++ b/docs/v1/UsageAuditLogsHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **lines_indexed** | **int** | The total number of audit logs lines indexed during a given hour. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageAuditLogsResponse.md b/docs/v1/UsageAuditLogsResponse.md index 753172ad70..cebeb9993c 100644 --- a/docs/v1/UsageAuditLogsResponse.md +++ b/docs/v1/UsageAuditLogsResponse.md @@ -6,7 +6,8 @@ Response containing the audit logs usage for each hour for a given organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageAuditLogsHour]**](UsageAuditLogsHour.md) | Get hourly usage for audit logs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageBillableSummaryBody.md b/docs/v1/UsageBillableSummaryBody.md index 9b53a733a8..807ddd3fd7 100644 --- a/docs/v1/UsageBillableSummaryBody.md +++ b/docs/v1/UsageBillableSummaryBody.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **org_billable_usage** | **int** | The number of units used within the billable timeframe. | [optional] **percentage_in_account** | **float** | The percentage of account usage the org represents. | [optional] **usage_unit** | **str** | Units pertaining to the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageBillableSummaryHour.md b/docs/v1/UsageBillableSummaryHour.md index 1e0164e740..398500c165 100644 --- a/docs/v1/UsageBillableSummaryHour.md +++ b/docs/v1/UsageBillableSummaryHour.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **ratio_in_month** | **int** | Shows usage aggregation for a billing period. | [optional] **start_date** | **datetime** | Shows the first date of usage. | [optional] **usage** | [**UsageBillableSummaryKeys**](UsageBillableSummaryKeys.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageBillableSummaryKeys.md b/docs/v1/UsageBillableSummaryKeys.md index 23325e7363..38b8b3051b 100644 --- a/docs/v1/UsageBillableSummaryKeys.md +++ b/docs/v1/UsageBillableSummaryKeys.md @@ -37,7 +37,8 @@ Name | Type | Description | Notes **synthetics_api_tests_sum** | [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] **synthetics_browser_checks_sum** | [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] **timeseries_average** | [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageBillableSummaryResponse.md b/docs/v1/UsageBillableSummaryResponse.md index 2309300d81..7cccc299fc 100644 --- a/docs/v1/UsageBillableSummaryResponse.md +++ b/docs/v1/UsageBillableSummaryResponse.md @@ -6,7 +6,8 @@ Response with monthly summary of data billed by Datadog. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageBillableSummaryHour]**](UsageBillableSummaryHour.md) | An array of objects regarding usage of billable summary. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCWSHour.md b/docs/v1/UsageCWSHour.md index 7c5bf8ef51..e4068e76b4 100644 --- a/docs/v1/UsageCWSHour.md +++ b/docs/v1/UsageCWSHour.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **cws_container_count** | **int** | The total number of Cloud Workload Security container hours from the start of the given hour’s month until the given hour. | [optional] **cws_host_count** | **int** | The total number of Cloud Workload Security host hours from the start of the given hour’s month until the given hour. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCWSResponse.md b/docs/v1/UsageCWSResponse.md index 632d821b8b..2e0cdfc29a 100644 --- a/docs/v1/UsageCWSResponse.md +++ b/docs/v1/UsageCWSResponse.md @@ -6,7 +6,8 @@ Response containing the Cloud Workload Security usage for each hour for a given Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageCWSHour]**](UsageCWSHour.md) | Get hourly usage for Cloud Workload Security. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCloudSecurityPostureManagementHour.md b/docs/v1/UsageCloudSecurityPostureManagementHour.md index ea02712859..66fbe88cc6 100644 --- a/docs/v1/UsageCloudSecurityPostureManagementHour.md +++ b/docs/v1/UsageCloudSecurityPostureManagementHour.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **container_count** | **int** | The total number of Cloud Security Posture Management containers during a given hour. | [optional] **host_count** | **int** | The total number of Cloud Security Posture Management hosts during a given hour. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCloudSecurityPostureManagementResponse.md b/docs/v1/UsageCloudSecurityPostureManagementResponse.md index 543602e75d..10ea0c914f 100644 --- a/docs/v1/UsageCloudSecurityPostureManagementResponse.md +++ b/docs/v1/UsageCloudSecurityPostureManagementResponse.md @@ -6,7 +6,8 @@ The response containing the Cloud Security Posture Management usage for each hou Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageCloudSecurityPostureManagementHour]**](UsageCloudSecurityPostureManagementHour.md) | Get hourly usage for Cloud Security Posture Management. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCustomReportsAttributes.md b/docs/v1/UsageCustomReportsAttributes.md index 0a56e3e9ca..72fa411d6b 100644 --- a/docs/v1/UsageCustomReportsAttributes.md +++ b/docs/v1/UsageCustomReportsAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **size** | **int** | size | [optional] **start_date** | **str** | The starting date of custom report. | [optional] **tags** | **[str]** | A list of tags to apply to custom reports. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCustomReportsData.md b/docs/v1/UsageCustomReportsData.md index fc53cc4b64..daff7732af 100644 --- a/docs/v1/UsageCustomReportsData.md +++ b/docs/v1/UsageCustomReportsData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**UsageCustomReportsAttributes**](UsageCustomReportsAttributes.md) | | [optional] **id** | **str** | The date for specified custom reports. | [optional] **type** | [**UsageReportsType**](UsageReportsType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCustomReportsMeta.md b/docs/v1/UsageCustomReportsMeta.md index fa970f47cf..56399dd29f 100644 --- a/docs/v1/UsageCustomReportsMeta.md +++ b/docs/v1/UsageCustomReportsMeta.md @@ -6,7 +6,8 @@ The object containing document metadata. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**UsageCustomReportsPage**](UsageCustomReportsPage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCustomReportsPage.md b/docs/v1/UsageCustomReportsPage.md index be6a2ed1a6..74a7ca7c47 100644 --- a/docs/v1/UsageCustomReportsPage.md +++ b/docs/v1/UsageCustomReportsPage.md @@ -6,7 +6,8 @@ The object containing page total count. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_count** | **int** | Total page count. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageCustomReportsResponse.md b/docs/v1/UsageCustomReportsResponse.md index e931ef640e..bb029d8ff9 100644 --- a/docs/v1/UsageCustomReportsResponse.md +++ b/docs/v1/UsageCustomReportsResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[UsageCustomReportsData]**](UsageCustomReportsData.md) | An array of available custom reports. | [optional] **meta** | [**UsageCustomReportsMeta**](UsageCustomReportsMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageFargateHour.md b/docs/v1/UsageFargateHour.md index cb69f38d0e..e88520ee2d 100644 --- a/docs/v1/UsageFargateHour.md +++ b/docs/v1/UsageFargateHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **tasks_count** | **int** | The number of Fargate tasks run. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageFargateResponse.md b/docs/v1/UsageFargateResponse.md index 48a9337f6d..c4b54a8fcb 100644 --- a/docs/v1/UsageFargateResponse.md +++ b/docs/v1/UsageFargateResponse.md @@ -6,7 +6,8 @@ Response containing the number of Fargate tasks run and hourly usage. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageFargateHour]**](UsageFargateHour.md) | Array with the number of hourly Fargate tasks recorded for a given organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageHostHour.md b/docs/v1/UsageHostHour.md index 0eec34ded2..b3cb60725b 100644 --- a/docs/v1/UsageHostHour.md +++ b/docs/v1/UsageHostHour.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **infra_azure_app_service** | **int** | Contains the total number of hosts that reported via the Azure App Services integration (and were NOT running the Datadog Agent). | [optional] **opentelemetry_host_count** | **int** | Contains the total number of hosts reported by Datadog exporter for the OpenTelemetry Collector. | [optional] **vsphere_host_count** | **int** | Contains the total number of hosts that reported via vSphere integration (and were NOT running the Datadog Agent). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageHostsResponse.md b/docs/v1/UsageHostsResponse.md index e1ee9a015a..810bfe013c 100644 --- a/docs/v1/UsageHostsResponse.md +++ b/docs/v1/UsageHostsResponse.md @@ -6,7 +6,8 @@ Host usage response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageHostHour]**](UsageHostHour.md) | An array of objects related to host usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIncidentManagementHour.md b/docs/v1/UsageIncidentManagementHour.md index 5af55b9089..d09c86e692 100644 --- a/docs/v1/UsageIncidentManagementHour.md +++ b/docs/v1/UsageIncidentManagementHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **monthly_active_users** | **int** | Contains the total number monthly active users from the start of the given hour's month until the given hour. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIncidentManagementResponse.md b/docs/v1/UsageIncidentManagementResponse.md index 1a9060b48c..ea9b76e69b 100644 --- a/docs/v1/UsageIncidentManagementResponse.md +++ b/docs/v1/UsageIncidentManagementResponse.md @@ -6,7 +6,8 @@ Response containing the incident management usage for each hour for a given orga Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageIncidentManagementHour]**](UsageIncidentManagementHour.md) | Get hourly usage for incident management. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIndexedSpansHour.md b/docs/v1/UsageIndexedSpansHour.md index 2df815aac4..c490a47904 100644 --- a/docs/v1/UsageIndexedSpansHour.md +++ b/docs/v1/UsageIndexedSpansHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **indexed_events_count** | **int** | Contains the number of spans indexed. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIndexedSpansResponse.md b/docs/v1/UsageIndexedSpansResponse.md index debf570bec..816cafa91f 100644 --- a/docs/v1/UsageIndexedSpansResponse.md +++ b/docs/v1/UsageIndexedSpansResponse.md @@ -6,7 +6,8 @@ A response containing indexed spans usage. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageIndexedSpansHour]**](UsageIndexedSpansHour.md) | Array with the number of hourly traces indexed for a given organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIngestedSpansHour.md b/docs/v1/UsageIngestedSpansHour.md index bcd795c89e..83aa65a601 100644 --- a/docs/v1/UsageIngestedSpansHour.md +++ b/docs/v1/UsageIngestedSpansHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **ingested_events_bytes** | **int** | Contains the total number of bytes ingested during a given hour. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIngestedSpansResponse.md b/docs/v1/UsageIngestedSpansResponse.md index 378dd1f15b..3fd0096d6e 100644 --- a/docs/v1/UsageIngestedSpansResponse.md +++ b/docs/v1/UsageIngestedSpansResponse.md @@ -6,7 +6,8 @@ Response containing the ingested spans usage for each hour for a given organizat Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageIngestedSpansHour]**](UsageIngestedSpansHour.md) | Get hourly usage for ingested spans. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIoTHour.md b/docs/v1/UsageIoTHour.md index b882e3672c..34e624a32d 100644 --- a/docs/v1/UsageIoTHour.md +++ b/docs/v1/UsageIoTHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **iot_device_count** | **int** | The total number of IoT devices during a given hour. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageIoTResponse.md b/docs/v1/UsageIoTResponse.md index 39a0f4c4ae..6afd50d765 100644 --- a/docs/v1/UsageIoTResponse.md +++ b/docs/v1/UsageIoTResponse.md @@ -6,7 +6,8 @@ Response containing the IoT usage for each hour for a given organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageIoTHour]**](UsageIoTHour.md) | Get hourly usage for IoT. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLambdaHour.md b/docs/v1/UsageLambdaHour.md index 662c0de9c8..cf82f93d04 100644 --- a/docs/v1/UsageLambdaHour.md +++ b/docs/v1/UsageLambdaHour.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **func_count** | **int** | Contains the number of different functions for each region and AWS account. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] **invocations_sum** | **int** | Contains the sum of invocations of all functions. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLambdaResponse.md b/docs/v1/UsageLambdaResponse.md index 47717dfc41..fcd0786cab 100644 --- a/docs/v1/UsageLambdaResponse.md +++ b/docs/v1/UsageLambdaResponse.md @@ -6,7 +6,8 @@ Response containing the number of lambda functions and sum of the invocations of Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageLambdaHour]**](UsageLambdaHour.md) | Get hourly usage for Lambda. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLogsByIndexHour.md b/docs/v1/UsageLogsByIndexHour.md index 661148cb30..4f0a2d381e 100644 --- a/docs/v1/UsageLogsByIndexHour.md +++ b/docs/v1/UsageLogsByIndexHour.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **index_id** | **str** | The index ID for this usage. | [optional] **index_name** | **str** | The user specified name for this index ID. | [optional] **retention** | **int** | The retention period (in days) for this index ID. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLogsByIndexResponse.md b/docs/v1/UsageLogsByIndexResponse.md index 5640c0f01d..7bdb070315 100644 --- a/docs/v1/UsageLogsByIndexResponse.md +++ b/docs/v1/UsageLogsByIndexResponse.md @@ -6,7 +6,8 @@ Response containing the number of indexed logs for each hour and index for a giv Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageLogsByIndexHour]**](UsageLogsByIndexHour.md) | An array of objects regarding hourly usage of logs by index response. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLogsByRetentionHour.md b/docs/v1/UsageLogsByRetentionHour.md index 7bbfa15118..b7e0bdd484 100644 --- a/docs/v1/UsageLogsByRetentionHour.md +++ b/docs/v1/UsageLogsByRetentionHour.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **live_indexed_events_count** | **int** | Live logs indexed with this retention period during a given hour. | [optional] **rehydrated_indexed_events_count** | **int** | Rehydrated logs indexed with this retention period during a given hour. | [optional] **retention** | **str** | The retention period in days or \"custom\" for all custom retention usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLogsByRetentionResponse.md b/docs/v1/UsageLogsByRetentionResponse.md index 564d324155..cb3d8d7d08 100644 --- a/docs/v1/UsageLogsByRetentionResponse.md +++ b/docs/v1/UsageLogsByRetentionResponse.md @@ -6,7 +6,8 @@ Response containing the indexed logs usage broken down by retention period for a Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageLogsByRetentionHour]**](UsageLogsByRetentionHour.md) | Get hourly usage for indexed logs by retention period. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLogsHour.md b/docs/v1/UsageLogsHour.md index 51e6e63dfd..e3de225a5c 100644 --- a/docs/v1/UsageLogsHour.md +++ b/docs/v1/UsageLogsHour.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **logs_live_ingested_bytes** | **int** | Contains the number of live log bytes ingested (data available as of December 1, 2020). | [optional] **logs_rehydrated_indexed_count** | **int** | Contains the number of rehydrated log events indexed (data available as of December 1, 2020). | [optional] **logs_rehydrated_ingested_bytes** | **int** | Contains the number of rehydrated log bytes ingested (data available as of December 1, 2020). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageLogsResponse.md b/docs/v1/UsageLogsResponse.md index 1fdc8b075e..6e96c014fa 100644 --- a/docs/v1/UsageLogsResponse.md +++ b/docs/v1/UsageLogsResponse.md @@ -6,7 +6,8 @@ Response containing the number of logs for each hour. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageLogsHour]**](UsageLogsHour.md) | An array of objects regarding hourly usage of logs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageMetricCategory.md b/docs/v1/UsageMetricCategory.md index b4476aea1f..dee4098b38 100644 --- a/docs/v1/UsageMetricCategory.md +++ b/docs/v1/UsageMetricCategory.md @@ -6,7 +6,8 @@ Contains the metric category. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Contains the metric category. | must be one of ["standard", "custom", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageNetworkFlowsHour.md b/docs/v1/UsageNetworkFlowsHour.md index ca0b09f382..68748259e3 100644 --- a/docs/v1/UsageNetworkFlowsHour.md +++ b/docs/v1/UsageNetworkFlowsHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **indexed_event_count** | **int** | Contains the number of netflow events indexed. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageNetworkFlowsResponse.md b/docs/v1/UsageNetworkFlowsResponse.md index 60af34be9d..2c6493e719 100644 --- a/docs/v1/UsageNetworkFlowsResponse.md +++ b/docs/v1/UsageNetworkFlowsResponse.md @@ -6,7 +6,8 @@ Response containing the number of netflow events indexed for each hour for a giv Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageNetworkFlowsHour]**](UsageNetworkFlowsHour.md) | Get hourly usage for Network Flows. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageNetworkHostsHour.md b/docs/v1/UsageNetworkHostsHour.md index 65b3f02c31..cdb31e0f3a 100644 --- a/docs/v1/UsageNetworkHostsHour.md +++ b/docs/v1/UsageNetworkHostsHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **host_count** | **int** | Contains the number of active NPM hosts. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageNetworkHostsResponse.md b/docs/v1/UsageNetworkHostsResponse.md index 1b4615f74f..09e2d5569b 100644 --- a/docs/v1/UsageNetworkHostsResponse.md +++ b/docs/v1/UsageNetworkHostsResponse.md @@ -6,7 +6,8 @@ Response containing the number of active NPM hosts for each hour for a given org Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageNetworkHostsHour]**](UsageNetworkHostsHour.md) | Get hourly usage for NPM hosts. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageProfilingHour.md b/docs/v1/UsageProfilingHour.md index 30fd6f4040..3e14682dec 100644 --- a/docs/v1/UsageProfilingHour.md +++ b/docs/v1/UsageProfilingHour.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **avg_container_agent_count** | **int** | Get average number of container agents for that hour. | [optional] **host_count** | **int** | Contains the total number of profiled hosts reporting during a given hour. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageProfilingResponse.md b/docs/v1/UsageProfilingResponse.md index 23947c0e9d..0ef07eb92e 100644 --- a/docs/v1/UsageProfilingResponse.md +++ b/docs/v1/UsageProfilingResponse.md @@ -6,7 +6,8 @@ Response containing the number of profiled hosts for each hour for a given organ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageProfilingHour]**](UsageProfilingHour.md) | Get hourly usage for profiled hosts. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageReportsType.md b/docs/v1/UsageReportsType.md index c20bf70605..1f681b7fe5 100644 --- a/docs/v1/UsageReportsType.md +++ b/docs/v1/UsageReportsType.md @@ -6,7 +6,8 @@ The type of reports. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of reports. | defaults to "reports", must be one of ["reports", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageRumSessionsHour.md b/docs/v1/UsageRumSessionsHour.md index 668a3d9fab..f70ecb8138 100644 --- a/docs/v1/UsageRumSessionsHour.md +++ b/docs/v1/UsageRumSessionsHour.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **session_count** | **int** | Contains the number of RUM Sessions. | [optional] **session_count_android** | **int** | Contains the number of mobile RUM Sessions on Android (data available beginning December 1, 2020). | [optional] **session_count_ios** | **int** | Contains the number of mobile RUM Sessions on iOS (data available beginning December 1, 2020). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageRumSessionsResponse.md b/docs/v1/UsageRumSessionsResponse.md index 6cbace88fc..d4ce01c3f1 100644 --- a/docs/v1/UsageRumSessionsResponse.md +++ b/docs/v1/UsageRumSessionsResponse.md @@ -6,7 +6,8 @@ Response containing the number of RUM Sessions for each hour for a given organiz Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageRumSessionsHour]**](UsageRumSessionsHour.md) | Get hourly usage for RUM Sessions. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSNMPHour.md b/docs/v1/UsageSNMPHour.md index ea653e0b1d..16e60f79c6 100644 --- a/docs/v1/UsageSNMPHour.md +++ b/docs/v1/UsageSNMPHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hour** | **datetime** | The hour for the usage. | [optional] **snmp_devices** | **int** | Contains the number of SNMP devices. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSNMPResponse.md b/docs/v1/UsageSNMPResponse.md index 9eac0bb8b5..6e4f00fad6 100644 --- a/docs/v1/UsageSNMPResponse.md +++ b/docs/v1/UsageSNMPResponse.md @@ -6,7 +6,8 @@ Response containing the number of SNMP devices for each hour for a given organiz Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageSNMPHour]**](UsageSNMPHour.md) | Get hourly usage for SNMP devices. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSort.md b/docs/v1/UsageSort.md index 83e8d72c24..9d52c47fdb 100644 --- a/docs/v1/UsageSort.md +++ b/docs/v1/UsageSort.md @@ -6,7 +6,8 @@ The field to sort by. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The field to sort by. | defaults to "start_date", must be one of ["computed_on", "size", "start_date", "end_date", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSortDirection.md b/docs/v1/UsageSortDirection.md index 6145ac42c1..8f4d7309e8 100644 --- a/docs/v1/UsageSortDirection.md +++ b/docs/v1/UsageSortDirection.md @@ -6,7 +6,8 @@ The direction to sort by. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The direction to sort by. | defaults to "desc", must be one of ["desc", "asc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSpecifiedCustomReportsAttributes.md b/docs/v1/UsageSpecifiedCustomReportsAttributes.md index e43e34941a..6cf8b6c5a9 100644 --- a/docs/v1/UsageSpecifiedCustomReportsAttributes.md +++ b/docs/v1/UsageSpecifiedCustomReportsAttributes.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **size** | **int** | size | [optional] **start_date** | **str** | The starting date of specified custom report. | [optional] **tags** | **[str]** | A list of tags to apply to specified custom reports. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSpecifiedCustomReportsData.md b/docs/v1/UsageSpecifiedCustomReportsData.md index f710e0706e..ad9dc14c9f 100644 --- a/docs/v1/UsageSpecifiedCustomReportsData.md +++ b/docs/v1/UsageSpecifiedCustomReportsData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**UsageSpecifiedCustomReportsAttributes**](UsageSpecifiedCustomReportsAttributes.md) | | [optional] **id** | **str** | The date for specified custom reports. | [optional] **type** | [**UsageReportsType**](UsageReportsType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSpecifiedCustomReportsMeta.md b/docs/v1/UsageSpecifiedCustomReportsMeta.md index d0f95e2c60..84fe744110 100644 --- a/docs/v1/UsageSpecifiedCustomReportsMeta.md +++ b/docs/v1/UsageSpecifiedCustomReportsMeta.md @@ -6,7 +6,8 @@ The object containing document metadata. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**UsageSpecifiedCustomReportsPage**](UsageSpecifiedCustomReportsPage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSpecifiedCustomReportsPage.md b/docs/v1/UsageSpecifiedCustomReportsPage.md index 99a260dc4e..512f2bc00d 100644 --- a/docs/v1/UsageSpecifiedCustomReportsPage.md +++ b/docs/v1/UsageSpecifiedCustomReportsPage.md @@ -6,7 +6,8 @@ The object containing page total count for specified ID. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_count** | **int** | Total page count. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSpecifiedCustomReportsResponse.md b/docs/v1/UsageSpecifiedCustomReportsResponse.md index 06ea770817..8d2f4ba73b 100644 --- a/docs/v1/UsageSpecifiedCustomReportsResponse.md +++ b/docs/v1/UsageSpecifiedCustomReportsResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**UsageSpecifiedCustomReportsData**](UsageSpecifiedCustomReportsData.md) | | [optional] **meta** | [**UsageSpecifiedCustomReportsMeta**](UsageSpecifiedCustomReportsMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSummaryDate.md b/docs/v1/UsageSummaryDate.md index 1b6f671dcf..80cb4226cb 100644 --- a/docs/v1/UsageSummaryDate.md +++ b/docs/v1/UsageSummaryDate.md @@ -48,7 +48,8 @@ Name | Type | Description | Notes **trace_search_indexed_events_count_sum** | **int** | Shows the sum of all Indexed Spans indexed over all hours in the current date for all organizations. | [optional] **twol_ingested_events_bytes_sum** | **int** | Shows the sum of all tracing without limits bytes ingested over all hours in the current date for all organizations. | [optional] **vsphere_host_top99p** | **int** | Shows the 99th percentile of all vSphere hosts over all hours in the current date for all organizations. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSummaryDateOrg.md b/docs/v1/UsageSummaryDateOrg.md index b0159dd063..57f274ea0f 100644 --- a/docs/v1/UsageSummaryDateOrg.md +++ b/docs/v1/UsageSummaryDateOrg.md @@ -49,7 +49,8 @@ Name | Type | Description | Notes **trace_search_indexed_events_count_sum** | **int** | Shows the sum of all Indexed Spans indexed over all hours in the current date for the given org. | [optional] **twol_ingested_events_bytes_sum** | **int** | Shows the sum of all tracing without limits bytes ingested over all hours in the current date for the given org. | [optional] **vsphere_host_top99p** | **int** | Shows the 99th percentile of all vSphere hosts over all hours in the current date for the given org. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSummaryResponse.md b/docs/v1/UsageSummaryResponse.md index 1a8766a751..becc1d502f 100644 --- a/docs/v1/UsageSummaryResponse.md +++ b/docs/v1/UsageSummaryResponse.md @@ -57,7 +57,8 @@ Name | Type | Description | Notes **twol_ingested_events_bytes_agg_sum** | **int** | Shows the sum of all tracing without limits bytes ingested over all hours in the current months for all organizations. | [optional] **usage** | [**[UsageSummaryDate]**](UsageSummaryDate.md) | An array of objects regarding hourly usage. | [optional] **vsphere_host_top99p_sum** | **int** | Shows the 99th percentile of all vSphere hosts over all hours in the current months for all organizations. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSyntheticsAPIHour.md b/docs/v1/UsageSyntheticsAPIHour.md index a6bc7e9886..34f9b31760 100644 --- a/docs/v1/UsageSyntheticsAPIHour.md +++ b/docs/v1/UsageSyntheticsAPIHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **check_calls_count** | **int** | Contains the number of Synthetics API tests run. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSyntheticsAPIResponse.md b/docs/v1/UsageSyntheticsAPIResponse.md index 65294c93ae..96c8abb058 100644 --- a/docs/v1/UsageSyntheticsAPIResponse.md +++ b/docs/v1/UsageSyntheticsAPIResponse.md @@ -6,7 +6,8 @@ Response containing the number of Synthetics API tests run for each hour for a g Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageSyntheticsAPIHour]**](UsageSyntheticsAPIHour.md) | Get hourly usage for Synthetics API tests. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSyntheticsBrowserHour.md b/docs/v1/UsageSyntheticsBrowserHour.md index f31058efef..b3f45a9456 100644 --- a/docs/v1/UsageSyntheticsBrowserHour.md +++ b/docs/v1/UsageSyntheticsBrowserHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **browser_check_calls_count** | **int** | Contains the number of Synthetics Browser tests run. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSyntheticsBrowserResponse.md b/docs/v1/UsageSyntheticsBrowserResponse.md index fde99d6e92..1335434a94 100644 --- a/docs/v1/UsageSyntheticsBrowserResponse.md +++ b/docs/v1/UsageSyntheticsBrowserResponse.md @@ -6,7 +6,8 @@ Response containing the number of Synthetics Browser tests run for each hour for Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageSyntheticsBrowserHour]**](UsageSyntheticsBrowserHour.md) | Get hourly usage for Synthetics Browser tests. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSyntheticsHour.md b/docs/v1/UsageSyntheticsHour.md index 8b26be18f3..f5bc1d3b73 100644 --- a/docs/v1/UsageSyntheticsHour.md +++ b/docs/v1/UsageSyntheticsHour.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **check_calls_count** | **int** | Contains the number of Synthetics API tests run. | [optional] **hour** | **datetime** | The hour for the usage. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageSyntheticsResponse.md b/docs/v1/UsageSyntheticsResponse.md index e04e9ba2d6..6e6b4d2bcd 100644 --- a/docs/v1/UsageSyntheticsResponse.md +++ b/docs/v1/UsageSyntheticsResponse.md @@ -6,7 +6,8 @@ Response containing the number of Synthetics API tests run for each hour for a g Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageSyntheticsHour]**](UsageSyntheticsHour.md) | Array with the number of hourly Synthetics test run for a given organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageTimeseriesHour.md b/docs/v1/UsageTimeseriesHour.md index 1f5a4d2937..c30ecbdbab 100644 --- a/docs/v1/UsageTimeseriesHour.md +++ b/docs/v1/UsageTimeseriesHour.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **num_custom_input_timeseries** | **int** | Contains the number of custom metrics that are inputs for aggregations (metric configured is custom). | [optional] **num_custom_output_timeseries** | **int** | Contains the number of custom metrics that are outputs for aggregations (metric configured is custom). | [optional] **num_custom_timeseries** | **int** | Contains the number of non-aggregation custom metrics. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageTimeseriesResponse.md b/docs/v1/UsageTimeseriesResponse.md index 13699d0b69..ca34955815 100644 --- a/docs/v1/UsageTimeseriesResponse.md +++ b/docs/v1/UsageTimeseriesResponse.md @@ -6,7 +6,8 @@ Response containing hourly usage of timeseries. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **usage** | [**[UsageTimeseriesHour]**](UsageTimeseriesHour.md) | An array of objects regarding hourly usage of timeseries. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageTopAvgMetricsHour.md b/docs/v1/UsageTopAvgMetricsHour.md index 138626734c..6ea3edb22c 100644 --- a/docs/v1/UsageTopAvgMetricsHour.md +++ b/docs/v1/UsageTopAvgMetricsHour.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **max_metric_hour** | **int** | Maximum number of timeseries per hour in which the metric occurs. | [optional] **metric_category** | [**UsageMetricCategory**](UsageMetricCategory.md) | | [optional] **metric_name** | **str** | Contains the custom metric name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageTopAvgMetricsMetadata.md b/docs/v1/UsageTopAvgMetricsMetadata.md index 671ad99ba7..04ce1bb7f5 100644 --- a/docs/v1/UsageTopAvgMetricsMetadata.md +++ b/docs/v1/UsageTopAvgMetricsMetadata.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **day** | **datetime** | The day value from the user request that contains the returned usage data. (If day was used the request) | [optional] **month** | **datetime** | The month value from the user request that contains the returned usage data. (If month was used the request) | [optional] **pagination** | [**UsageAttributionPagination**](UsageAttributionPagination.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsageTopAvgMetricsResponse.md b/docs/v1/UsageTopAvgMetricsResponse.md index 8ec3b838cd..c136a71624 100644 --- a/docs/v1/UsageTopAvgMetricsResponse.md +++ b/docs/v1/UsageTopAvgMetricsResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | [**UsageTopAvgMetricsMetadata**](UsageTopAvgMetricsMetadata.md) | | [optional] **usage** | [**[UsageTopAvgMetricsHour]**](UsageTopAvgMetricsHour.md) | Number of hourly recorded custom metrics for a given organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/User.md b/docs/v1/User.md index f59aabb2d0..4194b18791 100644 --- a/docs/v1/User.md +++ b/docs/v1/User.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **icon** | **str** | Gravatar icon associated to the user. | [optional] [readonly] **name** | **str** | The name of the user. | [optional] **verified** | **bool** | Whether or not the user logged in Datadog at least once. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UserDisableResponse.md b/docs/v1/UserDisableResponse.md index 6dd4ab6cec..6db4ad6bc6 100644 --- a/docs/v1/UserDisableResponse.md +++ b/docs/v1/UserDisableResponse.md @@ -6,7 +6,8 @@ Array of user disabled for a given organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Information pertaining to a user disabled for a given organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UserListResponse.md b/docs/v1/UserListResponse.md index bc6d5feb74..4e142f4f7f 100644 --- a/docs/v1/UserListResponse.md +++ b/docs/v1/UserListResponse.md @@ -6,7 +6,8 @@ Array of Datadog users for a given organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **users** | [**[User]**](User.md) | Array of users. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UserResponse.md b/docs/v1/UserResponse.md index 9aece1b8c7..750e52fa6b 100644 --- a/docs/v1/UserResponse.md +++ b/docs/v1/UserResponse.md @@ -6,7 +6,8 @@ A Datadog User. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user** | [**User**](User.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/UsersApi.md b/docs/v1/UsersApi.md index f3ba7620a3..7d4e18fbcf 100644 --- a/docs/v1/UsersApi.md +++ b/docs/v1/UsersApi.md @@ -42,9 +42,7 @@ with ApiClient(configuration) as api_client: disabled=False, email="test@datadoghq.com", handle="test@datadoghq.com", - icon="/path/to/matching/gravatar/icon", name="test user", - verified=True, ) # User | User object that needs to be created. # example passing only required values which don't have defaults set @@ -309,9 +307,7 @@ with ApiClient(configuration) as api_client: disabled=False, email="test@datadoghq.com", handle="test@datadoghq.com", - icon="/path/to/matching/gravatar/icon", name="test user", - verified=True, ) # User | Description of the update. # example passing only required values which don't have defaults set diff --git a/docs/v1/Widget.md b/docs/v1/Widget.md index dd4fc090f1..bea66b6260 100644 --- a/docs/v1/Widget.md +++ b/docs/v1/Widget.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **definition** | [**WidgetDefinition**](WidgetDefinition.md) | | **id** | **int** | ID of the widget. | [optional] **layout** | [**WidgetLayout**](WidgetLayout.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetAggregator.md b/docs/v1/WidgetAggregator.md index c15b836259..dba7c4c9ac 100644 --- a/docs/v1/WidgetAggregator.md +++ b/docs/v1/WidgetAggregator.md @@ -6,7 +6,8 @@ Aggregator used for the request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Aggregator used for the request. | must be one of ["avg", "last", "max", "min", "sum", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetAxis.md b/docs/v1/WidgetAxis.md index 653e2b0e40..8579c4396f 100644 --- a/docs/v1/WidgetAxis.md +++ b/docs/v1/WidgetAxis.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **max** | **str** | Specifies the maximum value to show on the y-axis. It takes a number, or auto for default behavior. | [optional] if omitted the server will use the default value of "auto" **min** | **str** | Specifies minimum value to show on the y-axis. It takes a number, or auto for default behavior. | [optional] if omitted the server will use the default value of "auto" **scale** | **str** | Specifies the scale type. Possible values are `linear`, `log`, `sqrt`, `pow##` (e.g. `pow2`, `pow0.5` etc.). | [optional] if omitted the server will use the default value of "linear" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetChangeType.md b/docs/v1/WidgetChangeType.md index 9cd88c3263..61591b8b7e 100644 --- a/docs/v1/WidgetChangeType.md +++ b/docs/v1/WidgetChangeType.md @@ -6,7 +6,8 @@ Show the absolute or the relative change. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Show the absolute or the relative change. | must be one of ["absolute", "relative", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetColorPreference.md b/docs/v1/WidgetColorPreference.md index 919a9f9416..3f4435b219 100644 --- a/docs/v1/WidgetColorPreference.md +++ b/docs/v1/WidgetColorPreference.md @@ -6,7 +6,8 @@ Which color to use on the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Which color to use on the widget. | must be one of ["background", "text", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetComparator.md b/docs/v1/WidgetComparator.md index 47fbebdd7d..a8ac8e37d8 100644 --- a/docs/v1/WidgetComparator.md +++ b/docs/v1/WidgetComparator.md @@ -6,7 +6,8 @@ Comparator to apply. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Comparator to apply. | must be one of [">", ">=", "<", "<=", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetCompareTo.md b/docs/v1/WidgetCompareTo.md index ff8ba0c629..20326f4204 100644 --- a/docs/v1/WidgetCompareTo.md +++ b/docs/v1/WidgetCompareTo.md @@ -6,7 +6,8 @@ Timeframe used for the change comparison. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Timeframe used for the change comparison. | must be one of ["hour_before", "day_before", "week_before", "month_before", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetConditionalFormat.md b/docs/v1/WidgetConditionalFormat.md index 1d76f8b942..ec9c774d19 100644 --- a/docs/v1/WidgetConditionalFormat.md +++ b/docs/v1/WidgetConditionalFormat.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **image_url** | **str** | Displays an image as the background. | [optional] **metric** | **str** | Metric from the request to correlate this conditional format with. | [optional] **timeframe** | **str** | Defines the displayed timeframe. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetCustomLink.md b/docs/v1/WidgetCustomLink.md index ccf02ba378..318fb8c222 100644 --- a/docs/v1/WidgetCustomLink.md +++ b/docs/v1/WidgetCustomLink.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **label** | **str** | The label for the custom link URL. Keep the label short and descriptive. Use metrics and tags as variables. | [optional] **link** | **str** | The URL of the custom link. URL must include `http` or `https`. A relative URL must start with `/`. | [optional] **override_label** | **str** | The label ID that refers to a context menu link. Can be `logs`, `hosts`, `traces`, `profiles`, `processes`, `containers`, or `rum`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetDefinition.md b/docs/v1/WidgetDefinition.md index 32d4130963..c5c90c1e0c 100644 --- a/docs/v1/WidgetDefinition.md +++ b/docs/v1/WidgetDefinition.md @@ -33,6 +33,6 @@ Name | Type | Description | Notes **ToplistWidgetDefinition** | [**ToplistWidgetDefinition**](ToplistWidgetDefinition.md) | Container class of the relevant properties. | **TreeMapWidgetDefinition** | [**TreeMapWidgetDefinition**](TreeMapWidgetDefinition.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetDisplayType.md b/docs/v1/WidgetDisplayType.md index 3cdbdaa4e5..a7f282ff0d 100644 --- a/docs/v1/WidgetDisplayType.md +++ b/docs/v1/WidgetDisplayType.md @@ -6,7 +6,8 @@ Type of display to use for the request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of display to use for the request. | must be one of ["area", "bars", "line", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetEvent.md b/docs/v1/WidgetEvent.md index 1c4dba6f6f..52cac2523f 100644 --- a/docs/v1/WidgetEvent.md +++ b/docs/v1/WidgetEvent.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **q** | **str** | Query definition. | **tags_execution** | **str** | The execution method for multi-value filters. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetEventSize.md b/docs/v1/WidgetEventSize.md index 6d33d5819a..ff33b9655a 100644 --- a/docs/v1/WidgetEventSize.md +++ b/docs/v1/WidgetEventSize.md @@ -6,7 +6,8 @@ Size to use to display an event. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Size to use to display an event. | must be one of ["s", "l", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetFieldSort.md b/docs/v1/WidgetFieldSort.md index 94cb303244..9486b7aa7c 100644 --- a/docs/v1/WidgetFieldSort.md +++ b/docs/v1/WidgetFieldSort.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **column** | **str** | Facet path for the column | **order** | [**WidgetSort**](WidgetSort.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetFormula.md b/docs/v1/WidgetFormula.md index d7809c24d0..793d95d73f 100644 --- a/docs/v1/WidgetFormula.md +++ b/docs/v1/WidgetFormula.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **cell_display_mode** | [**TableWidgetCellDisplayMode**](TableWidgetCellDisplayMode.md) | | [optional] **conditional_formats** | [**[WidgetConditionalFormat]**](WidgetConditionalFormat.md) | List of conditional formats. | [optional] **limit** | [**WidgetFormulaLimit**](WidgetFormulaLimit.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetFormulaLimit.md b/docs/v1/WidgetFormulaLimit.md index d101a0549f..7f17707ae8 100644 --- a/docs/v1/WidgetFormulaLimit.md +++ b/docs/v1/WidgetFormulaLimit.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **count** | **int** | Number of results to return. | [optional] **order** | [**QuerySortOrder**](QuerySortOrder.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetGrouping.md b/docs/v1/WidgetGrouping.md index 6b00a65d19..94edb4d9a3 100644 --- a/docs/v1/WidgetGrouping.md +++ b/docs/v1/WidgetGrouping.md @@ -6,7 +6,8 @@ The kind of grouping to use. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The kind of grouping to use. | must be one of ["check", "cluster", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetHorizontalAlign.md b/docs/v1/WidgetHorizontalAlign.md index 3801be3b63..a4ddbc4076 100644 --- a/docs/v1/WidgetHorizontalAlign.md +++ b/docs/v1/WidgetHorizontalAlign.md @@ -6,7 +6,8 @@ Horizontal alignment. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Horizontal alignment. | must be one of ["center", "left", "right", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetImageSizing.md b/docs/v1/WidgetImageSizing.md index a56e6a8dd2..decb02094f 100644 --- a/docs/v1/WidgetImageSizing.md +++ b/docs/v1/WidgetImageSizing.md @@ -6,7 +6,8 @@ How to size the image on the widget. The values are based on the image `object-f Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | How to size the image on the widget. The values are based on the image `object-fit` CSS properties. **Note**: `zoom`, `fit` and `center` values are deprecated. | must be one of ["fill", "contain", "cover", "none", "scale-down", "zoom", "fit", "center", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetLayout.md b/docs/v1/WidgetLayout.md index 92e848897d..37f868cddb 100644 --- a/docs/v1/WidgetLayout.md +++ b/docs/v1/WidgetLayout.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **x** | **int** | The position of the widget on the x (horizontal) axis. Should be a non-negative integer. | **y** | **int** | The position of the widget on the y (vertical) axis. Should be a non-negative integer. | **is_column_break** | **bool** | Whether the widget should be the first one on the second column in high density or not. **Note**: Only for the **new dashboard layout** and only one widget in the dashboard should have this property set to `true`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetLayoutType.md b/docs/v1/WidgetLayoutType.md index 4b659bd6db..5df8d8a17b 100644 --- a/docs/v1/WidgetLayoutType.md +++ b/docs/v1/WidgetLayoutType.md @@ -6,7 +6,8 @@ Layout type of the group. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Layout type of the group. | defaults to "ordered", must be one of ["ordered", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetLineType.md b/docs/v1/WidgetLineType.md index 949ce00a20..7526ee8786 100644 --- a/docs/v1/WidgetLineType.md +++ b/docs/v1/WidgetLineType.md @@ -6,7 +6,8 @@ Type of lines displayed. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of lines displayed. | must be one of ["dashed", "dotted", "solid", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetLineWidth.md b/docs/v1/WidgetLineWidth.md index 59874ec7bf..83b0c94c6c 100644 --- a/docs/v1/WidgetLineWidth.md +++ b/docs/v1/WidgetLineWidth.md @@ -6,7 +6,8 @@ Width of line displayed. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Width of line displayed. | must be one of ["normal", "thick", "thin", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetLiveSpan.md b/docs/v1/WidgetLiveSpan.md index d47dbed15d..df1d2688a9 100644 --- a/docs/v1/WidgetLiveSpan.md +++ b/docs/v1/WidgetLiveSpan.md @@ -6,7 +6,8 @@ The available timeframes depend on the widget you are using. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The available timeframes depend on the widget you are using. | must be one of ["1m", "5m", "10m", "15m", "30m", "1h", "4h", "1d", "2d", "1w", "1mo", "3mo", "6mo", "1y", "alert", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetMargin.md b/docs/v1/WidgetMargin.md index 9a97cc24d3..600802192d 100644 --- a/docs/v1/WidgetMargin.md +++ b/docs/v1/WidgetMargin.md @@ -6,7 +6,8 @@ Size of the margins around the image. **Note**: `small` and `large` values are d Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Size of the margins around the image. **Note**: `small` and `large` values are deprecated. | must be one of ["sm", "md", "lg", "small", "large", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetMarker.md b/docs/v1/WidgetMarker.md index 28a126475e..918233484a 100644 --- a/docs/v1/WidgetMarker.md +++ b/docs/v1/WidgetMarker.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **display_type** | **str** | Combination of: - A severity error, warning, ok, or info - A line type: dashed, solid, or bold In this case of a Distribution widget, this can be set to be `x_axis_percentile`. | [optional] **label** | **str** | Label to display over the marker. | [optional] **time** | **str** | Timestamp for the widget. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetMessageDisplay.md b/docs/v1/WidgetMessageDisplay.md index cd5a1cc8af..36338edf16 100644 --- a/docs/v1/WidgetMessageDisplay.md +++ b/docs/v1/WidgetMessageDisplay.md @@ -6,7 +6,8 @@ Amount of log lines to display Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Amount of log lines to display | must be one of ["inline", "expanded-md", "expanded-lg", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetMonitorSummaryDisplayFormat.md b/docs/v1/WidgetMonitorSummaryDisplayFormat.md index 26f0ffa744..a94f192268 100644 --- a/docs/v1/WidgetMonitorSummaryDisplayFormat.md +++ b/docs/v1/WidgetMonitorSummaryDisplayFormat.md @@ -6,7 +6,8 @@ What to display on the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | What to display on the widget. | must be one of ["counts", "countsAndList", "list", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetMonitorSummarySort.md b/docs/v1/WidgetMonitorSummarySort.md index b5e0096aa6..e637d62779 100644 --- a/docs/v1/WidgetMonitorSummarySort.md +++ b/docs/v1/WidgetMonitorSummarySort.md @@ -6,7 +6,8 @@ Widget sorting methods. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Widget sorting methods. | must be one of ["name", "group", "status", "tags", "triggered", "group,asc", "group,desc", "name,asc", "name,desc", "status,asc", "status,desc", "tags,asc", "tags,desc", "triggered,asc", "triggered,desc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetNodeType.md b/docs/v1/WidgetNodeType.md index c5ec7e6fdc..b056308ebb 100644 --- a/docs/v1/WidgetNodeType.md +++ b/docs/v1/WidgetNodeType.md @@ -6,7 +6,8 @@ Which type of node to use in the map. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Which type of node to use in the map. | must be one of ["host", "container", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetOrderBy.md b/docs/v1/WidgetOrderBy.md index 18112e7139..1b1fcce2b8 100644 --- a/docs/v1/WidgetOrderBy.md +++ b/docs/v1/WidgetOrderBy.md @@ -6,7 +6,8 @@ What to order by. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | What to order by. | must be one of ["change", "name", "present", "past", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetPalette.md b/docs/v1/WidgetPalette.md index 6e49a3f1d0..578d304a61 100644 --- a/docs/v1/WidgetPalette.md +++ b/docs/v1/WidgetPalette.md @@ -6,7 +6,8 @@ Color palette to apply. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Color palette to apply. | must be one of ["blue", "custom_bg", "custom_image", "custom_text", "gray_on_white", "grey", "green", "orange", "red", "red_on_white", "white_on_gray", "white_on_green", "green_on_white", "white_on_red", "white_on_yellow", "yellow_on_white", "black_on_light_yellow", "black_on_light_green", "black_on_light_red", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetRequestStyle.md b/docs/v1/WidgetRequestStyle.md index bd4cf38d69..5aa72eb94d 100644 --- a/docs/v1/WidgetRequestStyle.md +++ b/docs/v1/WidgetRequestStyle.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **line_type** | [**WidgetLineType**](WidgetLineType.md) | | [optional] **line_width** | [**WidgetLineWidth**](WidgetLineWidth.md) | | [optional] **palette** | **str** | Color palette to apply to the widget. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetServiceSummaryDisplayFormat.md b/docs/v1/WidgetServiceSummaryDisplayFormat.md index 164f75803a..ed060bc9bf 100644 --- a/docs/v1/WidgetServiceSummaryDisplayFormat.md +++ b/docs/v1/WidgetServiceSummaryDisplayFormat.md @@ -6,7 +6,8 @@ Number of columns to display. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Number of columns to display. | must be one of ["one_column", "two_column", "three_column", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetSizeFormat.md b/docs/v1/WidgetSizeFormat.md index 876e32ede6..dd00bd7630 100644 --- a/docs/v1/WidgetSizeFormat.md +++ b/docs/v1/WidgetSizeFormat.md @@ -6,7 +6,8 @@ Size of the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Size of the widget. | must be one of ["small", "medium", "large", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetSort.md b/docs/v1/WidgetSort.md index 28d6bca389..841da8eefd 100644 --- a/docs/v1/WidgetSort.md +++ b/docs/v1/WidgetSort.md @@ -6,7 +6,8 @@ Widget sorting methods. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Widget sorting methods. | must be one of ["asc", "desc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetStyle.md b/docs/v1/WidgetStyle.md index ad7f58015f..5e8fdd048b 100644 --- a/docs/v1/WidgetStyle.md +++ b/docs/v1/WidgetStyle.md @@ -6,7 +6,8 @@ Widget style definition. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **palette** | **str** | Color palette to apply to the widget. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetSummaryType.md b/docs/v1/WidgetSummaryType.md index c2e0271339..c87dd1c1ec 100644 --- a/docs/v1/WidgetSummaryType.md +++ b/docs/v1/WidgetSummaryType.md @@ -6,7 +6,8 @@ Which summary type should be used. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Which summary type should be used. | must be one of ["monitors", "groups", "combined", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetTextAlign.md b/docs/v1/WidgetTextAlign.md index ea6477fac3..0fa4e80631 100644 --- a/docs/v1/WidgetTextAlign.md +++ b/docs/v1/WidgetTextAlign.md @@ -6,7 +6,8 @@ How to align the text on the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | How to align the text on the widget. | must be one of ["center", "left", "right", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetTickEdge.md b/docs/v1/WidgetTickEdge.md index bd549ae310..d3b9e7d6cf 100644 --- a/docs/v1/WidgetTickEdge.md +++ b/docs/v1/WidgetTickEdge.md @@ -6,7 +6,8 @@ Define how you want to align the text on the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Define how you want to align the text on the widget. | must be one of ["bottom", "left", "right", "top", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetTime.md b/docs/v1/WidgetTime.md index 1672787c57..d7593bacd9 100644 --- a/docs/v1/WidgetTime.md +++ b/docs/v1/WidgetTime.md @@ -6,7 +6,8 @@ Time setting for the widget. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **live_span** | [**WidgetLiveSpan**](WidgetLiveSpan.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetTimeWindows.md b/docs/v1/WidgetTimeWindows.md index 38a0a8b04d..d487dc5379 100644 --- a/docs/v1/WidgetTimeWindows.md +++ b/docs/v1/WidgetTimeWindows.md @@ -6,7 +6,8 @@ Define a time window. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Define a time window. | must be one of ["7d", "30d", "90d", "week_to_date", "previous_week", "month_to_date", "previous_month", "global_time", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetVerticalAlign.md b/docs/v1/WidgetVerticalAlign.md index e417b8a254..bd2766eecf 100644 --- a/docs/v1/WidgetVerticalAlign.md +++ b/docs/v1/WidgetVerticalAlign.md @@ -6,7 +6,8 @@ Vertical alignment. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Vertical alignment. | must be one of ["center", "top", "bottom", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetViewMode.md b/docs/v1/WidgetViewMode.md index 48a4539737..ed2374073f 100644 --- a/docs/v1/WidgetViewMode.md +++ b/docs/v1/WidgetViewMode.md @@ -6,7 +6,8 @@ Define how you want the SLO to be displayed. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Define how you want the SLO to be displayed. | must be one of ["overall", "component", "both", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v1/WidgetVizType.md b/docs/v1/WidgetVizType.md index 1720882452..465652e392 100644 --- a/docs/v1/WidgetVizType.md +++ b/docs/v1/WidgetVizType.md @@ -6,7 +6,8 @@ Whether to display the Alert Graph as a timeseries or a top list. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Whether to display the Alert Graph as a timeseries or a top list. | must be one of ["timeseries", "toplist", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIErrorResponse.md b/docs/v2/APIErrorResponse.md index 884da9c546..f8ab59fa15 100644 --- a/docs/v2/APIErrorResponse.md +++ b/docs/v2/APIErrorResponse.md @@ -6,7 +6,8 @@ API error response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **errors** | **[str]** | A list of errors. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyCreateAttributes.md b/docs/v2/APIKeyCreateAttributes.md index 43365e3ffa..0dff1260bb 100644 --- a/docs/v2/APIKeyCreateAttributes.md +++ b/docs/v2/APIKeyCreateAttributes.md @@ -6,7 +6,8 @@ Attributes used to create an API Key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the API key. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyCreateData.md b/docs/v2/APIKeyCreateData.md index d1d9e60fbb..729a7c2423 100644 --- a/docs/v2/APIKeyCreateData.md +++ b/docs/v2/APIKeyCreateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**APIKeyCreateAttributes**](APIKeyCreateAttributes.md) | | **type** | [**APIKeysType**](APIKeysType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyCreateRequest.md b/docs/v2/APIKeyCreateRequest.md index 9ce2b43714..fb41d35cac 100644 --- a/docs/v2/APIKeyCreateRequest.md +++ b/docs/v2/APIKeyCreateRequest.md @@ -6,7 +6,8 @@ Request used to create an API key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**APIKeyCreateData**](APIKeyCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyRelationships.md b/docs/v2/APIKeyRelationships.md index 8ee83c4bf1..74b40e04cd 100644 --- a/docs/v2/APIKeyRelationships.md +++ b/docs/v2/APIKeyRelationships.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] **modified_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyResponse.md b/docs/v2/APIKeyResponse.md index 9ec08f2a5a..6612845427 100644 --- a/docs/v2/APIKeyResponse.md +++ b/docs/v2/APIKeyResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**FullAPIKey**](FullAPIKey.md) | | [optional] **included** | [**[APIKeyResponseIncludedItem]**](APIKeyResponseIncludedItem.md) | Array of objects related to the API key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyResponseIncludedItem.md b/docs/v2/APIKeyResponseIncludedItem.md index 5ad4662a40..c6ec0c69ca 100644 --- a/docs/v2/APIKeyResponseIncludedItem.md +++ b/docs/v2/APIKeyResponseIncludedItem.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **User** | [**User**](User.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyUpdateAttributes.md b/docs/v2/APIKeyUpdateAttributes.md index cbf1f566bd..ebe6785c13 100644 --- a/docs/v2/APIKeyUpdateAttributes.md +++ b/docs/v2/APIKeyUpdateAttributes.md @@ -6,7 +6,8 @@ Attributes used to update an API Key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the API key. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyUpdateData.md b/docs/v2/APIKeyUpdateData.md index f93c5c8c75..0512237205 100644 --- a/docs/v2/APIKeyUpdateData.md +++ b/docs/v2/APIKeyUpdateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**APIKeyUpdateAttributes**](APIKeyUpdateAttributes.md) | | **id** | **str** | ID of the API key. | **type** | [**APIKeysType**](APIKeysType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeyUpdateRequest.md b/docs/v2/APIKeyUpdateRequest.md index 3e91f12bcd..e15a535b68 100644 --- a/docs/v2/APIKeyUpdateRequest.md +++ b/docs/v2/APIKeyUpdateRequest.md @@ -6,7 +6,8 @@ Request used to update an API key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**APIKeyUpdateData**](APIKeyUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeysResponse.md b/docs/v2/APIKeysResponse.md index 81f9f4f42a..ccacf2704f 100644 --- a/docs/v2/APIKeysResponse.md +++ b/docs/v2/APIKeysResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[PartialAPIKey]**](PartialAPIKey.md) | Array of API keys. | [optional] **included** | [**[APIKeyResponseIncludedItem]**](APIKeyResponseIncludedItem.md) | Array of objects related to the API key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeysSort.md b/docs/v2/APIKeysSort.md index 7b0d376a9b..0e0b36ec32 100644 --- a/docs/v2/APIKeysSort.md +++ b/docs/v2/APIKeysSort.md @@ -6,7 +6,8 @@ Sorting options Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Sorting options | defaults to "name", must be one of ["created_at", "-created_at", "last4", "-last4", "modified_at", "-modified_at", "name", "-name", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/APIKeysType.md b/docs/v2/APIKeysType.md index 654e21a9ce..0711ae8a27 100644 --- a/docs/v2/APIKeysType.md +++ b/docs/v2/APIKeysType.md @@ -6,7 +6,8 @@ API Keys resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | API Keys resource type. | defaults to "api_keys", must be one of ["api_keys", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyCreateAttributes.md b/docs/v2/ApplicationKeyCreateAttributes.md index 1cae1917a0..6dce3b9832 100644 --- a/docs/v2/ApplicationKeyCreateAttributes.md +++ b/docs/v2/ApplicationKeyCreateAttributes.md @@ -6,7 +6,8 @@ Attributes used to create an application Key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the application key. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyCreateData.md b/docs/v2/ApplicationKeyCreateData.md index 22621ed196..75d698fce8 100644 --- a/docs/v2/ApplicationKeyCreateData.md +++ b/docs/v2/ApplicationKeyCreateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**ApplicationKeyCreateAttributes**](ApplicationKeyCreateAttributes.md) | | **type** | [**ApplicationKeysType**](ApplicationKeysType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyCreateRequest.md b/docs/v2/ApplicationKeyCreateRequest.md index 56572e59d2..35174b9022 100644 --- a/docs/v2/ApplicationKeyCreateRequest.md +++ b/docs/v2/ApplicationKeyCreateRequest.md @@ -6,7 +6,8 @@ Request used to create an application key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**ApplicationKeyCreateData**](ApplicationKeyCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyRelationships.md b/docs/v2/ApplicationKeyRelationships.md index 99d7a03b92..04fb416228 100644 --- a/docs/v2/ApplicationKeyRelationships.md +++ b/docs/v2/ApplicationKeyRelationships.md @@ -6,7 +6,8 @@ Resources related to the application key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyResponse.md b/docs/v2/ApplicationKeyResponse.md index 44874904ba..b8f5439ca5 100644 --- a/docs/v2/ApplicationKeyResponse.md +++ b/docs/v2/ApplicationKeyResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**FullApplicationKey**](FullApplicationKey.md) | | [optional] **included** | [**[ApplicationKeyResponseIncludedItem]**](ApplicationKeyResponseIncludedItem.md) | Array of objects related to the application key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyResponseIncludedItem.md b/docs/v2/ApplicationKeyResponseIncludedItem.md index 81cd3f2db8..76d41d1e02 100644 --- a/docs/v2/ApplicationKeyResponseIncludedItem.md +++ b/docs/v2/ApplicationKeyResponseIncludedItem.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **Role** | [**Role**](Role.md) | Container class of the relevant properties. | **User** | [**User**](User.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyUpdateAttributes.md b/docs/v2/ApplicationKeyUpdateAttributes.md index a7f4bfc90c..57b83b9ba7 100644 --- a/docs/v2/ApplicationKeyUpdateAttributes.md +++ b/docs/v2/ApplicationKeyUpdateAttributes.md @@ -6,7 +6,8 @@ Attributes used to update an application Key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the application key. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyUpdateData.md b/docs/v2/ApplicationKeyUpdateData.md index 4682e3ba1e..03a0ee30ba 100644 --- a/docs/v2/ApplicationKeyUpdateData.md +++ b/docs/v2/ApplicationKeyUpdateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**ApplicationKeyUpdateAttributes**](ApplicationKeyUpdateAttributes.md) | | **id** | **str** | ID of the application key. | **type** | [**ApplicationKeysType**](ApplicationKeysType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeyUpdateRequest.md b/docs/v2/ApplicationKeyUpdateRequest.md index 992ff32271..94fe5e5881 100644 --- a/docs/v2/ApplicationKeyUpdateRequest.md +++ b/docs/v2/ApplicationKeyUpdateRequest.md @@ -6,7 +6,8 @@ Request used to update an application key. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**ApplicationKeyUpdateData**](ApplicationKeyUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeysSort.md b/docs/v2/ApplicationKeysSort.md index 724d41a765..bd3e7e8acc 100644 --- a/docs/v2/ApplicationKeysSort.md +++ b/docs/v2/ApplicationKeysSort.md @@ -6,7 +6,8 @@ Sorting options Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Sorting options | defaults to "name", must be one of ["created_at", "-created_at", "last4", "-last4", "name", "-name", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ApplicationKeysType.md b/docs/v2/ApplicationKeysType.md index becc746baa..25928f2c0f 100644 --- a/docs/v2/ApplicationKeysType.md +++ b/docs/v2/ApplicationKeysType.md @@ -6,7 +6,8 @@ Application Keys resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Application Keys resource type. | defaults to "application_keys", must be one of ["application_keys", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Creator.md b/docs/v2/Creator.md index d3cb8596f0..bd1b73d309 100644 --- a/docs/v2/Creator.md +++ b/docs/v2/Creator.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **email** | **str** | Email of the creator. | [optional] **handle** | **str** | Handle of the creator. | [optional] **name** | **str** | Name of the creator. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListAddItemsRequest.md b/docs/v2/DashboardListAddItemsRequest.md index b00c88323c..17f8458822 100644 --- a/docs/v2/DashboardListAddItemsRequest.md +++ b/docs/v2/DashboardListAddItemsRequest.md @@ -6,7 +6,8 @@ Request containing a list of dashboards to add. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboards** | [**[DashboardListItemRequest]**](DashboardListItemRequest.md) | List of dashboards to add the dashboard list. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListAddItemsResponse.md b/docs/v2/DashboardListAddItemsResponse.md index 0f8990ef54..ef345aeb08 100644 --- a/docs/v2/DashboardListAddItemsResponse.md +++ b/docs/v2/DashboardListAddItemsResponse.md @@ -6,7 +6,8 @@ Response containing a list of added dashboards. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **added_dashboards_to_list** | [**[DashboardListItemResponse]**](DashboardListItemResponse.md) | List of dashboards added to the dashboard list. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListDeleteItemsRequest.md b/docs/v2/DashboardListDeleteItemsRequest.md index ec64f49619..4d1c4f6fe2 100644 --- a/docs/v2/DashboardListDeleteItemsRequest.md +++ b/docs/v2/DashboardListDeleteItemsRequest.md @@ -6,7 +6,8 @@ Request containing a list of dashboards to delete. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboards** | [**[DashboardListItemRequest]**](DashboardListItemRequest.md) | List of dashboards to delete from the dashboard list. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListDeleteItemsResponse.md b/docs/v2/DashboardListDeleteItemsResponse.md index 7553bc89cc..7539f968af 100644 --- a/docs/v2/DashboardListDeleteItemsResponse.md +++ b/docs/v2/DashboardListDeleteItemsResponse.md @@ -6,7 +6,8 @@ Response containing a list of deleted dashboards. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **deleted_dashboards_from_list** | [**[DashboardListItemResponse]**](DashboardListItemResponse.md) | List of dashboards deleted from the dashboard list. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListItem.md b/docs/v2/DashboardListItem.md index c370c9d743..8285145600 100644 --- a/docs/v2/DashboardListItem.md +++ b/docs/v2/DashboardListItem.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **popularity** | **int** | Popularity of the dashboard. | [optional] [readonly] **title** | **str** | Title of the dashboard. | [optional] [readonly] **url** | **str** | URL path to the dashboard. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListItemRequest.md b/docs/v2/DashboardListItemRequest.md index b6aa9d0284..303db84380 100644 --- a/docs/v2/DashboardListItemRequest.md +++ b/docs/v2/DashboardListItemRequest.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | ID of the dashboard. | **type** | [**DashboardType**](DashboardType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListItemResponse.md b/docs/v2/DashboardListItemResponse.md index dcaf3e4700..2e9432fed3 100644 --- a/docs/v2/DashboardListItemResponse.md +++ b/docs/v2/DashboardListItemResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | ID of the dashboard. | [readonly] **type** | [**DashboardType**](DashboardType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListItems.md b/docs/v2/DashboardListItems.md index 31258c83ac..a449babf1e 100644 --- a/docs/v2/DashboardListItems.md +++ b/docs/v2/DashboardListItems.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboards** | [**[DashboardListItem]**](DashboardListItem.md) | List of dashboards in the dashboard list. | **total** | **int** | Number of dashboards in the dashboard list. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListUpdateItemsRequest.md b/docs/v2/DashboardListUpdateItemsRequest.md index a68db523d7..0e6735630e 100644 --- a/docs/v2/DashboardListUpdateItemsRequest.md +++ b/docs/v2/DashboardListUpdateItemsRequest.md @@ -6,7 +6,8 @@ Request containing the list of dashboards to update to. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboards** | [**[DashboardListItemRequest]**](DashboardListItemRequest.md) | List of dashboards to update the dashboard list to. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardListUpdateItemsResponse.md b/docs/v2/DashboardListUpdateItemsResponse.md index 8cf8105241..d1363a5e8c 100644 --- a/docs/v2/DashboardListUpdateItemsResponse.md +++ b/docs/v2/DashboardListUpdateItemsResponse.md @@ -6,7 +6,8 @@ Response containing a list of updated dashboards. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **dashboards** | [**[DashboardListItemResponse]**](DashboardListItemResponse.md) | List of dashboards in the dashboard list. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/DashboardType.md b/docs/v2/DashboardType.md index 241d61bf5d..a7080d0352 100644 --- a/docs/v2/DashboardType.md +++ b/docs/v2/DashboardType.md @@ -6,7 +6,8 @@ The type of the dashboard. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of the dashboard. | must be one of ["custom_timeboard", "custom_screenboard", "integration_screenboard", "integration_timeboard", "host_timeboard", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/FullAPIKey.md b/docs/v2/FullAPIKey.md index ea86f3a823..4ac8b94849 100644 --- a/docs/v2/FullAPIKey.md +++ b/docs/v2/FullAPIKey.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **id** | **str** | ID of the API key. | [optional] **relationships** | [**APIKeyRelationships**](APIKeyRelationships.md) | | [optional] **type** | [**APIKeysType**](APIKeysType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/FullAPIKeyAttributes.md b/docs/v2/FullAPIKeyAttributes.md index 87c66a072f..4b35512d3e 100644 --- a/docs/v2/FullAPIKeyAttributes.md +++ b/docs/v2/FullAPIKeyAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **last4** | **str** | The last four characters of the API key. | [optional] [readonly] **modified_at** | **str** | Date the API key was last modified. | [optional] [readonly] **name** | **str** | Name of the API key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/FullApplicationKey.md b/docs/v2/FullApplicationKey.md index 36ccd62f35..b6f4ee1d3f 100644 --- a/docs/v2/FullApplicationKey.md +++ b/docs/v2/FullApplicationKey.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **id** | **str** | ID of the application key. | [optional] **relationships** | [**ApplicationKeyRelationships**](ApplicationKeyRelationships.md) | | [optional] **type** | [**ApplicationKeysType**](ApplicationKeysType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/FullApplicationKeyAttributes.md b/docs/v2/FullApplicationKeyAttributes.md index 79384a3e7e..a32b3739dd 100644 --- a/docs/v2/FullApplicationKeyAttributes.md +++ b/docs/v2/FullApplicationKeyAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **key** | **str** | The application key. | [optional] [readonly] **last4** | **str** | The last four characters of the application key. | [optional] [readonly] **name** | **str** | Name of the application key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentCreateAttributes.md b/docs/v2/IncidentCreateAttributes.md index 872bec0d7d..52561f47e2 100644 --- a/docs/v2/IncidentCreateAttributes.md +++ b/docs/v2/IncidentCreateAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **fields** | [**{str: (IncidentFieldAttributes,)}**](IncidentFieldAttributes.md) | A condensed view of the user-defined fields for which to create initial selections. | [optional] **initial_timeline_cells** | [**[IncidentTimelineCellCreateAttributes]**](IncidentTimelineCellCreateAttributes.md) | An array of initial timeline cells to be placed at the beginning of the incident timeline. | [optional] **notification_handles** | **[str]** | Notification handles that will be notified of the incident at creation. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentCreateData.md b/docs/v2/IncidentCreateData.md index e3ac8d5844..647e3f5a1b 100644 --- a/docs/v2/IncidentCreateData.md +++ b/docs/v2/IncidentCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**IncidentCreateAttributes**](IncidentCreateAttributes.md) | | **type** | [**IncidentType**](IncidentType.md) | | **relationships** | [**IncidentCreateRelationships**](IncidentCreateRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentCreateRelationships.md b/docs/v2/IncidentCreateRelationships.md index 333dd0e6f8..a860b6fc30 100644 --- a/docs/v2/IncidentCreateRelationships.md +++ b/docs/v2/IncidentCreateRelationships.md @@ -6,7 +6,8 @@ The relationships the incident will have with other resources once created. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **commander** | [**RelationshipToUser**](RelationshipToUser.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentCreateRequest.md b/docs/v2/IncidentCreateRequest.md index eee8f78117..769f98d8ec 100644 --- a/docs/v2/IncidentCreateRequest.md +++ b/docs/v2/IncidentCreateRequest.md @@ -6,7 +6,8 @@ Create request for an incident. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentCreateData**](IncidentCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentFieldAttributes.md b/docs/v2/IncidentFieldAttributes.md index 6757488687..b1e7a4132a 100644 --- a/docs/v2/IncidentFieldAttributes.md +++ b/docs/v2/IncidentFieldAttributes.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **IncidentFieldAttributesMultipleValue** | [**IncidentFieldAttributesMultipleValue**](IncidentFieldAttributesMultipleValue.md) | Container class of the relevant properties. | **IncidentFieldAttributesSingleValue** | [**IncidentFieldAttributesSingleValue**](IncidentFieldAttributesSingleValue.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentFieldAttributesMultipleValue.md b/docs/v2/IncidentFieldAttributesMultipleValue.md index 19498a6768..51b8f2d5e0 100644 --- a/docs/v2/IncidentFieldAttributesMultipleValue.md +++ b/docs/v2/IncidentFieldAttributesMultipleValue.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**IncidentFieldAttributesValueType**](IncidentFieldAttributesValueType.md) | | [optional] **value** | **[str]** | The multiple values selected for this field. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentFieldAttributesSingleValue.md b/docs/v2/IncidentFieldAttributesSingleValue.md index bef119b486..f16f4d825a 100644 --- a/docs/v2/IncidentFieldAttributesSingleValue.md +++ b/docs/v2/IncidentFieldAttributesSingleValue.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | [**IncidentFieldAttributesSingleValueType**](IncidentFieldAttributesSingleValueType.md) | | [optional] **value** | **str** | The single value selected for this field. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentFieldAttributesSingleValueType.md b/docs/v2/IncidentFieldAttributesSingleValueType.md index af06f50951..9a1c4c7126 100644 --- a/docs/v2/IncidentFieldAttributesSingleValueType.md +++ b/docs/v2/IncidentFieldAttributesSingleValueType.md @@ -6,7 +6,8 @@ Type of the single value field definitions. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the single value field definitions. | defaults to "dropdown", must be one of ["dropdown", "textbox", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentFieldAttributesValueType.md b/docs/v2/IncidentFieldAttributesValueType.md index 40facc43ee..9ffa3d8637 100644 --- a/docs/v2/IncidentFieldAttributesValueType.md +++ b/docs/v2/IncidentFieldAttributesValueType.md @@ -6,7 +6,8 @@ Type of the single value field definitions. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the single value field definitions. | defaults to "multiselect", must be one of ["multiselect", "textarray", "metrictag", "autocomplete", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentIntegrationMetadataType.md b/docs/v2/IncidentIntegrationMetadataType.md index 9129cd59ac..a92497ba18 100644 --- a/docs/v2/IncidentIntegrationMetadataType.md +++ b/docs/v2/IncidentIntegrationMetadataType.md @@ -6,7 +6,8 @@ Integration metadata resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Integration metadata resource type. | defaults to "incident_integrations", must be one of ["incident_integrations", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentPostmortemType.md b/docs/v2/IncidentPostmortemType.md index f0e4570a29..8bcfff2e3c 100644 --- a/docs/v2/IncidentPostmortemType.md +++ b/docs/v2/IncidentPostmortemType.md @@ -6,7 +6,8 @@ Incident postmortem resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Incident postmortem resource type. | defaults to "incident_postmortems", must be one of ["incident_postmortems", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentRelatedObject.md b/docs/v2/IncidentRelatedObject.md index b6c94bbffb..e32cc7ca98 100644 --- a/docs/v2/IncidentRelatedObject.md +++ b/docs/v2/IncidentRelatedObject.md @@ -6,7 +6,8 @@ Object related to an incident. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Object related to an incident. | defaults to "users", must be one of ["users", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentResponse.md b/docs/v2/IncidentResponse.md index a315fed1db..eed4eeeed2 100644 --- a/docs/v2/IncidentResponse.md +++ b/docs/v2/IncidentResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentResponseData**](IncidentResponseData.md) | | **included** | [**[IncidentResponseIncludedItem]**](IncidentResponseIncludedItem.md) | Included related resources that the user requested. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentResponseAttributes.md b/docs/v2/IncidentResponseAttributes.md index 702d887e51..fee5cfb1ab 100644 --- a/docs/v2/IncidentResponseAttributes.md +++ b/docs/v2/IncidentResponseAttributes.md @@ -23,7 +23,8 @@ Name | Type | Description | Notes **time_to_internal_response** | **int** | The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`. | [optional] [readonly] **time_to_repair** | **int** | The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`. | [optional] [readonly] **time_to_resolve** | **int** | The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentResponseData.md b/docs/v2/IncidentResponseData.md index 7084284b38..d9a4e20dac 100644 --- a/docs/v2/IncidentResponseData.md +++ b/docs/v2/IncidentResponseData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**IncidentType**](IncidentType.md) | | **attributes** | [**IncidentResponseAttributes**](IncidentResponseAttributes.md) | | [optional] **relationships** | [**IncidentResponseRelationships**](IncidentResponseRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentResponseIncludedItem.md b/docs/v2/IncidentResponseIncludedItem.md index 190212df66..5938228bf1 100644 --- a/docs/v2/IncidentResponseIncludedItem.md +++ b/docs/v2/IncidentResponseIncludedItem.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **User** | [**User**](User.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentResponseRelationships.md b/docs/v2/IncidentResponseRelationships.md index 3b6ebb96b0..c33c838206 100644 --- a/docs/v2/IncidentResponseRelationships.md +++ b/docs/v2/IncidentResponseRelationships.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **integrations** | [**RelationshipToIncidentIntegrationMetadatas**](RelationshipToIncidentIntegrationMetadatas.md) | | [optional] **last_modified_by_user** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] **postmortem** | [**RelationshipToIncidentPostmortem**](RelationshipToIncidentPostmortem.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceCreateAttributes.md b/docs/v2/IncidentServiceCreateAttributes.md index 0ad20a91cb..6cba2ba3c6 100644 --- a/docs/v2/IncidentServiceCreateAttributes.md +++ b/docs/v2/IncidentServiceCreateAttributes.md @@ -6,7 +6,8 @@ The incident service's attributes for a create request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the incident service. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceCreateData.md b/docs/v2/IncidentServiceCreateData.md index 2573d02954..af6a09dbe0 100644 --- a/docs/v2/IncidentServiceCreateData.md +++ b/docs/v2/IncidentServiceCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **type** | [**IncidentServiceType**](IncidentServiceType.md) | | **attributes** | [**IncidentServiceCreateAttributes**](IncidentServiceCreateAttributes.md) | | [optional] **relationships** | [**IncidentServiceRelationships**](IncidentServiceRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceCreateRequest.md b/docs/v2/IncidentServiceCreateRequest.md index aff3bb7d02..a260603d19 100644 --- a/docs/v2/IncidentServiceCreateRequest.md +++ b/docs/v2/IncidentServiceCreateRequest.md @@ -6,7 +6,8 @@ Create request with an incident service payload. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentServiceCreateData**](IncidentServiceCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceIncludedItems.md b/docs/v2/IncidentServiceIncludedItems.md index 280d73d9eb..041ee64686 100644 --- a/docs/v2/IncidentServiceIncludedItems.md +++ b/docs/v2/IncidentServiceIncludedItems.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **User** | [**User**](User.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceRelationships.md b/docs/v2/IncidentServiceRelationships.md index 96368f0f79..49031b56be 100644 --- a/docs/v2/IncidentServiceRelationships.md +++ b/docs/v2/IncidentServiceRelationships.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] **last_modified_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceResponse.md b/docs/v2/IncidentServiceResponse.md index b45f67e827..ffd3996d5f 100644 --- a/docs/v2/IncidentServiceResponse.md +++ b/docs/v2/IncidentServiceResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentServiceResponseData**](IncidentServiceResponseData.md) | | **included** | [**[IncidentServiceIncludedItems]**](IncidentServiceIncludedItems.md) | Included objects from relationships. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceResponseAttributes.md b/docs/v2/IncidentServiceResponseAttributes.md index 63340158c7..00200d331f 100644 --- a/docs/v2/IncidentServiceResponseAttributes.md +++ b/docs/v2/IncidentServiceResponseAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **created** | **datetime** | Timestamp of when the incident service was created. | [optional] [readonly] **modified** | **datetime** | Timestamp of when the incident service was modified. | [optional] [readonly] **name** | **str** | Name of the incident service. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceResponseData.md b/docs/v2/IncidentServiceResponseData.md index b87638aa32..0c918d69b7 100644 --- a/docs/v2/IncidentServiceResponseData.md +++ b/docs/v2/IncidentServiceResponseData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**IncidentServiceType**](IncidentServiceType.md) | | **attributes** | [**IncidentServiceResponseAttributes**](IncidentServiceResponseAttributes.md) | | [optional] **relationships** | [**IncidentServiceRelationships**](IncidentServiceRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceType.md b/docs/v2/IncidentServiceType.md index 48c4e38123..8d6f11c6e2 100644 --- a/docs/v2/IncidentServiceType.md +++ b/docs/v2/IncidentServiceType.md @@ -6,7 +6,8 @@ Incident service resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Incident service resource type. | defaults to "services", must be one of ["services", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceUpdateAttributes.md b/docs/v2/IncidentServiceUpdateAttributes.md index 7217a5a0f4..a18311acbd 100644 --- a/docs/v2/IncidentServiceUpdateAttributes.md +++ b/docs/v2/IncidentServiceUpdateAttributes.md @@ -6,7 +6,8 @@ The incident service's attributes for an update request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the incident service. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceUpdateData.md b/docs/v2/IncidentServiceUpdateData.md index 82e999dab0..fd78b9986b 100644 --- a/docs/v2/IncidentServiceUpdateData.md +++ b/docs/v2/IncidentServiceUpdateData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **attributes** | [**IncidentServiceUpdateAttributes**](IncidentServiceUpdateAttributes.md) | | [optional] **id** | **str** | The incident service's ID. | [optional] **relationships** | [**IncidentServiceRelationships**](IncidentServiceRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServiceUpdateRequest.md b/docs/v2/IncidentServiceUpdateRequest.md index b504b4f09b..63fc340510 100644 --- a/docs/v2/IncidentServiceUpdateRequest.md +++ b/docs/v2/IncidentServiceUpdateRequest.md @@ -6,7 +6,8 @@ Update request with an incident service payload. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentServiceUpdateData**](IncidentServiceUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServicesApi.md b/docs/v2/IncidentServicesApi.md index f14dc7e808..15115b61c4 100644 --- a/docs/v2/IncidentServicesApi.md +++ b/docs/v2/IncidentServicesApi.md @@ -40,20 +40,6 @@ with ApiClient(configuration) as api_client: attributes=IncidentServiceCreateAttributes( name="an example service name", ), - relationships=IncidentServiceRelationships( - created_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - last_modified_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - ), type=IncidentServiceType("services"), ), ) # IncidentServiceCreateRequest | Incident Service Payload. @@ -349,20 +335,6 @@ with ApiClient(configuration) as api_client: name="an example service name", ), id="00000000-0000-0000-0000-000000000000", - relationships=IncidentServiceRelationships( - created_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - last_modified_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - ), type=IncidentServiceType("services"), ), ) # IncidentServiceUpdateRequest | Incident Service Payload. diff --git a/docs/v2/IncidentServicesResponse.md b/docs/v2/IncidentServicesResponse.md index c0950bdfe5..171624154d 100644 --- a/docs/v2/IncidentServicesResponse.md +++ b/docs/v2/IncidentServicesResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[IncidentServiceResponseData]**](IncidentServiceResponseData.md) | An array of incident services. | **included** | [**[IncidentServiceIncludedItems]**](IncidentServiceIncludedItems.md) | Included related resources which the user requested. | [optional] [readonly] **meta** | [**IncidentServicesResponseMeta**](IncidentServicesResponseMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServicesResponseMeta.md b/docs/v2/IncidentServicesResponseMeta.md index 4dc5586d6c..7634b1d18e 100644 --- a/docs/v2/IncidentServicesResponseMeta.md +++ b/docs/v2/IncidentServicesResponseMeta.md @@ -6,7 +6,8 @@ The metadata object containing pagination metadata. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pagination** | [**IncidentServicesResponseMetaPagination**](IncidentServicesResponseMetaPagination.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentServicesResponseMetaPagination.md b/docs/v2/IncidentServicesResponseMetaPagination.md index a4f32eb706..8c86eaaf87 100644 --- a/docs/v2/IncidentServicesResponseMetaPagination.md +++ b/docs/v2/IncidentServicesResponseMetaPagination.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **next_offset** | **int** | The index of the first element in the next page of results. Equal to page size added to the current offset. | [optional] **offset** | **int** | The index of the first element in the results. | [optional] **size** | **int** | Maximum size of pages to return. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamCreateAttributes.md b/docs/v2/IncidentTeamCreateAttributes.md index aa15f7aa3d..9a6c3a7e8b 100644 --- a/docs/v2/IncidentTeamCreateAttributes.md +++ b/docs/v2/IncidentTeamCreateAttributes.md @@ -6,7 +6,8 @@ The incident team's attributes for a create request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the incident team. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamCreateData.md b/docs/v2/IncidentTeamCreateData.md index 929dfe03b2..c8a4596623 100644 --- a/docs/v2/IncidentTeamCreateData.md +++ b/docs/v2/IncidentTeamCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **type** | [**IncidentTeamType**](IncidentTeamType.md) | | **attributes** | [**IncidentTeamCreateAttributes**](IncidentTeamCreateAttributes.md) | | [optional] **relationships** | [**IncidentTeamRelationships**](IncidentTeamRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamCreateRequest.md b/docs/v2/IncidentTeamCreateRequest.md index 0bc922e3dd..abecfab5f4 100644 --- a/docs/v2/IncidentTeamCreateRequest.md +++ b/docs/v2/IncidentTeamCreateRequest.md @@ -6,7 +6,8 @@ Create request with an incident team payload. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentTeamCreateData**](IncidentTeamCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamIncludedItems.md b/docs/v2/IncidentTeamIncludedItems.md index c213ae746c..b76c01c5fe 100644 --- a/docs/v2/IncidentTeamIncludedItems.md +++ b/docs/v2/IncidentTeamIncludedItems.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **User** | [**User**](User.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamRelationships.md b/docs/v2/IncidentTeamRelationships.md index f0d06eb027..50601f6c95 100644 --- a/docs/v2/IncidentTeamRelationships.md +++ b/docs/v2/IncidentTeamRelationships.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **created_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] **last_modified_by** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamResponse.md b/docs/v2/IncidentTeamResponse.md index 09f1710d40..b986ed4071 100644 --- a/docs/v2/IncidentTeamResponse.md +++ b/docs/v2/IncidentTeamResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentTeamResponseData**](IncidentTeamResponseData.md) | | **included** | [**[IncidentTeamIncludedItems]**](IncidentTeamIncludedItems.md) | Included objects from relationships. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamResponseAttributes.md b/docs/v2/IncidentTeamResponseAttributes.md index 9dbd7ba162..aaf8e5dc00 100644 --- a/docs/v2/IncidentTeamResponseAttributes.md +++ b/docs/v2/IncidentTeamResponseAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **created** | **datetime** | Timestamp of when the incident team was created. | [optional] [readonly] **modified** | **datetime** | Timestamp of when the incident team was modified. | [optional] [readonly] **name** | **str** | Name of the incident team. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamResponseData.md b/docs/v2/IncidentTeamResponseData.md index e87e1f3751..e33ce26daf 100644 --- a/docs/v2/IncidentTeamResponseData.md +++ b/docs/v2/IncidentTeamResponseData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **id** | **str** | The incident team's ID. | [optional] **relationships** | [**IncidentTeamRelationships**](IncidentTeamRelationships.md) | | [optional] **type** | [**IncidentTeamType**](IncidentTeamType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamType.md b/docs/v2/IncidentTeamType.md index be9a80a715..415b59d9bc 100644 --- a/docs/v2/IncidentTeamType.md +++ b/docs/v2/IncidentTeamType.md @@ -6,7 +6,8 @@ Incident Team resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Incident Team resource type. | defaults to "teams", must be one of ["teams", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamUpdateAttributes.md b/docs/v2/IncidentTeamUpdateAttributes.md index 3ad16a2a8c..8da1f31662 100644 --- a/docs/v2/IncidentTeamUpdateAttributes.md +++ b/docs/v2/IncidentTeamUpdateAttributes.md @@ -6,7 +6,8 @@ The incident team's attributes for an update request. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Name of the incident team. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamUpdateData.md b/docs/v2/IncidentTeamUpdateData.md index 4eaab3e612..df42293406 100644 --- a/docs/v2/IncidentTeamUpdateData.md +++ b/docs/v2/IncidentTeamUpdateData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **attributes** | [**IncidentTeamUpdateAttributes**](IncidentTeamUpdateAttributes.md) | | [optional] **id** | **str** | The incident team's ID. | [optional] **relationships** | [**IncidentTeamRelationships**](IncidentTeamRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamUpdateRequest.md b/docs/v2/IncidentTeamUpdateRequest.md index 84ba704f10..c2cb75fec3 100644 --- a/docs/v2/IncidentTeamUpdateRequest.md +++ b/docs/v2/IncidentTeamUpdateRequest.md @@ -6,7 +6,8 @@ Update request with an incident team payload. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentTeamUpdateData**](IncidentTeamUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTeamsApi.md b/docs/v2/IncidentTeamsApi.md index c539fe17b9..ea1262a8e4 100644 --- a/docs/v2/IncidentTeamsApi.md +++ b/docs/v2/IncidentTeamsApi.md @@ -40,20 +40,6 @@ with ApiClient(configuration) as api_client: attributes=IncidentTeamCreateAttributes( name="team name", ), - relationships=IncidentTeamRelationships( - created_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - last_modified_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - ), type=IncidentTeamType("teams"), ), ) # IncidentTeamCreateRequest | Incident Team Payload. @@ -349,20 +335,6 @@ with ApiClient(configuration) as api_client: name="team name", ), id="00000000-0000-0000-0000-000000000000", - relationships=IncidentTeamRelationships( - created_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - last_modified_by=RelationshipToUser( - data=RelationshipToUserData( - id="00000000-0000-0000-0000-000000000000", - type=UsersType("users"), - ), - ), - ), type=IncidentTeamType("teams"), ), ) # IncidentTeamUpdateRequest | Incident Team Payload. diff --git a/docs/v2/IncidentTeamsResponse.md b/docs/v2/IncidentTeamsResponse.md index 9c5601e7cb..d009b75cc0 100644 --- a/docs/v2/IncidentTeamsResponse.md +++ b/docs/v2/IncidentTeamsResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[IncidentTeamResponseData]**](IncidentTeamResponseData.md) | An array of incident teams. | **included** | [**[IncidentTeamIncludedItems]**](IncidentTeamIncludedItems.md) | Included related resources which the user requested. | [optional] [readonly] **meta** | [**IncidentServicesResponseMeta**](IncidentServicesResponseMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTimelineCellCreateAttributes.md b/docs/v2/IncidentTimelineCellCreateAttributes.md index 005e8fea48..5ce3887127 100644 --- a/docs/v2/IncidentTimelineCellCreateAttributes.md +++ b/docs/v2/IncidentTimelineCellCreateAttributes.md @@ -7,6 +7,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **IncidentTimelineCellMarkdownCreateAttributes** | [**IncidentTimelineCellMarkdownCreateAttributes**](IncidentTimelineCellMarkdownCreateAttributes.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTimelineCellMarkdownContentType.md b/docs/v2/IncidentTimelineCellMarkdownContentType.md index 774c096476..b3b32decbb 100644 --- a/docs/v2/IncidentTimelineCellMarkdownContentType.md +++ b/docs/v2/IncidentTimelineCellMarkdownContentType.md @@ -6,7 +6,8 @@ Type of the Markdown timeline cell. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Markdown timeline cell. | defaults to "markdown", must be one of ["markdown", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTimelineCellMarkdownCreateAttributes.md b/docs/v2/IncidentTimelineCellMarkdownCreateAttributes.md index f5b736f2c8..2eaf111fae 100644 --- a/docs/v2/IncidentTimelineCellMarkdownCreateAttributes.md +++ b/docs/v2/IncidentTimelineCellMarkdownCreateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **cell_type** | [**IncidentTimelineCellMarkdownContentType**](IncidentTimelineCellMarkdownContentType.md) | | **content** | [**IncidentTimelineCellMarkdownCreateAttributesContent**](IncidentTimelineCellMarkdownCreateAttributesContent.md) | | **important** | **bool** | A flag indicating whether the timeline cell is important and should be highlighted. | [optional] if omitted the server will use the default value of False +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentTimelineCellMarkdownCreateAttributesContent.md b/docs/v2/IncidentTimelineCellMarkdownCreateAttributesContent.md index f3dc7ee146..81b3670d1a 100644 --- a/docs/v2/IncidentTimelineCellMarkdownCreateAttributesContent.md +++ b/docs/v2/IncidentTimelineCellMarkdownCreateAttributesContent.md @@ -6,7 +6,8 @@ The Markdown timeline cell contents. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **content** | **str** | The Markdown content of the cell. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentType.md b/docs/v2/IncidentType.md index 8efc21f6b5..c1ba03b187 100644 --- a/docs/v2/IncidentType.md +++ b/docs/v2/IncidentType.md @@ -6,7 +6,8 @@ Incident resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Incident resource type. | defaults to "incidents", must be one of ["incidents", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentUpdateAttributes.md b/docs/v2/IncidentUpdateAttributes.md index 4a2deb7629..4995e47fad 100644 --- a/docs/v2/IncidentUpdateAttributes.md +++ b/docs/v2/IncidentUpdateAttributes.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **notification_handles** | **[str]** | Notification handles that will be notified of the incident during update. | [optional] **resolved** | **datetime, none_type** | Timestamp when the incident's state was set to resolved. | [optional] **title** | **str** | The title of the incident, which summarizes what happened. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentUpdateData.md b/docs/v2/IncidentUpdateData.md index 7294187938..7e75fd6964 100644 --- a/docs/v2/IncidentUpdateData.md +++ b/docs/v2/IncidentUpdateData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **type** | [**IncidentType**](IncidentType.md) | | **attributes** | [**IncidentUpdateAttributes**](IncidentUpdateAttributes.md) | | [optional] **relationships** | [**IncidentUpdateRelationships**](IncidentUpdateRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentUpdateRelationships.md b/docs/v2/IncidentUpdateRelationships.md index 845eebb76b..38f6313941 100644 --- a/docs/v2/IncidentUpdateRelationships.md +++ b/docs/v2/IncidentUpdateRelationships.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **integrations** | [**RelationshipToIncidentIntegrationMetadatas**](RelationshipToIncidentIntegrationMetadatas.md) | | [optional] **last_modified_by_user** | [**RelationshipToUser**](RelationshipToUser.md) | | [optional] **postmortem** | [**RelationshipToIncidentPostmortem**](RelationshipToIncidentPostmortem.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentUpdateRequest.md b/docs/v2/IncidentUpdateRequest.md index f8eab93199..be1567d053 100644 --- a/docs/v2/IncidentUpdateRequest.md +++ b/docs/v2/IncidentUpdateRequest.md @@ -6,7 +6,8 @@ Update request for an incident. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncidentUpdateData**](IncidentUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/IncidentsResponse.md b/docs/v2/IncidentsResponse.md index e1a15628a1..28f56c603e 100644 --- a/docs/v2/IncidentsResponse.md +++ b/docs/v2/IncidentsResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[IncidentResponseData]**](IncidentResponseData.md) | An array of incidents. | **included** | [**[IncidentResponseIncludedItem]**](IncidentResponseIncludedItem.md) | Included related resources that the user requested. | [optional] [readonly] **meta** | [**IncidentServicesResponseMeta**](IncidentServicesResponseMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ListApplicationKeysResponse.md b/docs/v2/ListApplicationKeysResponse.md index 22b5eb2055..e0159d7766 100644 --- a/docs/v2/ListApplicationKeysResponse.md +++ b/docs/v2/ListApplicationKeysResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[PartialApplicationKey]**](PartialApplicationKey.md) | Array of application keys. | [optional] **included** | [**[ApplicationKeyResponseIncludedItem]**](ApplicationKeyResponseIncludedItem.md) | Array of objects related to the application key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Log.md b/docs/v2/Log.md index ed4c47d38c..34623c2f69 100644 --- a/docs/v2/Log.md +++ b/docs/v2/Log.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**LogAttributes**](LogAttributes.md) | | [optional] **id** | **str** | Unique ID of the Log. | [optional] **type** | [**LogType**](LogType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogAttributes.md b/docs/v2/LogAttributes.md index 9ecb2300d4..b3993ed360 100644 --- a/docs/v2/LogAttributes.md +++ b/docs/v2/LogAttributes.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **status** | **str** | Status of the message associated with your log. | [optional] **tags** | **[str]** | Array of tags associated with your log. | [optional] **timestamp** | **datetime** | Timestamp of your log. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogType.md b/docs/v2/LogType.md index f5c4f68213..12d6aa9489 100644 --- a/docs/v2/LogType.md +++ b/docs/v2/LogType.md @@ -6,7 +6,8 @@ Type of the event. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the event. | defaults to "log", must be one of ["log", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateBucket.md b/docs/v2/LogsAggregateBucket.md index ea7b3416d0..029eb807c8 100644 --- a/docs/v2/LogsAggregateBucket.md +++ b/docs/v2/LogsAggregateBucket.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **by** | **{str: (str,)}** | The key, value pairs for each group by | [optional] **computes** | [**{str: (LogsAggregateBucketValue,)}**](LogsAggregateBucketValue.md) | A map of the metric name -> value for regular compute or list of values for a timeseries | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateBucketValue.md b/docs/v2/LogsAggregateBucketValue.md index 3d910a1007..8ffd06eea2 100644 --- a/docs/v2/LogsAggregateBucketValue.md +++ b/docs/v2/LogsAggregateBucketValue.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **float** | [**float**](float.md) | Container class of the relevant properties. | **str** | [**str**](str.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateBucketValueTimeseries.md b/docs/v2/LogsAggregateBucketValueTimeseries.md index 1095f76895..666caaa5ad 100644 --- a/docs/v2/LogsAggregateBucketValueTimeseries.md +++ b/docs/v2/LogsAggregateBucketValueTimeseries.md @@ -6,7 +6,8 @@ A timeseries array Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | [**[LogsAggregateBucketValueTimeseriesPoint]**](LogsAggregateBucketValueTimeseriesPoint.md) | A timeseries array | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateBucketValueTimeseriesPoint.md b/docs/v2/LogsAggregateBucketValueTimeseriesPoint.md index 9b99fb9b43..60ddfd50b4 100644 --- a/docs/v2/LogsAggregateBucketValueTimeseriesPoint.md +++ b/docs/v2/LogsAggregateBucketValueTimeseriesPoint.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time** | **str** | The time value for this point | [optional] **value** | **float** | The value for this point | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateRequest.md b/docs/v2/LogsAggregateRequest.md index 3e24ab6063..270a1d0425 100644 --- a/docs/v2/LogsAggregateRequest.md +++ b/docs/v2/LogsAggregateRequest.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **group_by** | [**[LogsGroupBy]**](LogsGroupBy.md) | The rules for the group by | [optional] **options** | [**LogsQueryOptions**](LogsQueryOptions.md) | | [optional] **page** | [**LogsAggregateRequestPage**](LogsAggregateRequestPage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateRequestPage.md b/docs/v2/LogsAggregateRequestPage.md index 7aee59a5e5..d1f0327779 100644 --- a/docs/v2/LogsAggregateRequestPage.md +++ b/docs/v2/LogsAggregateRequestPage.md @@ -6,7 +6,8 @@ Paging settings Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | **str** | The returned paging point to use to get the next results | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateResponse.md b/docs/v2/LogsAggregateResponse.md index 116d5997c9..aec330c3cd 100644 --- a/docs/v2/LogsAggregateResponse.md +++ b/docs/v2/LogsAggregateResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsAggregateResponseData**](LogsAggregateResponseData.md) | | [optional] **meta** | [**LogsResponseMetadata**](LogsResponseMetadata.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateResponseData.md b/docs/v2/LogsAggregateResponseData.md index 549dd3b2bd..8450f1b454 100644 --- a/docs/v2/LogsAggregateResponseData.md +++ b/docs/v2/LogsAggregateResponseData.md @@ -6,7 +6,8 @@ The query results Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **buckets** | [**[LogsAggregateBucket]**](LogsAggregateBucket.md) | The list of matching buckets, one item per bucket | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateResponseStatus.md b/docs/v2/LogsAggregateResponseStatus.md index ba40980463..fa26588fc2 100644 --- a/docs/v2/LogsAggregateResponseStatus.md +++ b/docs/v2/LogsAggregateResponseStatus.md @@ -6,7 +6,8 @@ The status of the response Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The status of the response | must be one of ["done", "timeout", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateSort.md b/docs/v2/LogsAggregateSort.md index cca2b352ea..f9f0d46503 100644 --- a/docs/v2/LogsAggregateSort.md +++ b/docs/v2/LogsAggregateSort.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **metric** | **str** | The metric to sort by (only used for `type=measure`) | [optional] **order** | [**LogsSortOrder**](LogsSortOrder.md) | | [optional] **type** | [**LogsAggregateSortType**](LogsAggregateSortType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregateSortType.md b/docs/v2/LogsAggregateSortType.md index 04efb36fe9..6277b659bb 100644 --- a/docs/v2/LogsAggregateSortType.md +++ b/docs/v2/LogsAggregateSortType.md @@ -6,7 +6,8 @@ The type of sorting algorithm Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of sorting algorithm | defaults to "alphabetical", must be one of ["alphabetical", "measure", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsAggregationFunction.md b/docs/v2/LogsAggregationFunction.md index 41cca5594f..3840588933 100644 --- a/docs/v2/LogsAggregationFunction.md +++ b/docs/v2/LogsAggregationFunction.md @@ -6,7 +6,8 @@ An aggregation function Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | An aggregation function | must be one of ["count", "cardinality", "pc75", "pc90", "pc95", "pc98", "pc99", "sum", "min", "max", "avg", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchive.md b/docs/v2/LogsArchive.md index 6f71e86922..99bfd1e740 100644 --- a/docs/v2/LogsArchive.md +++ b/docs/v2/LogsArchive.md @@ -6,7 +6,8 @@ The logs archive. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsArchiveDefinition**](LogsArchiveDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveAttributes.md b/docs/v2/LogsArchiveAttributes.md index 408901489c..5c157a7451 100644 --- a/docs/v2/LogsArchiveAttributes.md +++ b/docs/v2/LogsArchiveAttributes.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **include_tags** | **bool** | To store the tags in the archive, set the value \"true\". If it is set to \"false\", the tags will be deleted when the logs are sent to the archive. | [optional] if omitted the server will use the default value of False **rehydration_tags** | **[str]** | An array of tags to add to rehydrated logs from an archive. | [optional] **state** | [**LogsArchiveState**](LogsArchiveState.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveCreateRequest.md b/docs/v2/LogsArchiveCreateRequest.md index 84a199cfe0..3b30472887 100644 --- a/docs/v2/LogsArchiveCreateRequest.md +++ b/docs/v2/LogsArchiveCreateRequest.md @@ -6,7 +6,8 @@ The logs archive. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsArchiveCreateRequestDefinition**](LogsArchiveCreateRequestDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveCreateRequestAttributes.md b/docs/v2/LogsArchiveCreateRequestAttributes.md index 26654b2b6e..9f46753f73 100644 --- a/docs/v2/LogsArchiveCreateRequestAttributes.md +++ b/docs/v2/LogsArchiveCreateRequestAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **query** | **str** | The archive query/filter. Logs matching this query are included in the archive. | **include_tags** | **bool** | To store the tags in the archive, set the value \"true\". If it is set to \"false\", the tags will be deleted when the logs are sent to the archive. | [optional] if omitted the server will use the default value of False **rehydration_tags** | **[str]** | An array of tags to add to rehydrated logs from an archive. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveCreateRequestDefinition.md b/docs/v2/LogsArchiveCreateRequestDefinition.md index bea71231f6..45770a7a6e 100644 --- a/docs/v2/LogsArchiveCreateRequestDefinition.md +++ b/docs/v2/LogsArchiveCreateRequestDefinition.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | The type of the resource. The value should always be archives. | defaults to "archives" **attributes** | [**LogsArchiveCreateRequestAttributes**](LogsArchiveCreateRequestAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveCreateRequestDestination.md b/docs/v2/LogsArchiveCreateRequestDestination.md index 43e7cddedc..45caa159df 100644 --- a/docs/v2/LogsArchiveCreateRequestDestination.md +++ b/docs/v2/LogsArchiveCreateRequestDestination.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **LogsArchiveDestinationGCS** | [**LogsArchiveDestinationGCS**](LogsArchiveDestinationGCS.md) | Container class of the relevant properties. | **LogsArchiveDestinationS3** | [**LogsArchiveDestinationS3**](LogsArchiveDestinationS3.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDefinition.md b/docs/v2/LogsArchiveDefinition.md index dd1d5d3e36..130048db28 100644 --- a/docs/v2/LogsArchiveDefinition.md +++ b/docs/v2/LogsArchiveDefinition.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **type** | **str** | The type of the resource. The value should always be archives. | [readonly] defaults to "archives" **attributes** | [**LogsArchiveAttributes**](LogsArchiveAttributes.md) | | [optional] **id** | **str** | The archive ID. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestination.md b/docs/v2/LogsArchiveDestination.md index 5e22aa83a6..06b62eb2f4 100644 --- a/docs/v2/LogsArchiveDestination.md +++ b/docs/v2/LogsArchiveDestination.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **LogsArchiveDestinationGCS** | [**LogsArchiveDestinationGCS**](LogsArchiveDestinationGCS.md) | Container class of the relevant properties. | **LogsArchiveDestinationS3** | [**LogsArchiveDestinationS3**](LogsArchiveDestinationS3.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestinationAzure.md b/docs/v2/LogsArchiveDestinationAzure.md index 3d1835ca29..48bb77aca3 100644 --- a/docs/v2/LogsArchiveDestinationAzure.md +++ b/docs/v2/LogsArchiveDestinationAzure.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **type** | [**LogsArchiveDestinationAzureType**](LogsArchiveDestinationAzureType.md) | | **path** | **str** | The archive path. | [optional] **region** | **str** | The region where the archive will be stored. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestinationAzureType.md b/docs/v2/LogsArchiveDestinationAzureType.md index 9ad8de780f..7084e0e7c6 100644 --- a/docs/v2/LogsArchiveDestinationAzureType.md +++ b/docs/v2/LogsArchiveDestinationAzureType.md @@ -6,7 +6,8 @@ Type of the Azure archive destination. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the Azure archive destination. | defaults to "azure", must be one of ["azure", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestinationGCS.md b/docs/v2/LogsArchiveDestinationGCS.md index 8445ffc388..d93617d12a 100644 --- a/docs/v2/LogsArchiveDestinationGCS.md +++ b/docs/v2/LogsArchiveDestinationGCS.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **integration** | [**LogsArchiveIntegrationGCS**](LogsArchiveIntegrationGCS.md) | | **type** | [**LogsArchiveDestinationGCSType**](LogsArchiveDestinationGCSType.md) | | **path** | **str** | The archive path. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestinationGCSType.md b/docs/v2/LogsArchiveDestinationGCSType.md index 4e407f9b91..1ed415e47a 100644 --- a/docs/v2/LogsArchiveDestinationGCSType.md +++ b/docs/v2/LogsArchiveDestinationGCSType.md @@ -6,7 +6,8 @@ Type of the GCS archive destination. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the GCS archive destination. | defaults to "gcs", must be one of ["gcs", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestinationS3.md b/docs/v2/LogsArchiveDestinationS3.md index 7c196afd4d..26be6098a0 100644 --- a/docs/v2/LogsArchiveDestinationS3.md +++ b/docs/v2/LogsArchiveDestinationS3.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **integration** | [**LogsArchiveIntegrationS3**](LogsArchiveIntegrationS3.md) | | **type** | [**LogsArchiveDestinationS3Type**](LogsArchiveDestinationS3Type.md) | | **path** | **str** | The archive path. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveDestinationS3Type.md b/docs/v2/LogsArchiveDestinationS3Type.md index 3921b20e52..58c767c65c 100644 --- a/docs/v2/LogsArchiveDestinationS3Type.md +++ b/docs/v2/LogsArchiveDestinationS3Type.md @@ -6,7 +6,8 @@ Type of the S3 archive destination. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the S3 archive destination. | defaults to "s3", must be one of ["s3", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveIntegrationAzure.md b/docs/v2/LogsArchiveIntegrationAzure.md index fd262b5405..8edfaff4ad 100644 --- a/docs/v2/LogsArchiveIntegrationAzure.md +++ b/docs/v2/LogsArchiveIntegrationAzure.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client_id** | **str** | A client ID. | **tenant_id** | **str** | A tenant ID. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveIntegrationGCS.md b/docs/v2/LogsArchiveIntegrationGCS.md index 0e197d72d6..3fcd7d2213 100644 --- a/docs/v2/LogsArchiveIntegrationGCS.md +++ b/docs/v2/LogsArchiveIntegrationGCS.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **client_email** | **str** | A client email. | **project_id** | **str** | A project ID. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveIntegrationS3.md b/docs/v2/LogsArchiveIntegrationS3.md index 8eb69695d6..dfeb65a410 100644 --- a/docs/v2/LogsArchiveIntegrationS3.md +++ b/docs/v2/LogsArchiveIntegrationS3.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **account_id** | **str** | The account ID for the integration. | **role_name** | **str** | The path of the integration. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveOrder.md b/docs/v2/LogsArchiveOrder.md index 7b55b1402f..225a1bfc25 100644 --- a/docs/v2/LogsArchiveOrder.md +++ b/docs/v2/LogsArchiveOrder.md @@ -6,7 +6,8 @@ A ordered list of archive IDs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsArchiveOrderDefinition**](LogsArchiveOrderDefinition.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveOrderAttributes.md b/docs/v2/LogsArchiveOrderAttributes.md index ff119a4a92..71d23d38e0 100644 --- a/docs/v2/LogsArchiveOrderAttributes.md +++ b/docs/v2/LogsArchiveOrderAttributes.md @@ -6,7 +6,8 @@ The attributes associated with the archive order. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **archive_ids** | **[str]** | An ordered array of `<ARCHIVE_ID>` strings, the order of archive IDs in the array define the overall archives order for Datadog. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveOrderDefinition.md b/docs/v2/LogsArchiveOrderDefinition.md index 191106e2a8..398e70d40e 100644 --- a/docs/v2/LogsArchiveOrderDefinition.md +++ b/docs/v2/LogsArchiveOrderDefinition.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**LogsArchiveOrderAttributes**](LogsArchiveOrderAttributes.md) | | **type** | [**LogsArchiveOrderDefinitionType**](LogsArchiveOrderDefinitionType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveOrderDefinitionType.md b/docs/v2/LogsArchiveOrderDefinitionType.md index e8eb465233..b4e4c47a60 100644 --- a/docs/v2/LogsArchiveOrderDefinitionType.md +++ b/docs/v2/LogsArchiveOrderDefinitionType.md @@ -6,7 +6,8 @@ Type of the archive order definition. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of the archive order definition. | defaults to "archive_order", must be one of ["archive_order", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchiveState.md b/docs/v2/LogsArchiveState.md index 52f7f350f1..0351afe7b2 100644 --- a/docs/v2/LogsArchiveState.md +++ b/docs/v2/LogsArchiveState.md @@ -6,7 +6,8 @@ The state of the archive. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The state of the archive. | must be one of ["UNKNOWN", "WORKING", "FAILING", "WORKING_AUTH_LEGACY", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsArchives.md b/docs/v2/LogsArchives.md index 9909bd74c5..dd11e17c96 100644 --- a/docs/v2/LogsArchives.md +++ b/docs/v2/LogsArchives.md @@ -6,7 +6,8 @@ The available archives. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[LogsArchiveDefinition]**](LogsArchiveDefinition.md) | A list of archives. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsCompute.md b/docs/v2/LogsCompute.md index 891b958017..7a43fd31a2 100644 --- a/docs/v2/LogsCompute.md +++ b/docs/v2/LogsCompute.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **interval** | **str** | The time buckets' size (only used for type=timeseries) Defaults to a resolution of 150 points | [optional] **metric** | **str** | The metric to use | [optional] **type** | [**LogsComputeType**](LogsComputeType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsComputeType.md b/docs/v2/LogsComputeType.md index 1ed39702fc..43ef8a349e 100644 --- a/docs/v2/LogsComputeType.md +++ b/docs/v2/LogsComputeType.md @@ -6,7 +6,8 @@ The type of compute Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of compute | defaults to "total", must be one of ["timeseries", "total", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsGroupBy.md b/docs/v2/LogsGroupBy.md index 0b9e84283a..aac6ce89ff 100644 --- a/docs/v2/LogsGroupBy.md +++ b/docs/v2/LogsGroupBy.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **missing** | [**LogsGroupByMissing**](LogsGroupByMissing.md) | | [optional] **sort** | [**LogsAggregateSort**](LogsAggregateSort.md) | | [optional] **total** | [**LogsGroupByTotal**](LogsGroupByTotal.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsGroupByHistogram.md b/docs/v2/LogsGroupByHistogram.md index 805c97c912..62e3e045c8 100644 --- a/docs/v2/LogsGroupByHistogram.md +++ b/docs/v2/LogsGroupByHistogram.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **interval** | **float** | The bin size of the histogram buckets | **max** | **float** | The maximum value for the measure used in the histogram (values greater than this one are filtered out) | **min** | **float** | The minimum value for the measure used in the histogram (values smaller than this one are filtered out) | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsGroupByMissing.md b/docs/v2/LogsGroupByMissing.md index 20f93e1ca9..86c5f19661 100644 --- a/docs/v2/LogsGroupByMissing.md +++ b/docs/v2/LogsGroupByMissing.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **float** | [**float**](float.md) | Container class of the relevant properties. | **str** | [**str**](str.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsGroupByTotal.md b/docs/v2/LogsGroupByTotal.md index 2bfeb934f7..6efbc5a82a 100644 --- a/docs/v2/LogsGroupByTotal.md +++ b/docs/v2/LogsGroupByTotal.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **float** | [**float**](float.md) | Container class of the relevant properties. | **str** | [**str**](str.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsListRequest.md b/docs/v2/LogsListRequest.md index cd5e816bbf..ccbb9d285b 100644 --- a/docs/v2/LogsListRequest.md +++ b/docs/v2/LogsListRequest.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **options** | [**LogsQueryOptions**](LogsQueryOptions.md) | | [optional] **page** | [**LogsListRequestPage**](LogsListRequestPage.md) | | [optional] **sort** | [**LogsSort**](LogsSort.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsListRequestPage.md b/docs/v2/LogsListRequestPage.md index 5319446f7f..f91c2d37e8 100644 --- a/docs/v2/LogsListRequestPage.md +++ b/docs/v2/LogsListRequestPage.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | **str** | List following results with a cursor provided in the previous query. | [optional] **limit** | **int** | Maximum number of logs in the response. | [optional] if omitted the server will use the default value of 10 +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsListResponse.md b/docs/v2/LogsListResponse.md index 288828237f..9c50da8200 100644 --- a/docs/v2/LogsListResponse.md +++ b/docs/v2/LogsListResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[Log]**](Log.md) | Array of logs matching the request. | [optional] **links** | [**LogsListResponseLinks**](LogsListResponseLinks.md) | | [optional] **meta** | [**LogsResponseMetadata**](LogsResponseMetadata.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsListResponseLinks.md b/docs/v2/LogsListResponseLinks.md index 41aa141d63..a7494daef9 100644 --- a/docs/v2/LogsListResponseLinks.md +++ b/docs/v2/LogsListResponseLinks.md @@ -6,7 +6,8 @@ Links attributes. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **next** | **str** | Link for the next set of results. Note that the request can also be made using the POST endpoint. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricCompute.md b/docs/v2/LogsMetricCompute.md index db436888db..aa33ee4fd4 100644 --- a/docs/v2/LogsMetricCompute.md +++ b/docs/v2/LogsMetricCompute.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **aggregation_type** | [**LogsMetricComputeAggregationType**](LogsMetricComputeAggregationType.md) | | **path** | **str** | The path to the value the log-based metric will aggregate on (only used if the aggregation type is a \"distribution\"). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricComputeAggregationType.md b/docs/v2/LogsMetricComputeAggregationType.md index dcab3f0b36..dc99f054c5 100644 --- a/docs/v2/LogsMetricComputeAggregationType.md +++ b/docs/v2/LogsMetricComputeAggregationType.md @@ -6,7 +6,8 @@ The type of aggregation to use. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of aggregation to use. | must be one of ["count", "distribution", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricCreateAttributes.md b/docs/v2/LogsMetricCreateAttributes.md index c2762f30cc..1012327756 100644 --- a/docs/v2/LogsMetricCreateAttributes.md +++ b/docs/v2/LogsMetricCreateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **compute** | [**LogsMetricCompute**](LogsMetricCompute.md) | | **filter** | [**LogsMetricFilter**](LogsMetricFilter.md) | | [optional] **group_by** | [**[LogsMetricGroupBy]**](LogsMetricGroupBy.md) | The rules for the group by. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricCreateData.md b/docs/v2/LogsMetricCreateData.md index dc6c94cd6c..8df3d8ad0a 100644 --- a/docs/v2/LogsMetricCreateData.md +++ b/docs/v2/LogsMetricCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**LogsMetricCreateAttributes**](LogsMetricCreateAttributes.md) | | **id** | **str** | The name of the log-based metric. | **type** | [**LogsMetricType**](LogsMetricType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricCreateRequest.md b/docs/v2/LogsMetricCreateRequest.md index 5c04aa5144..3601ea247f 100644 --- a/docs/v2/LogsMetricCreateRequest.md +++ b/docs/v2/LogsMetricCreateRequest.md @@ -6,7 +6,8 @@ The new log-based metric body. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsMetricCreateData**](LogsMetricCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricFilter.md b/docs/v2/LogsMetricFilter.md index f6821230dc..959e6ac812 100644 --- a/docs/v2/LogsMetricFilter.md +++ b/docs/v2/LogsMetricFilter.md @@ -6,7 +6,8 @@ The log-based metric filter. Logs matching this filter will be aggregated in thi Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **query** | **str** | The search query - following the log search syntax. | [optional] if omitted the server will use the default value of "*" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricGroupBy.md b/docs/v2/LogsMetricGroupBy.md index c64a42b93a..b084a26e81 100644 --- a/docs/v2/LogsMetricGroupBy.md +++ b/docs/v2/LogsMetricGroupBy.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **path** | **str** | The path to the value the log-based metric will be aggregated over. | **tag_name** | **str** | Eventual name of the tag that gets created. By default, the path attribute is used as the tag name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponse.md b/docs/v2/LogsMetricResponse.md index 7141c9f71a..eec66a537e 100644 --- a/docs/v2/LogsMetricResponse.md +++ b/docs/v2/LogsMetricResponse.md @@ -6,7 +6,8 @@ The log-based metric object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsMetricResponseData**](LogsMetricResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponseAttributes.md b/docs/v2/LogsMetricResponseAttributes.md index e80a0608bf..e90a051527 100644 --- a/docs/v2/LogsMetricResponseAttributes.md +++ b/docs/v2/LogsMetricResponseAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **compute** | [**LogsMetricResponseCompute**](LogsMetricResponseCompute.md) | | [optional] **filter** | [**LogsMetricResponseFilter**](LogsMetricResponseFilter.md) | | [optional] **group_by** | [**[LogsMetricResponseGroupBy]**](LogsMetricResponseGroupBy.md) | The rules for the group by. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponseCompute.md b/docs/v2/LogsMetricResponseCompute.md index d3aea0d17e..56e21e5271 100644 --- a/docs/v2/LogsMetricResponseCompute.md +++ b/docs/v2/LogsMetricResponseCompute.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **aggregation_type** | [**LogsMetricResponseComputeAggregationType**](LogsMetricResponseComputeAggregationType.md) | | [optional] **path** | **str** | The path to the value the log-based metric will aggregate on (only used if the aggregation type is a \"distribution\"). | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponseComputeAggregationType.md b/docs/v2/LogsMetricResponseComputeAggregationType.md index d1ecad5918..1e7df4fd87 100644 --- a/docs/v2/LogsMetricResponseComputeAggregationType.md +++ b/docs/v2/LogsMetricResponseComputeAggregationType.md @@ -6,7 +6,8 @@ The type of aggregation to use. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of aggregation to use. | must be one of ["count", "distribution", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponseData.md b/docs/v2/LogsMetricResponseData.md index a445940fb9..3e5f3455da 100644 --- a/docs/v2/LogsMetricResponseData.md +++ b/docs/v2/LogsMetricResponseData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**LogsMetricResponseAttributes**](LogsMetricResponseAttributes.md) | | [optional] **id** | **str** | The name of the log-based metric. | [optional] **type** | [**LogsMetricType**](LogsMetricType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponseFilter.md b/docs/v2/LogsMetricResponseFilter.md index 6abc761b35..602ffefbbd 100644 --- a/docs/v2/LogsMetricResponseFilter.md +++ b/docs/v2/LogsMetricResponseFilter.md @@ -6,7 +6,8 @@ The log-based metric filter. Logs matching this filter will be aggregated in thi Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **query** | **str** | The search query - following the log search syntax. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricResponseGroupBy.md b/docs/v2/LogsMetricResponseGroupBy.md index cd427049fa..4d354fe2c6 100644 --- a/docs/v2/LogsMetricResponseGroupBy.md +++ b/docs/v2/LogsMetricResponseGroupBy.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **path** | **str** | The path to the value the log-based metric will be aggregated over. | [optional] **tag_name** | **str** | Eventual name of the tag that gets created. By default, the path attribute is used as the tag name. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricType.md b/docs/v2/LogsMetricType.md index 9a38faa577..58658867fc 100644 --- a/docs/v2/LogsMetricType.md +++ b/docs/v2/LogsMetricType.md @@ -6,7 +6,8 @@ The type of the resource. The value should always be logs_metrics. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of the resource. The value should always be logs_metrics. | defaults to "logs_metrics", must be one of ["logs_metrics", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricUpdateAttributes.md b/docs/v2/LogsMetricUpdateAttributes.md index 35acf2a2d5..97ccb6d1f5 100644 --- a/docs/v2/LogsMetricUpdateAttributes.md +++ b/docs/v2/LogsMetricUpdateAttributes.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **filter** | [**LogsMetricFilter**](LogsMetricFilter.md) | | [optional] **group_by** | [**[LogsMetricGroupBy]**](LogsMetricGroupBy.md) | The rules for the group by. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricUpdateData.md b/docs/v2/LogsMetricUpdateData.md index 2b1a81ec81..99d8e7843c 100644 --- a/docs/v2/LogsMetricUpdateData.md +++ b/docs/v2/LogsMetricUpdateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**LogsMetricUpdateAttributes**](LogsMetricUpdateAttributes.md) | | **type** | [**LogsMetricType**](LogsMetricType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricUpdateRequest.md b/docs/v2/LogsMetricUpdateRequest.md index 6502c7c26b..317222211c 100644 --- a/docs/v2/LogsMetricUpdateRequest.md +++ b/docs/v2/LogsMetricUpdateRequest.md @@ -6,7 +6,8 @@ The new log-based metric body. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**LogsMetricUpdateData**](LogsMetricUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsMetricsResponse.md b/docs/v2/LogsMetricsResponse.md index b936bbf8d1..64d88498c1 100644 --- a/docs/v2/LogsMetricsResponse.md +++ b/docs/v2/LogsMetricsResponse.md @@ -6,7 +6,8 @@ All the available log-based metric objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[LogsMetricResponseData]**](LogsMetricResponseData.md) | A list of log-based metric objects. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsQueryFilter.md b/docs/v2/LogsQueryFilter.md index 41da7f1724..75c132d914 100644 --- a/docs/v2/LogsQueryFilter.md +++ b/docs/v2/LogsQueryFilter.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **indexes** | **[str]** | For customers with multiple indexes, the indexes to search. Defaults to ['*'] which means all indexes. | [optional] if omitted the server will use the default value of ["*"] **query** | **str** | The search query - following the log search syntax. | [optional] if omitted the server will use the default value of "*" **to** | **str** | The maximum time for the requested logs, supports date math and regular timestamps | [optional] if omitted the server will use the default value of "now" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsQueryOptions.md b/docs/v2/LogsQueryOptions.md index 4670fbfb68..38ed15eec2 100644 --- a/docs/v2/LogsQueryOptions.md +++ b/docs/v2/LogsQueryOptions.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **time_offset** | **int** | The time offset (in seconds) to apply to the query. | [optional] **timezone** | **str** | The timezone can be specified both as an offset, for example: \"UTC+03:00\". | [optional] if omitted the server will use the default value of "UTC" +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsResponseMetadata.md b/docs/v2/LogsResponseMetadata.md index eff49f7fcd..7f74409be9 100644 --- a/docs/v2/LogsResponseMetadata.md +++ b/docs/v2/LogsResponseMetadata.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **request_id** | **str** | The identifier of the request | [optional] **status** | [**LogsAggregateResponseStatus**](LogsAggregateResponseStatus.md) | | [optional] **warnings** | [**[LogsWarning]**](LogsWarning.md) | A list of warnings (non fatal errors) encountered, partial results might be returned if warnings are present in the response. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsResponseMetadataPage.md b/docs/v2/LogsResponseMetadataPage.md index 6fea739b53..11ed5eb94f 100644 --- a/docs/v2/LogsResponseMetadataPage.md +++ b/docs/v2/LogsResponseMetadataPage.md @@ -6,7 +6,8 @@ Paging attributes. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **after** | **str** | The cursor to use to get the next results, if any. To make the next request, use the same. parameters with the addition of the `page[cursor]`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsSort.md b/docs/v2/LogsSort.md index d034ef1f67..a5e780b053 100644 --- a/docs/v2/LogsSort.md +++ b/docs/v2/LogsSort.md @@ -6,7 +6,8 @@ Sort parameters when querying logs. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Sort parameters when querying logs. | must be one of ["timestamp", "-timestamp", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsSortOrder.md b/docs/v2/LogsSortOrder.md index 765e617fa0..2819b49fc6 100644 --- a/docs/v2/LogsSortOrder.md +++ b/docs/v2/LogsSortOrder.md @@ -6,7 +6,8 @@ The order to use, ascending or descending Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The order to use, ascending or descending | must be one of ["asc", "desc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/LogsWarning.md b/docs/v2/LogsWarning.md index c026c2c362..aa065d8b67 100644 --- a/docs/v2/LogsWarning.md +++ b/docs/v2/LogsWarning.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **code** | **str** | A unique code for this type of warning | [optional] **detail** | **str** | A detailed explanation of this specific warning | [optional] **title** | **str** | A short human-readable summary of the warning | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Metric.md b/docs/v2/Metric.md index e5bedd255f..cbb260b80f 100644 --- a/docs/v2/Metric.md +++ b/docs/v2/Metric.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The metric name for this resource. | [optional] **type** | [**MetricType**](MetricType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricAllTags.md b/docs/v2/MetricAllTags.md index 5f10a1416c..e9dd31b848 100644 --- a/docs/v2/MetricAllTags.md +++ b/docs/v2/MetricAllTags.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**MetricAllTagsAttributes**](MetricAllTagsAttributes.md) | | [optional] **id** | **str** | The metric name for this resource. | [optional] **type** | [**MetricType**](MetricType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricAllTagsAttributes.md b/docs/v2/MetricAllTagsAttributes.md index 43c560a471..c200f771be 100644 --- a/docs/v2/MetricAllTagsAttributes.md +++ b/docs/v2/MetricAllTagsAttributes.md @@ -6,7 +6,8 @@ Object containing the definition of a metric's tags. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **tags** | **[str]** | List of indexed tag value pairs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricAllTagsResponse.md b/docs/v2/MetricAllTagsResponse.md index 0010e6e8e9..8e6374e8d7 100644 --- a/docs/v2/MetricAllTagsResponse.md +++ b/docs/v2/MetricAllTagsResponse.md @@ -6,7 +6,8 @@ Response object that includes a single metric's indexed tags. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**MetricAllTags**](MetricAllTags.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricDistinctVolume.md b/docs/v2/MetricDistinctVolume.md index da426faf5b..08fa84472e 100644 --- a/docs/v2/MetricDistinctVolume.md +++ b/docs/v2/MetricDistinctVolume.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**MetricDistinctVolumeAttributes**](MetricDistinctVolumeAttributes.md) | | [optional] **id** | **str** | The metric name for this resource. | [optional] **type** | [**MetricDistinctVolumeType**](MetricDistinctVolumeType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricDistinctVolumeAttributes.md b/docs/v2/MetricDistinctVolumeAttributes.md index 9b6a15c75d..280e86ac46 100644 --- a/docs/v2/MetricDistinctVolumeAttributes.md +++ b/docs/v2/MetricDistinctVolumeAttributes.md @@ -6,7 +6,8 @@ Object containing the definition of a metric's distinct volume. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **distinct_volume** | **int** | Distinct volume for the given metric. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricDistinctVolumeType.md b/docs/v2/MetricDistinctVolumeType.md index c293046e68..3e079266ad 100644 --- a/docs/v2/MetricDistinctVolumeType.md +++ b/docs/v2/MetricDistinctVolumeType.md @@ -6,7 +6,8 @@ The metric distinct volume type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The metric distinct volume type. | defaults to "distinct_metric_volumes", must be one of ["distinct_metric_volumes", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricIngestedIndexedVolume.md b/docs/v2/MetricIngestedIndexedVolume.md index 3b05c5194b..ce7724acbe 100644 --- a/docs/v2/MetricIngestedIndexedVolume.md +++ b/docs/v2/MetricIngestedIndexedVolume.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**MetricIngestedIndexedVolumeAttributes**](MetricIngestedIndexedVolumeAttributes.md) | | [optional] **id** | **str** | The metric name for this resource. | [optional] **type** | [**MetricIngestedIndexedVolumeType**](MetricIngestedIndexedVolumeType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricIngestedIndexedVolumeAttributes.md b/docs/v2/MetricIngestedIndexedVolumeAttributes.md index b250575069..ecb53898a0 100644 --- a/docs/v2/MetricIngestedIndexedVolumeAttributes.md +++ b/docs/v2/MetricIngestedIndexedVolumeAttributes.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **indexed_volume** | **int** | Indexed volume for the given metric. | [optional] **ingested_volume** | **int** | Ingested volume for the given metric. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricIngestedIndexedVolumeType.md b/docs/v2/MetricIngestedIndexedVolumeType.md index 275bfebe59..fd7a9c698c 100644 --- a/docs/v2/MetricIngestedIndexedVolumeType.md +++ b/docs/v2/MetricIngestedIndexedVolumeType.md @@ -6,7 +6,8 @@ The metric ingested and indexed volume type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The metric ingested and indexed volume type. | defaults to "metric_volumes", must be one of ["metric_volumes", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfiguration.md b/docs/v2/MetricTagConfiguration.md index 9bb01dc9c9..d9929611a4 100644 --- a/docs/v2/MetricTagConfiguration.md +++ b/docs/v2/MetricTagConfiguration.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**MetricTagConfigurationAttributes**](MetricTagConfigurationAttributes.md) | | [optional] **id** | **str** | The metric name for this resource. | [optional] **type** | [**MetricTagConfigurationType**](MetricTagConfigurationType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationAttributes.md b/docs/v2/MetricTagConfigurationAttributes.md index ac361fafa4..75cc20e9b6 100644 --- a/docs/v2/MetricTagConfigurationAttributes.md +++ b/docs/v2/MetricTagConfigurationAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **metric_type** | [**MetricTagConfigurationMetricTypes**](MetricTagConfigurationMetricTypes.md) | | [optional] **modified_at** | **datetime** | Timestamp when the tag configuration was last modified. | [optional] **tags** | **[str]** | List of tag keys on which to group. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationCreateAttributes.md b/docs/v2/MetricTagConfigurationCreateAttributes.md index 05b5a4aea8..8cd4758860 100644 --- a/docs/v2/MetricTagConfigurationCreateAttributes.md +++ b/docs/v2/MetricTagConfigurationCreateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **metric_type** | [**MetricTagConfigurationMetricTypes**](MetricTagConfigurationMetricTypes.md) | | **tags** | **[str]** | A list of tag keys that will be queryable for your metric. | defaults to [] **include_percentiles** | **bool** | Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a `metric_type` of `distribution`. | [optional] if omitted the server will use the default value of False +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationCreateData.md b/docs/v2/MetricTagConfigurationCreateData.md index ea9202df0b..93708d44a1 100644 --- a/docs/v2/MetricTagConfigurationCreateData.md +++ b/docs/v2/MetricTagConfigurationCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **id** | **str** | The metric name for this resource. | **type** | [**MetricTagConfigurationType**](MetricTagConfigurationType.md) | | **attributes** | [**MetricTagConfigurationCreateAttributes**](MetricTagConfigurationCreateAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationCreateRequest.md b/docs/v2/MetricTagConfigurationCreateRequest.md index b9749a8610..7f50cb2f10 100644 --- a/docs/v2/MetricTagConfigurationCreateRequest.md +++ b/docs/v2/MetricTagConfigurationCreateRequest.md @@ -6,7 +6,8 @@ Request object that includes the metric that you would like to configure tags fo Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**MetricTagConfigurationCreateData**](MetricTagConfigurationCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationMetricTypes.md b/docs/v2/MetricTagConfigurationMetricTypes.md index a2bebdc65f..f5194413d4 100644 --- a/docs/v2/MetricTagConfigurationMetricTypes.md +++ b/docs/v2/MetricTagConfigurationMetricTypes.md @@ -6,7 +6,8 @@ The metric's type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The metric's type. | defaults to "gauge", must be one of ["gauge", "count", "rate", "distribution", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationResponse.md b/docs/v2/MetricTagConfigurationResponse.md index d544244656..c177aaaa3f 100644 --- a/docs/v2/MetricTagConfigurationResponse.md +++ b/docs/v2/MetricTagConfigurationResponse.md @@ -6,7 +6,8 @@ Response object which includes a single metric's tag configuration. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**MetricTagConfiguration**](MetricTagConfiguration.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationType.md b/docs/v2/MetricTagConfigurationType.md index 33e0d67e72..9234664ecc 100644 --- a/docs/v2/MetricTagConfigurationType.md +++ b/docs/v2/MetricTagConfigurationType.md @@ -6,7 +6,8 @@ The metric tag configuration resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The metric tag configuration resource type. | defaults to "manage_tags", must be one of ["manage_tags", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationUpdateAttributes.md b/docs/v2/MetricTagConfigurationUpdateAttributes.md index 48eec6f873..6c77aa82c4 100644 --- a/docs/v2/MetricTagConfigurationUpdateAttributes.md +++ b/docs/v2/MetricTagConfigurationUpdateAttributes.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **include_percentiles** | **bool** | Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a `metric_type` of `distribution`. | [optional] if omitted the server will use the default value of False **tags** | **[str]** | A list of tag keys that will be queryable for your metric. | [optional] if omitted the server will use the default value of [] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationUpdateData.md b/docs/v2/MetricTagConfigurationUpdateData.md index fd9f736566..afe2bb8a48 100644 --- a/docs/v2/MetricTagConfigurationUpdateData.md +++ b/docs/v2/MetricTagConfigurationUpdateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **id** | **str** | The metric name for this resource. | **type** | [**MetricTagConfigurationType**](MetricTagConfigurationType.md) | | **attributes** | [**MetricTagConfigurationUpdateAttributes**](MetricTagConfigurationUpdateAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricTagConfigurationUpdateRequest.md b/docs/v2/MetricTagConfigurationUpdateRequest.md index 10d1558c28..271fcb655b 100644 --- a/docs/v2/MetricTagConfigurationUpdateRequest.md +++ b/docs/v2/MetricTagConfigurationUpdateRequest.md @@ -6,7 +6,8 @@ Request object that includes the metric that you would like to edit the tag conf Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**MetricTagConfigurationUpdateData**](MetricTagConfigurationUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricType.md b/docs/v2/MetricType.md index 1ca5d8afa5..b91e786f3d 100644 --- a/docs/v2/MetricType.md +++ b/docs/v2/MetricType.md @@ -6,7 +6,8 @@ The metric resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The metric resource type. | defaults to "metrics", must be one of ["metrics", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricVolumes.md b/docs/v2/MetricVolumes.md index 66c44b4336..75bb617680 100644 --- a/docs/v2/MetricVolumes.md +++ b/docs/v2/MetricVolumes.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **MetricDistinctVolume** | [**MetricDistinctVolume**](MetricDistinctVolume.md) | Container class of the relevant properties. | **MetricIngestedIndexedVolume** | [**MetricIngestedIndexedVolume**](MetricIngestedIndexedVolume.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricVolumesResponse.md b/docs/v2/MetricVolumesResponse.md index 2169a885c0..4429c000cc 100644 --- a/docs/v2/MetricVolumesResponse.md +++ b/docs/v2/MetricVolumesResponse.md @@ -6,7 +6,8 @@ Response object which includes a single metric's volume. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**MetricVolumes**](MetricVolumes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricsAndMetricTagConfigurations.md b/docs/v2/MetricsAndMetricTagConfigurations.md index 5da4c9bd30..8f535f2672 100644 --- a/docs/v2/MetricsAndMetricTagConfigurations.md +++ b/docs/v2/MetricsAndMetricTagConfigurations.md @@ -8,6 +8,6 @@ Name | Type | Description | Notes **Metric** | [**Metric**](Metric.md) | Container class of the relevant properties. | **MetricTagConfiguration** | [**MetricTagConfiguration**](MetricTagConfiguration.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/MetricsAndMetricTagConfigurationsResponse.md b/docs/v2/MetricsAndMetricTagConfigurationsResponse.md index f47a2d04b1..ee97047d02 100644 --- a/docs/v2/MetricsAndMetricTagConfigurationsResponse.md +++ b/docs/v2/MetricsAndMetricTagConfigurationsResponse.md @@ -6,7 +6,8 @@ Response object that includes metrics and metric tag configurations. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[MetricsAndMetricTagConfigurations]**](MetricsAndMetricTagConfigurations.md) | Array of metrics and metric tag configurations. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Organization.md b/docs/v2/Organization.md index b75b7ba4e6..626a30f96e 100644 --- a/docs/v2/Organization.md +++ b/docs/v2/Organization.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **type** | [**OrganizationsType**](OrganizationsType.md) | | **attributes** | [**OrganizationAttributes**](OrganizationAttributes.md) | | [optional] **id** | **str** | ID of the organization. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/OrganizationAttributes.md b/docs/v2/OrganizationAttributes.md index 9ae9b035a4..e687972a21 100644 --- a/docs/v2/OrganizationAttributes.md +++ b/docs/v2/OrganizationAttributes.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **public_id** | **str** | Public ID of the organization. | [optional] **sharing** | **str** | Sharing type of the organization. | [optional] **url** | **str** | URL of the site that this organization exists at. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/OrganizationsType.md b/docs/v2/OrganizationsType.md index acae5e5cff..6e060235a0 100644 --- a/docs/v2/OrganizationsType.md +++ b/docs/v2/OrganizationsType.md @@ -6,7 +6,8 @@ Organizations resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Organizations resource type. | defaults to "orgs", must be one of ["orgs", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Pagination.md b/docs/v2/Pagination.md index ed882c10a2..5b389aeb67 100644 --- a/docs/v2/Pagination.md +++ b/docs/v2/Pagination.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_count** | **int** | Total count. | [optional] **total_filtered_count** | **int** | Total count of elements matched by the filter. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PartialAPIKey.md b/docs/v2/PartialAPIKey.md index 6d2a30cdd7..adeeac2a46 100644 --- a/docs/v2/PartialAPIKey.md +++ b/docs/v2/PartialAPIKey.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **id** | **str** | ID of the API key. | [optional] **relationships** | [**APIKeyRelationships**](APIKeyRelationships.md) | | [optional] **type** | [**APIKeysType**](APIKeysType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PartialAPIKeyAttributes.md b/docs/v2/PartialAPIKeyAttributes.md index 7987e98e98..9c8a5919da 100644 --- a/docs/v2/PartialAPIKeyAttributes.md +++ b/docs/v2/PartialAPIKeyAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **last4** | **str** | The last four characters of the API key. | [optional] [readonly] **modified_at** | **str** | Date the API key was last modified. | [optional] [readonly] **name** | **str** | Name of the API key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PartialApplicationKey.md b/docs/v2/PartialApplicationKey.md index 52593f6385..8bf0d8d833 100644 --- a/docs/v2/PartialApplicationKey.md +++ b/docs/v2/PartialApplicationKey.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **id** | **str** | ID of the application key. | [optional] **relationships** | [**ApplicationKeyRelationships**](ApplicationKeyRelationships.md) | | [optional] **type** | [**ApplicationKeysType**](ApplicationKeysType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PartialApplicationKeyAttributes.md b/docs/v2/PartialApplicationKeyAttributes.md index b7a4b8f1e2..9c975ef552 100644 --- a/docs/v2/PartialApplicationKeyAttributes.md +++ b/docs/v2/PartialApplicationKeyAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **created_at** | **str** | Creation date of the application key. | [optional] [readonly] **last4** | **str** | The last four characters of the application key. | [optional] [readonly] **name** | **str** | Name of the application key. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Permission.md b/docs/v2/Permission.md index a069366599..8a645902df 100644 --- a/docs/v2/Permission.md +++ b/docs/v2/Permission.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **type** | [**PermissionsType**](PermissionsType.md) | | **attributes** | [**PermissionAttributes**](PermissionAttributes.md) | | [optional] **id** | **str** | ID of the permission. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PermissionAttributes.md b/docs/v2/PermissionAttributes.md index e0e5b2933e..f09b76162d 100644 --- a/docs/v2/PermissionAttributes.md +++ b/docs/v2/PermissionAttributes.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **group_name** | **str** | Name of the permission group. | [optional] **name** | **str** | Name of the permission. | [optional] **restricted** | **bool** | Whether or not the permission is restricted. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PermissionsResponse.md b/docs/v2/PermissionsResponse.md index bc030d1688..db2318e087 100644 --- a/docs/v2/PermissionsResponse.md +++ b/docs/v2/PermissionsResponse.md @@ -6,7 +6,8 @@ Payload with API-returned permissions. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[Permission]**](Permission.md) | Array of permissions. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/PermissionsType.md b/docs/v2/PermissionsType.md index 82c1553bc1..7595be8e88 100644 --- a/docs/v2/PermissionsType.md +++ b/docs/v2/PermissionsType.md @@ -6,7 +6,8 @@ Permissions resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Permissions resource type. | defaults to "permissions", must be one of ["permissions", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ProcessSummariesMeta.md b/docs/v2/ProcessSummariesMeta.md index aea7e98d27..f72f2d85fd 100644 --- a/docs/v2/ProcessSummariesMeta.md +++ b/docs/v2/ProcessSummariesMeta.md @@ -6,7 +6,8 @@ Response metadata object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**ProcessSummariesMetaPage**](ProcessSummariesMetaPage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ProcessSummariesMetaPage.md b/docs/v2/ProcessSummariesMetaPage.md index 8ce5ba6e3a..7fbab45288 100644 --- a/docs/v2/ProcessSummariesMetaPage.md +++ b/docs/v2/ProcessSummariesMetaPage.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **after** | **str** | The cursor used to get the next results, if any. To make the next request, use the same parameters with the addition of the `page[cursor]`. | [optional] **size** | **int** | Number of results returned. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ProcessSummariesResponse.md b/docs/v2/ProcessSummariesResponse.md index 6840018430..01130a9bf1 100644 --- a/docs/v2/ProcessSummariesResponse.md +++ b/docs/v2/ProcessSummariesResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[ProcessSummary]**](ProcessSummary.md) | Array of process summary objects. | [optional] **meta** | [**ProcessSummariesMeta**](ProcessSummariesMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ProcessSummary.md b/docs/v2/ProcessSummary.md index 27137c6698..e16e079472 100644 --- a/docs/v2/ProcessSummary.md +++ b/docs/v2/ProcessSummary.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**ProcessSummaryAttributes**](ProcessSummaryAttributes.md) | | [optional] **id** | **str** | Process ID. | [optional] **type** | [**ProcessSummaryType**](ProcessSummaryType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ProcessSummaryAttributes.md b/docs/v2/ProcessSummaryAttributes.md index bd4bc48b17..c60fe31b82 100644 --- a/docs/v2/ProcessSummaryAttributes.md +++ b/docs/v2/ProcessSummaryAttributes.md @@ -13,7 +13,8 @@ Name | Type | Description | Notes **tags** | **[str]** | List of tags associated with the process. | [optional] **timestamp** | **str** | Time the process was seen. | [optional] **user** | **str** | Process owner. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ProcessSummaryType.md b/docs/v2/ProcessSummaryType.md index 099c3d5999..9dc9117bda 100644 --- a/docs/v2/ProcessSummaryType.md +++ b/docs/v2/ProcessSummaryType.md @@ -6,7 +6,8 @@ Type of process summary. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Type of process summary. | defaults to "process", must be one of ["process", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/QuerySortOrder.md b/docs/v2/QuerySortOrder.md index 286472ed01..93a385e5e1 100644 --- a/docs/v2/QuerySortOrder.md +++ b/docs/v2/QuerySortOrder.md @@ -6,7 +6,8 @@ Direction of sort. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Direction of sort. | defaults to "desc", must be one of ["asc", "desc", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToIncidentIntegrationMetadataData.md b/docs/v2/RelationshipToIncidentIntegrationMetadataData.md index e7900e49c6..537c1e2e07 100644 --- a/docs/v2/RelationshipToIncidentIntegrationMetadataData.md +++ b/docs/v2/RelationshipToIncidentIntegrationMetadataData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique identifier that represents the integration metadata. | **type** | [**IncidentIntegrationMetadataType**](IncidentIntegrationMetadataType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToIncidentIntegrationMetadatas.md b/docs/v2/RelationshipToIncidentIntegrationMetadatas.md index 9153244f84..4f14f115a1 100644 --- a/docs/v2/RelationshipToIncidentIntegrationMetadatas.md +++ b/docs/v2/RelationshipToIncidentIntegrationMetadatas.md @@ -6,7 +6,8 @@ A relationship reference for multiple integration metadata objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[RelationshipToIncidentIntegrationMetadataData]**](RelationshipToIncidentIntegrationMetadataData.md) | The integration metadata relationship array | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToIncidentPostmortem.md b/docs/v2/RelationshipToIncidentPostmortem.md index 19a2374565..78a0bb4bf0 100644 --- a/docs/v2/RelationshipToIncidentPostmortem.md +++ b/docs/v2/RelationshipToIncidentPostmortem.md @@ -6,7 +6,8 @@ A relationship reference for postmortems. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RelationshipToIncidentPostmortemData**](RelationshipToIncidentPostmortemData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToIncidentPostmortemData.md b/docs/v2/RelationshipToIncidentPostmortemData.md index 8cb5a5fed7..0cd991da3b 100644 --- a/docs/v2/RelationshipToIncidentPostmortemData.md +++ b/docs/v2/RelationshipToIncidentPostmortemData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique identifier that represents the postmortem. | **type** | [**IncidentPostmortemType**](IncidentPostmortemType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToOrganization.md b/docs/v2/RelationshipToOrganization.md index 42b773a510..c154007e33 100644 --- a/docs/v2/RelationshipToOrganization.md +++ b/docs/v2/RelationshipToOrganization.md @@ -6,7 +6,8 @@ Relationship to an organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RelationshipToOrganizationData**](RelationshipToOrganizationData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToOrganizationData.md b/docs/v2/RelationshipToOrganizationData.md index d8735ffae2..4776dc3cda 100644 --- a/docs/v2/RelationshipToOrganizationData.md +++ b/docs/v2/RelationshipToOrganizationData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | ID of the organization. | **type** | [**OrganizationsType**](OrganizationsType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToOrganizations.md b/docs/v2/RelationshipToOrganizations.md index 8177ab8b33..3b92be59de 100644 --- a/docs/v2/RelationshipToOrganizations.md +++ b/docs/v2/RelationshipToOrganizations.md @@ -6,7 +6,8 @@ Relationship to organizations. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[RelationshipToOrganizationData]**](RelationshipToOrganizationData.md) | Relationships to organization objects. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToPermission.md b/docs/v2/RelationshipToPermission.md index 40bf161891..f26eee93cc 100644 --- a/docs/v2/RelationshipToPermission.md +++ b/docs/v2/RelationshipToPermission.md @@ -6,7 +6,8 @@ Relationship to a permissions object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RelationshipToPermissionData**](RelationshipToPermissionData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToPermissionData.md b/docs/v2/RelationshipToPermissionData.md index 8b7149986f..19c8200744 100644 --- a/docs/v2/RelationshipToPermissionData.md +++ b/docs/v2/RelationshipToPermissionData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | ID of the permission. | [optional] **type** | [**PermissionsType**](PermissionsType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToPermissions.md b/docs/v2/RelationshipToPermissions.md index f8ff4f5df1..d379522d84 100644 --- a/docs/v2/RelationshipToPermissions.md +++ b/docs/v2/RelationshipToPermissions.md @@ -6,7 +6,8 @@ Relationship to multiple permissions objects. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[RelationshipToPermissionData]**](RelationshipToPermissionData.md) | Relationships to permission objects. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToRole.md b/docs/v2/RelationshipToRole.md index adcaf202a3..27777cd49b 100644 --- a/docs/v2/RelationshipToRole.md +++ b/docs/v2/RelationshipToRole.md @@ -6,7 +6,8 @@ Relationship to role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RelationshipToRoleData**](RelationshipToRoleData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToRoleData.md b/docs/v2/RelationshipToRoleData.md index af1afee2a0..43d5646c82 100644 --- a/docs/v2/RelationshipToRoleData.md +++ b/docs/v2/RelationshipToRoleData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | ID of the role. | [optional] **type** | [**RolesType**](RolesType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToRoles.md b/docs/v2/RelationshipToRoles.md index b7a76868fd..fed9410953 100644 --- a/docs/v2/RelationshipToRoles.md +++ b/docs/v2/RelationshipToRoles.md @@ -6,7 +6,8 @@ Relationship to roles. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[RelationshipToRoleData]**](RelationshipToRoleData.md) | An array containing type and ID of a role. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToUser.md b/docs/v2/RelationshipToUser.md index 918f1b29e0..2503e6b52b 100644 --- a/docs/v2/RelationshipToUser.md +++ b/docs/v2/RelationshipToUser.md @@ -6,7 +6,8 @@ Relationship to user. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RelationshipToUserData**](RelationshipToUserData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToUserData.md b/docs/v2/RelationshipToUserData.md index befd857d59..4e711a80fa 100644 --- a/docs/v2/RelationshipToUserData.md +++ b/docs/v2/RelationshipToUserData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A unique identifier that represents the user. | **type** | [**UsersType**](UsersType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RelationshipToUsers.md b/docs/v2/RelationshipToUsers.md index 5e678a1272..9a7a97cfe2 100644 --- a/docs/v2/RelationshipToUsers.md +++ b/docs/v2/RelationshipToUsers.md @@ -6,7 +6,8 @@ Relationship to users. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[RelationshipToUserData]**](RelationshipToUserData.md) | Relationships to user objects. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/ResponseMetaAttributes.md b/docs/v2/ResponseMetaAttributes.md index 6ee5f4e819..bec772186f 100644 --- a/docs/v2/ResponseMetaAttributes.md +++ b/docs/v2/ResponseMetaAttributes.md @@ -6,7 +6,8 @@ Object describing meta attributes of response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**Pagination**](Pagination.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/Role.md b/docs/v2/Role.md index b59f6c0325..04ed54d2ec 100644 --- a/docs/v2/Role.md +++ b/docs/v2/Role.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **attributes** | [**RoleAttributes**](RoleAttributes.md) | | [optional] **id** | **str** | ID of the role. | [optional] **relationships** | [**RoleResponseRelationships**](RoleResponseRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleAttributes.md b/docs/v2/RoleAttributes.md index 9f8bb9e687..f49438e591 100644 --- a/docs/v2/RoleAttributes.md +++ b/docs/v2/RoleAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **modified_at** | **datetime** | Time of last role modification. | [optional] [readonly] **name** | **str** | Name of the role. | [optional] **user_count** | **int** | Number of users with that role. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleCreateAttributes.md b/docs/v2/RoleCreateAttributes.md index d3c1ddf5f5..cfc91ce715 100644 --- a/docs/v2/RoleCreateAttributes.md +++ b/docs/v2/RoleCreateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **name** | **str** | Name of the role. | **created_at** | **datetime** | Creation time of the role. | [optional] [readonly] **modified_at** | **datetime** | Time of last role modification. | [optional] [readonly] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleCreateData.md b/docs/v2/RoleCreateData.md index aa827b51ed..9404f6e110 100644 --- a/docs/v2/RoleCreateData.md +++ b/docs/v2/RoleCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**RoleCreateAttributes**](RoleCreateAttributes.md) | | **relationships** | [**RoleRelationships**](RoleRelationships.md) | | [optional] **type** | [**RolesType**](RolesType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleCreateRequest.md b/docs/v2/RoleCreateRequest.md index f630a43171..43d625b86d 100644 --- a/docs/v2/RoleCreateRequest.md +++ b/docs/v2/RoleCreateRequest.md @@ -6,7 +6,8 @@ Create a role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RoleCreateData**](RoleCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleCreateResponse.md b/docs/v2/RoleCreateResponse.md index be5fd9f90b..1edb1bed23 100644 --- a/docs/v2/RoleCreateResponse.md +++ b/docs/v2/RoleCreateResponse.md @@ -6,7 +6,8 @@ Response containing information about a created role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RoleCreateResponseData**](RoleCreateResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleCreateResponseData.md b/docs/v2/RoleCreateResponseData.md index b72a706231..e5e62984ce 100644 --- a/docs/v2/RoleCreateResponseData.md +++ b/docs/v2/RoleCreateResponseData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **attributes** | [**RoleCreateAttributes**](RoleCreateAttributes.md) | | [optional] **id** | **str** | ID of the role. | [optional] **relationships** | [**RoleResponseRelationships**](RoleResponseRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleRelationships.md b/docs/v2/RoleRelationships.md index de10851445..48103925de 100644 --- a/docs/v2/RoleRelationships.md +++ b/docs/v2/RoleRelationships.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **permissions** | [**RelationshipToPermissions**](RelationshipToPermissions.md) | | [optional] **users** | [**RelationshipToUsers**](RelationshipToUsers.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleResponse.md b/docs/v2/RoleResponse.md index 3af83078eb..e4d5183bb0 100644 --- a/docs/v2/RoleResponse.md +++ b/docs/v2/RoleResponse.md @@ -6,7 +6,8 @@ Response containing information about a single role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Role**](Role.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleResponseRelationships.md b/docs/v2/RoleResponseRelationships.md index b4867a5cba..fa5c661387 100644 --- a/docs/v2/RoleResponseRelationships.md +++ b/docs/v2/RoleResponseRelationships.md @@ -6,7 +6,8 @@ Relationships of the role object returned by the API. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **permissions** | [**RelationshipToPermissions**](RelationshipToPermissions.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleUpdateAttributes.md b/docs/v2/RoleUpdateAttributes.md index 05bace4bbe..8ca0b693aa 100644 --- a/docs/v2/RoleUpdateAttributes.md +++ b/docs/v2/RoleUpdateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **created_at** | **datetime** | Creation time of the role. | [optional] [readonly] **modified_at** | **datetime** | Time of last role modification. | [optional] [readonly] **name** | **str** | Name of the role. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleUpdateData.md b/docs/v2/RoleUpdateData.md index 848c9f9772..009c955e52 100644 --- a/docs/v2/RoleUpdateData.md +++ b/docs/v2/RoleUpdateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**RoleUpdateAttributes**](RoleUpdateAttributes.md) | | **id** | **str** | ID of the role. | **type** | [**RolesType**](RolesType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleUpdateRequest.md b/docs/v2/RoleUpdateRequest.md index 9856d42508..2cf12d4380 100644 --- a/docs/v2/RoleUpdateRequest.md +++ b/docs/v2/RoleUpdateRequest.md @@ -6,7 +6,8 @@ Update a role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RoleUpdateData**](RoleUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleUpdateResponse.md b/docs/v2/RoleUpdateResponse.md index 63a2797a1f..5cf456f8a3 100644 --- a/docs/v2/RoleUpdateResponse.md +++ b/docs/v2/RoleUpdateResponse.md @@ -6,7 +6,8 @@ Response containing information about an updated role. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RoleUpdateResponseData**](RoleUpdateResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RoleUpdateResponseData.md b/docs/v2/RoleUpdateResponseData.md index 52e0912c94..66dda1f655 100644 --- a/docs/v2/RoleUpdateResponseData.md +++ b/docs/v2/RoleUpdateResponseData.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **attributes** | [**RoleUpdateAttributes**](RoleUpdateAttributes.md) | | [optional] **id** | **str** | ID of the role. | [optional] **relationships** | [**RoleResponseRelationships**](RoleResponseRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RolesApi.md b/docs/v2/RolesApi.md index 000fb3816e..ff8b66a13f 100644 --- a/docs/v2/RolesApi.md +++ b/docs/v2/RolesApi.md @@ -188,8 +188,6 @@ with ApiClient(configuration) as api_client: body = RoleCreateRequest( data=RoleCreateData( attributes=RoleCreateAttributes( - created_at=dateutil_parser('1970-01-01T00:00:00.00Z'), - modified_at=dateutil_parser('1970-01-01T00:00:00.00Z'), name="developers", ), relationships=RoleRelationships( @@ -826,8 +824,6 @@ with ApiClient(configuration) as api_client: body = RoleUpdateRequest( data=RoleUpdateData( attributes=RoleUpdateAttributes( - created_at=dateutil_parser('1970-01-01T00:00:00.00Z'), - modified_at=dateutil_parser('1970-01-01T00:00:00.00Z'), name="name_example", ), id="00000000-0000-0000-0000-000000000000", diff --git a/docs/v2/RolesResponse.md b/docs/v2/RolesResponse.md index 085a94b305..6cf42e8965 100644 --- a/docs/v2/RolesResponse.md +++ b/docs/v2/RolesResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[Role]**](Role.md) | Array of returned roles. | [optional] **meta** | [**ResponseMetaAttributes**](ResponseMetaAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RolesSort.md b/docs/v2/RolesSort.md index 0cbc0cc780..5e2df40728 100644 --- a/docs/v2/RolesSort.md +++ b/docs/v2/RolesSort.md @@ -6,7 +6,8 @@ Sorting options for roles. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Sorting options for roles. | defaults to "name", must be one of ["name", "-name", "modified_at", "-modified_at", "user_count", "-user_count", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/RolesType.md b/docs/v2/RolesType.md index b7daccfbb9..1f2a1f0289 100644 --- a/docs/v2/RolesType.md +++ b/docs/v2/RolesType.md @@ -6,7 +6,8 @@ Roles type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Roles type. | defaults to "roles", must be one of ["roles", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilter.md b/docs/v2/SecurityFilter.md index cac3272b5b..fb27a29128 100644 --- a/docs/v2/SecurityFilter.md +++ b/docs/v2/SecurityFilter.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**SecurityFilterAttributes**](SecurityFilterAttributes.md) | | [optional] **id** | **str** | The ID of the security filter. | [optional] **type** | [**SecurityFilterType**](SecurityFilterType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterAttributes.md b/docs/v2/SecurityFilterAttributes.md index 8fcf684faa..318a5c4015 100644 --- a/docs/v2/SecurityFilterAttributes.md +++ b/docs/v2/SecurityFilterAttributes.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **name** | **str** | The security filter name. | [optional] **query** | **str** | The security filter query. Logs accepted by this query will be accepted by this filter. | [optional] **version** | **int** | The version of the security filter. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterCreateAttributes.md b/docs/v2/SecurityFilterCreateAttributes.md index e33cedd133..64c4db4da0 100644 --- a/docs/v2/SecurityFilterCreateAttributes.md +++ b/docs/v2/SecurityFilterCreateAttributes.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **is_enabled** | **bool** | Whether the security filter is enabled. | **name** | **str** | The name of the security filter. | **query** | **str** | The query of the security filter. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterCreateData.md b/docs/v2/SecurityFilterCreateData.md index 6685aaba0c..ad492c654a 100644 --- a/docs/v2/SecurityFilterCreateData.md +++ b/docs/v2/SecurityFilterCreateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**SecurityFilterCreateAttributes**](SecurityFilterCreateAttributes.md) | | **type** | [**SecurityFilterType**](SecurityFilterType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterCreateRequest.md b/docs/v2/SecurityFilterCreateRequest.md index 8aee8da25a..bfc00eeec3 100644 --- a/docs/v2/SecurityFilterCreateRequest.md +++ b/docs/v2/SecurityFilterCreateRequest.md @@ -6,7 +6,8 @@ Request object that includes the security filter that you would like to create. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SecurityFilterCreateData**](SecurityFilterCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterExclusionFilter.md b/docs/v2/SecurityFilterExclusionFilter.md index e7cb343501..8880a15614 100644 --- a/docs/v2/SecurityFilterExclusionFilter.md +++ b/docs/v2/SecurityFilterExclusionFilter.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Exclusion filter name. | **query** | **str** | Exclusion filter query. Logs that match this query are excluded from the security filter. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterExclusionFilterResponse.md b/docs/v2/SecurityFilterExclusionFilterResponse.md index 8607a36b49..0dc13b4475 100644 --- a/docs/v2/SecurityFilterExclusionFilterResponse.md +++ b/docs/v2/SecurityFilterExclusionFilterResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | The exclusion filter name. | [optional] **query** | **str** | The exclusion filter query. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterFilteredDataType.md b/docs/v2/SecurityFilterFilteredDataType.md index eff2240af9..85b97f7302 100644 --- a/docs/v2/SecurityFilterFilteredDataType.md +++ b/docs/v2/SecurityFilterFilteredDataType.md @@ -6,7 +6,8 @@ The filtered data type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The filtered data type. | defaults to "logs", must be one of ["logs", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterMeta.md b/docs/v2/SecurityFilterMeta.md index ec7c1ee596..eccce37e9b 100644 --- a/docs/v2/SecurityFilterMeta.md +++ b/docs/v2/SecurityFilterMeta.md @@ -6,7 +6,8 @@ Optional metadata associated to the response. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **warning** | **str** | A warning message. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterResponse.md b/docs/v2/SecurityFilterResponse.md index ddc065beec..dd607de3d0 100644 --- a/docs/v2/SecurityFilterResponse.md +++ b/docs/v2/SecurityFilterResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SecurityFilter**](SecurityFilter.md) | | [optional] **meta** | [**SecurityFilterMeta**](SecurityFilterMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterType.md b/docs/v2/SecurityFilterType.md index bb5121fd4e..71af001cbd 100644 --- a/docs/v2/SecurityFilterType.md +++ b/docs/v2/SecurityFilterType.md @@ -6,7 +6,8 @@ The type of the resource. The value should always be `security_filters`. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of the resource. The value should always be `security_filters`. | defaults to "security_filters", must be one of ["security_filters", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterUpdateAttributes.md b/docs/v2/SecurityFilterUpdateAttributes.md index 2414b8a358..23a5a31a7b 100644 --- a/docs/v2/SecurityFilterUpdateAttributes.md +++ b/docs/v2/SecurityFilterUpdateAttributes.md @@ -11,7 +11,8 @@ Name | Type | Description | Notes **name** | **str** | The name of the security filter. | [optional] **query** | **str** | The query of the security filter. | [optional] **version** | **int** | The version of the security filter to update. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterUpdateData.md b/docs/v2/SecurityFilterUpdateData.md index 41df2258ee..d4432449fe 100644 --- a/docs/v2/SecurityFilterUpdateData.md +++ b/docs/v2/SecurityFilterUpdateData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | [**SecurityFilterUpdateAttributes**](SecurityFilterUpdateAttributes.md) | | **type** | [**SecurityFilterType**](SecurityFilterType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFilterUpdateRequest.md b/docs/v2/SecurityFilterUpdateRequest.md index a8c0b830af..22885875c0 100644 --- a/docs/v2/SecurityFilterUpdateRequest.md +++ b/docs/v2/SecurityFilterUpdateRequest.md @@ -6,7 +6,8 @@ The new security filter body. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SecurityFilterUpdateData**](SecurityFilterUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityFiltersResponse.md b/docs/v2/SecurityFiltersResponse.md index 7d6f042c7a..f8420cc37c 100644 --- a/docs/v2/SecurityFiltersResponse.md +++ b/docs/v2/SecurityFiltersResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[SecurityFilter]**](SecurityFilter.md) | A list of security filters objects. | [optional] **meta** | [**SecurityFilterMeta**](SecurityFilterMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringFilter.md b/docs/v2/SecurityMonitoringFilter.md index e21a609c14..a8d48c1987 100644 --- a/docs/v2/SecurityMonitoringFilter.md +++ b/docs/v2/SecurityMonitoringFilter.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **action** | [**SecurityMonitoringFilterAction**](SecurityMonitoringFilterAction.md) | | [optional] **query** | **str** | Query for selecting logs to apply the filtering action. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringFilterAction.md b/docs/v2/SecurityMonitoringFilterAction.md index d6f49f3874..1e598d5658 100644 --- a/docs/v2/SecurityMonitoringFilterAction.md +++ b/docs/v2/SecurityMonitoringFilterAction.md @@ -6,7 +6,8 @@ The type of filtering action. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of filtering action. | must be one of ["require", "suppress", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringListRulesResponse.md b/docs/v2/SecurityMonitoringListRulesResponse.md index 567565281f..44b95717a7 100644 --- a/docs/v2/SecurityMonitoringListRulesResponse.md +++ b/docs/v2/SecurityMonitoringListRulesResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[SecurityMonitoringRuleResponse]**](SecurityMonitoringRuleResponse.md) | Array containing the list of rules. | [optional] **meta** | [**ResponseMetaAttributes**](ResponseMetaAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleCase.md b/docs/v2/SecurityMonitoringRuleCase.md index 71097e606d..d654b1ec15 100644 --- a/docs/v2/SecurityMonitoringRuleCase.md +++ b/docs/v2/SecurityMonitoringRuleCase.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **name** | **str** | Name of the case. | [optional] **notifications** | **[str]** | Notification targets for each rule case. | [optional] **status** | [**SecurityMonitoringRuleSeverity**](SecurityMonitoringRuleSeverity.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleCaseCreate.md b/docs/v2/SecurityMonitoringRuleCaseCreate.md index 3b5ada2688..1268764dae 100644 --- a/docs/v2/SecurityMonitoringRuleCaseCreate.md +++ b/docs/v2/SecurityMonitoringRuleCaseCreate.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **condition** | **str** | A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated based on the event counts in the previously defined queries. | [optional] **name** | **str** | Name of the case. | [optional] **notifications** | **[str]** | Notification targets for each rule case. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleCreatePayload.md b/docs/v2/SecurityMonitoringRuleCreatePayload.md index a4c5989a2e..1691a15c0b 100644 --- a/docs/v2/SecurityMonitoringRuleCreatePayload.md +++ b/docs/v2/SecurityMonitoringRuleCreatePayload.md @@ -14,7 +14,8 @@ Name | Type | Description | Notes **filters** | [**[SecurityMonitoringFilter]**](SecurityMonitoringFilter.md) | Additional queries to filter matched events before they are processed. | [optional] **has_extended_title** | **bool** | Whether the notifications include the triggering group-by values in their title. | [optional] **tags** | **[str]** | Tags for generated signals. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleDetectionMethod.md b/docs/v2/SecurityMonitoringRuleDetectionMethod.md index fbd6365ef8..3da4f9359f 100644 --- a/docs/v2/SecurityMonitoringRuleDetectionMethod.md +++ b/docs/v2/SecurityMonitoringRuleDetectionMethod.md @@ -6,7 +6,8 @@ The detection method. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The detection method. | must be one of ["threshold", "new_value", "anomaly_detection", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleEvaluationWindow.md b/docs/v2/SecurityMonitoringRuleEvaluationWindow.md index 506c0fea17..a016b06fcf 100644 --- a/docs/v2/SecurityMonitoringRuleEvaluationWindow.md +++ b/docs/v2/SecurityMonitoringRuleEvaluationWindow.md @@ -6,7 +6,8 @@ A time window is specified to match when at least one of the cases matches true. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | A time window is specified to match when at least one of the cases matches true. This is a sliding window and evaluates in real time. | must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleKeepAlive.md b/docs/v2/SecurityMonitoringRuleKeepAlive.md index 775f527ccc..ae5a63f639 100644 --- a/docs/v2/SecurityMonitoringRuleKeepAlive.md +++ b/docs/v2/SecurityMonitoringRuleKeepAlive.md @@ -6,7 +6,8 @@ Once a signal is generated, the signal will remain “open” if a case is match Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | Once a signal is generated, the signal will remain “open” if a case is matched at least once within this keep alive window. | must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleMaxSignalDuration.md b/docs/v2/SecurityMonitoringRuleMaxSignalDuration.md index 91a2150925..7aa73c607b 100644 --- a/docs/v2/SecurityMonitoringRuleMaxSignalDuration.md +++ b/docs/v2/SecurityMonitoringRuleMaxSignalDuration.md @@ -6,7 +6,8 @@ A signal will “close” regardless of the query being matched once the time ex Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | A signal will “close” regardless of the query being matched once the time exceeds the maximum duration. This time is calculated from the first seen timestamp. | must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleNewValueOptions.md b/docs/v2/SecurityMonitoringRuleNewValueOptions.md index 50fe0836da..7c176024a3 100644 --- a/docs/v2/SecurityMonitoringRuleNewValueOptions.md +++ b/docs/v2/SecurityMonitoringRuleNewValueOptions.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **forget_after** | [**SecurityMonitoringRuleNewValueOptionsForgetAfter**](SecurityMonitoringRuleNewValueOptionsForgetAfter.md) | | [optional] **learning_duration** | [**SecurityMonitoringRuleNewValueOptionsLearningDuration**](SecurityMonitoringRuleNewValueOptionsLearningDuration.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleNewValueOptionsForgetAfter.md b/docs/v2/SecurityMonitoringRuleNewValueOptionsForgetAfter.md index 177f0c0095..efb3586b14 100644 --- a/docs/v2/SecurityMonitoringRuleNewValueOptionsForgetAfter.md +++ b/docs/v2/SecurityMonitoringRuleNewValueOptionsForgetAfter.md @@ -6,7 +6,8 @@ The duration in days after which a learned value is forgotten. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | The duration in days after which a learned value is forgotten. | must be one of [1, 2, 7, 14, 21, 28, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleNewValueOptionsLearningDuration.md b/docs/v2/SecurityMonitoringRuleNewValueOptionsLearningDuration.md index a04cead6c8..ea4abfa08a 100644 --- a/docs/v2/SecurityMonitoringRuleNewValueOptionsLearningDuration.md +++ b/docs/v2/SecurityMonitoringRuleNewValueOptionsLearningDuration.md @@ -6,7 +6,8 @@ The duration in days during which values are learned, and after which signals wi Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **int** | The duration in days during which values are learned, and after which signals will be generated for values that weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned. | must be one of [0, 1, 7, ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleOptions.md b/docs/v2/SecurityMonitoringRuleOptions.md index 19882aec7d..d0caa0fac9 100644 --- a/docs/v2/SecurityMonitoringRuleOptions.md +++ b/docs/v2/SecurityMonitoringRuleOptions.md @@ -10,7 +10,8 @@ Name | Type | Description | Notes **keep_alive** | [**SecurityMonitoringRuleKeepAlive**](SecurityMonitoringRuleKeepAlive.md) | | [optional] **max_signal_duration** | [**SecurityMonitoringRuleMaxSignalDuration**](SecurityMonitoringRuleMaxSignalDuration.md) | | [optional] **new_value_options** | [**SecurityMonitoringRuleNewValueOptions**](SecurityMonitoringRuleNewValueOptions.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleQuery.md b/docs/v2/SecurityMonitoringRuleQuery.md index 153618b593..4ae3464e83 100644 --- a/docs/v2/SecurityMonitoringRuleQuery.md +++ b/docs/v2/SecurityMonitoringRuleQuery.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **metric** | **str** | The target field to aggregate over when using the sum or max aggregations. | [optional] **name** | **str** | Name of the query. | [optional] **query** | **str** | Query to run on logs. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleQueryAggregation.md b/docs/v2/SecurityMonitoringRuleQueryAggregation.md index 5a9f3562cb..6e67b5aa2e 100644 --- a/docs/v2/SecurityMonitoringRuleQueryAggregation.md +++ b/docs/v2/SecurityMonitoringRuleQueryAggregation.md @@ -6,7 +6,8 @@ The aggregation type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The aggregation type. | must be one of ["count", "cardinality", "sum", "max", "new_value", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleQueryCreate.md b/docs/v2/SecurityMonitoringRuleQueryCreate.md index fb7214da3c..be6a7939f2 100644 --- a/docs/v2/SecurityMonitoringRuleQueryCreate.md +++ b/docs/v2/SecurityMonitoringRuleQueryCreate.md @@ -12,7 +12,8 @@ Name | Type | Description | Notes **group_by_fields** | **[str]** | Fields to group by. | [optional] **metric** | **str** | The target field to aggregate over when using the sum or max aggregations. | [optional] **name** | **str** | Name of the query. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleResponse.md b/docs/v2/SecurityMonitoringRuleResponse.md index 0aaa6f9c72..d602831115 100644 --- a/docs/v2/SecurityMonitoringRuleResponse.md +++ b/docs/v2/SecurityMonitoringRuleResponse.md @@ -21,7 +21,8 @@ Name | Type | Description | Notes **tags** | **[str]** | Tags for generated signals. | [optional] **update_author_id** | **int** | User ID of the user who updated the rule. | [optional] **version** | **int** | The version of the rule. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleSeverity.md b/docs/v2/SecurityMonitoringRuleSeverity.md index 3cbc701b78..2c876bd4e9 100644 --- a/docs/v2/SecurityMonitoringRuleSeverity.md +++ b/docs/v2/SecurityMonitoringRuleSeverity.md @@ -6,7 +6,8 @@ Severity of the Security Signal. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Severity of the Security Signal. | must be one of ["info", "low", "medium", "high", "critical", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuleUpdatePayload.md b/docs/v2/SecurityMonitoringRuleUpdatePayload.md index 7797e5b619..b2be5bc076 100644 --- a/docs/v2/SecurityMonitoringRuleUpdatePayload.md +++ b/docs/v2/SecurityMonitoringRuleUpdatePayload.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **queries** | [**[SecurityMonitoringRuleQuery]**](SecurityMonitoringRuleQuery.md) | Queries for selecting logs which are part of the rule. | [optional] **tags** | **[str]** | Tags for generated signals. | [optional] **version** | **int** | The version of the rule being updated. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringRuntimeAgentRule.md b/docs/v2/SecurityMonitoringRuntimeAgentRule.md index e3b024914c..235b5f7a07 100644 --- a/docs/v2/SecurityMonitoringRuntimeAgentRule.md +++ b/docs/v2/SecurityMonitoringRuntimeAgentRule.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **agent_rule_id** | **str** | The Agent rule ID. Must be unique within the rule. | [optional] **expression** | **str** | A Runtime Security expression determines what activity should be collected by the Datadog Agent. These logical expressions can use predefined operators and attributes. Tags cannot be used in Runtime Security expressions. Instead, allow or deny based on tags under the advanced option. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignal.md b/docs/v2/SecurityMonitoringSignal.md index 498cc3e136..824a78fed6 100644 --- a/docs/v2/SecurityMonitoringSignal.md +++ b/docs/v2/SecurityMonitoringSignal.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**SecurityMonitoringSignalAttributes**](SecurityMonitoringSignalAttributes.md) | | [optional] **id** | **str** | The unique ID of the security signal. | [optional] **type** | [**SecurityMonitoringSignalType**](SecurityMonitoringSignalType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalAttributes.md b/docs/v2/SecurityMonitoringSignalAttributes.md index 71d83cb359..107708273a 100644 --- a/docs/v2/SecurityMonitoringSignalAttributes.md +++ b/docs/v2/SecurityMonitoringSignalAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **message** | **str** | The message in the security signal defined by the rule that generated the signal. | [optional] **tags** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | An array of tags associated with the security signal. | [optional] **timestamp** | **datetime** | The timestamp of the security signal. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalListRequest.md b/docs/v2/SecurityMonitoringSignalListRequest.md index 919c2e5e39..300a841151 100644 --- a/docs/v2/SecurityMonitoringSignalListRequest.md +++ b/docs/v2/SecurityMonitoringSignalListRequest.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **filter** | [**SecurityMonitoringSignalListRequestFilter**](SecurityMonitoringSignalListRequestFilter.md) | | [optional] **page** | [**SecurityMonitoringSignalListRequestPage**](SecurityMonitoringSignalListRequestPage.md) | | [optional] **sort** | [**SecurityMonitoringSignalsSort**](SecurityMonitoringSignalsSort.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalListRequestFilter.md b/docs/v2/SecurityMonitoringSignalListRequestFilter.md index bcf1973b7b..1cadb3e8d3 100644 --- a/docs/v2/SecurityMonitoringSignalListRequestFilter.md +++ b/docs/v2/SecurityMonitoringSignalListRequestFilter.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **_from** | **datetime** | The minimum timestamp for requested security signals. | [optional] **query** | **str** | Search query for listing security signals. | [optional] **to** | **datetime** | The maximum timestamp for requested security signals. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalListRequestPage.md b/docs/v2/SecurityMonitoringSignalListRequestPage.md index 712e8635a8..698d59a8d4 100644 --- a/docs/v2/SecurityMonitoringSignalListRequestPage.md +++ b/docs/v2/SecurityMonitoringSignalListRequestPage.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cursor** | **str** | A list of results using the cursor provided in the previous query. | [optional] **limit** | **int** | The maximum number of security signals in the response. | [optional] if omitted the server will use the default value of 10 +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalType.md b/docs/v2/SecurityMonitoringSignalType.md index db4de333ab..357cd70ed7 100644 --- a/docs/v2/SecurityMonitoringSignalType.md +++ b/docs/v2/SecurityMonitoringSignalType.md @@ -6,7 +6,8 @@ The type of event. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The type of event. | defaults to "signal", must be one of ["signal", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalsListResponse.md b/docs/v2/SecurityMonitoringSignalsListResponse.md index 3a8210d756..f15b242bd2 100644 --- a/docs/v2/SecurityMonitoringSignalsListResponse.md +++ b/docs/v2/SecurityMonitoringSignalsListResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[SecurityMonitoringSignal]**](SecurityMonitoringSignal.md) | An array of security signals matching the request. | [optional] **links** | [**SecurityMonitoringSignalsListResponseLinks**](SecurityMonitoringSignalsListResponseLinks.md) | | [optional] **meta** | [**SecurityMonitoringSignalsListResponseMeta**](SecurityMonitoringSignalsListResponseMeta.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalsListResponseLinks.md b/docs/v2/SecurityMonitoringSignalsListResponseLinks.md index 71d3a7122b..db428c8f45 100644 --- a/docs/v2/SecurityMonitoringSignalsListResponseLinks.md +++ b/docs/v2/SecurityMonitoringSignalsListResponseLinks.md @@ -6,7 +6,8 @@ Links attributes. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **next** | **str** | The link for the next set of results. **Note**: The request can also be made using the POST endpoint. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalsListResponseMeta.md b/docs/v2/SecurityMonitoringSignalsListResponseMeta.md index b52b957e84..561124cd96 100644 --- a/docs/v2/SecurityMonitoringSignalsListResponseMeta.md +++ b/docs/v2/SecurityMonitoringSignalsListResponseMeta.md @@ -6,7 +6,8 @@ Meta attributes. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page** | [**SecurityMonitoringSignalsListResponseMetaPage**](SecurityMonitoringSignalsListResponseMetaPage.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalsListResponseMetaPage.md b/docs/v2/SecurityMonitoringSignalsListResponseMetaPage.md index 8239da63ec..73cf8d9b53 100644 --- a/docs/v2/SecurityMonitoringSignalsListResponseMetaPage.md +++ b/docs/v2/SecurityMonitoringSignalsListResponseMetaPage.md @@ -6,7 +6,8 @@ Paging attributes. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **after** | **str** | The cursor used to get the next results, if any. To make the next request, use the same parameters with the addition of the `page[cursor]`. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/SecurityMonitoringSignalsSort.md b/docs/v2/SecurityMonitoringSignalsSort.md index aa90d39b08..43bf6308f2 100644 --- a/docs/v2/SecurityMonitoringSignalsSort.md +++ b/docs/v2/SecurityMonitoringSignalsSort.md @@ -6,7 +6,8 @@ The sort parameters used for querying security signals. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | The sort parameters used for querying security signals. | must be one of ["timestamp", "-timestamp", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/User.md b/docs/v2/User.md index 47ca52e8b0..11974b075f 100644 --- a/docs/v2/User.md +++ b/docs/v2/User.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **id** | **str** | ID of the user. | [optional] **relationships** | [**UserResponseRelationships**](UserResponseRelationships.md) | | [optional] **type** | [**UsersType**](UsersType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserAttributes.md b/docs/v2/UserAttributes.md index 84de8f228d..71a21f8ac6 100644 --- a/docs/v2/UserAttributes.md +++ b/docs/v2/UserAttributes.md @@ -15,7 +15,8 @@ Name | Type | Description | Notes **status** | **str** | Status of the user. | [optional] **title** | **str** | Title of the user. | [optional] **verified** | **bool** | Whether the user is verified. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserCreateAttributes.md b/docs/v2/UserCreateAttributes.md index 173800c3f7..de501a404d 100644 --- a/docs/v2/UserCreateAttributes.md +++ b/docs/v2/UserCreateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **email** | **str** | The email of the user. | **name** | **str** | The name of the user. | [optional] **title** | **str** | The title of the user. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserCreateData.md b/docs/v2/UserCreateData.md index f696ace762..802665435f 100644 --- a/docs/v2/UserCreateData.md +++ b/docs/v2/UserCreateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**UserCreateAttributes**](UserCreateAttributes.md) | | **type** | [**UsersType**](UsersType.md) | | **relationships** | [**UserRelationships**](UserRelationships.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserCreateRequest.md b/docs/v2/UserCreateRequest.md index a21eafe076..5a5cc7a8b1 100644 --- a/docs/v2/UserCreateRequest.md +++ b/docs/v2/UserCreateRequest.md @@ -6,7 +6,8 @@ Create a user. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**UserCreateData**](UserCreateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationData.md b/docs/v2/UserInvitationData.md index 8ee9dfe75a..1d2d7b317a 100644 --- a/docs/v2/UserInvitationData.md +++ b/docs/v2/UserInvitationData.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **relationships** | [**UserInvitationRelationships**](UserInvitationRelationships.md) | | **type** | [**UserInvitationsType**](UserInvitationsType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationDataAttributes.md b/docs/v2/UserInvitationDataAttributes.md index b5bcb1b6c9..e63b218c88 100644 --- a/docs/v2/UserInvitationDataAttributes.md +++ b/docs/v2/UserInvitationDataAttributes.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **expires_at** | **datetime** | Time of invitation expiration. | [optional] **invite_type** | **str** | Type of invitation. | [optional] **uuid** | **str** | UUID of the user invitation. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationRelationships.md b/docs/v2/UserInvitationRelationships.md index 0215375692..14abbeae7e 100644 --- a/docs/v2/UserInvitationRelationships.md +++ b/docs/v2/UserInvitationRelationships.md @@ -6,7 +6,8 @@ Relationships data for user invitation. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **user** | [**RelationshipToUser**](RelationshipToUser.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationResponse.md b/docs/v2/UserInvitationResponse.md index 3f18ce0dc5..10c3085381 100644 --- a/docs/v2/UserInvitationResponse.md +++ b/docs/v2/UserInvitationResponse.md @@ -6,7 +6,8 @@ User invitation as returned by the API. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**UserInvitationResponseData**](UserInvitationResponseData.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationResponseData.md b/docs/v2/UserInvitationResponseData.md index 93453a4a01..1eb3e58924 100644 --- a/docs/v2/UserInvitationResponseData.md +++ b/docs/v2/UserInvitationResponseData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**UserInvitationDataAttributes**](UserInvitationDataAttributes.md) | | [optional] **id** | **str** | ID of the user invitation. | [optional] **type** | [**UserInvitationsType**](UserInvitationsType.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationsRequest.md b/docs/v2/UserInvitationsRequest.md index 27901da859..9cd42bd8e6 100644 --- a/docs/v2/UserInvitationsRequest.md +++ b/docs/v2/UserInvitationsRequest.md @@ -6,7 +6,8 @@ Object to invite users to join the organization. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[UserInvitationData]**](UserInvitationData.md) | List of user invitations. | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationsResponse.md b/docs/v2/UserInvitationsResponse.md index 90d5d47d2f..b3e06acdc6 100644 --- a/docs/v2/UserInvitationsResponse.md +++ b/docs/v2/UserInvitationsResponse.md @@ -6,7 +6,8 @@ User invitations as returned by the API. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**[UserInvitationResponseData]**](UserInvitationResponseData.md) | Array of user invitations. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserInvitationsType.md b/docs/v2/UserInvitationsType.md index 764b04f63f..d1eecfe2d9 100644 --- a/docs/v2/UserInvitationsType.md +++ b/docs/v2/UserInvitationsType.md @@ -6,7 +6,8 @@ User invitations type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | User invitations type. | defaults to "user_invitations", must be one of ["user_invitations", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserRelationships.md b/docs/v2/UserRelationships.md index 963b93ff95..c84ad9fed7 100644 --- a/docs/v2/UserRelationships.md +++ b/docs/v2/UserRelationships.md @@ -6,7 +6,8 @@ Relationships of the user object. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **roles** | [**RelationshipToRoles**](RelationshipToRoles.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserResponse.md b/docs/v2/UserResponse.md index 19ea6c75e0..0beb496c84 100644 --- a/docs/v2/UserResponse.md +++ b/docs/v2/UserResponse.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**User**](User.md) | | [optional] **included** | [**[UserResponseIncludedItem]**](UserResponseIncludedItem.md) | Array of objects related to the user. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserResponseIncludedItem.md b/docs/v2/UserResponseIncludedItem.md index 58629e428e..8fb81d791f 100644 --- a/docs/v2/UserResponseIncludedItem.md +++ b/docs/v2/UserResponseIncludedItem.md @@ -9,6 +9,6 @@ Name | Type | Description | Notes **Permission** | [**Permission**](Permission.md) | Container class of the relevant properties. | **Role** | [**Role**](Role.md) | Container class of the relevant properties. | -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserResponseRelationships.md b/docs/v2/UserResponseRelationships.md index e35047f2b6..97dd8fc8c0 100644 --- a/docs/v2/UserResponseRelationships.md +++ b/docs/v2/UserResponseRelationships.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **other_orgs** | [**RelationshipToOrganizations**](RelationshipToOrganizations.md) | | [optional] **other_users** | [**RelationshipToUsers**](RelationshipToUsers.md) | | [optional] **roles** | [**RelationshipToRoles**](RelationshipToRoles.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserUpdateAttributes.md b/docs/v2/UserUpdateAttributes.md index 6d40abb061..8d36c23dc1 100644 --- a/docs/v2/UserUpdateAttributes.md +++ b/docs/v2/UserUpdateAttributes.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **disabled** | **bool** | If the user is enabled or disabled. | [optional] **email** | **str** | The email of the user. | [optional] **name** | **str** | The name of the user. | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserUpdateData.md b/docs/v2/UserUpdateData.md index a1d5b8f393..53f4715936 100644 --- a/docs/v2/UserUpdateData.md +++ b/docs/v2/UserUpdateData.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **attributes** | [**UserUpdateAttributes**](UserUpdateAttributes.md) | | **id** | **str** | ID of the user. | **type** | [**UsersType**](UsersType.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UserUpdateRequest.md b/docs/v2/UserUpdateRequest.md index d108c8cb0e..e41bcc3fd2 100644 --- a/docs/v2/UserUpdateRequest.md +++ b/docs/v2/UserUpdateRequest.md @@ -6,7 +6,8 @@ Update a user. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**UserUpdateData**](UserUpdateData.md) | | +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UsersResponse.md b/docs/v2/UsersResponse.md index 28dbd53fd9..b469645537 100644 --- a/docs/v2/UsersResponse.md +++ b/docs/v2/UsersResponse.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes **data** | [**[User]**](User.md) | Array of returned users. | [optional] **included** | [**[UserResponseIncludedItem]**](UserResponseIncludedItem.md) | Array of objects related to the users. | [optional] **meta** | [**ResponseMetaAttributes**](ResponseMetaAttributes.md) | | [optional] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/v2/UsersType.md b/docs/v2/UsersType.md index c0e40e1cf9..7a62f8b498 100644 --- a/docs/v2/UsersType.md +++ b/docs/v2/UsersType.md @@ -6,7 +6,8 @@ Users resource type. Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value** | **str** | Users resource type. | defaults to "users", must be one of ["users", ] +**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] -[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md) +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/src/datadog_api_client/v1/api_client.py b/src/datadog_api_client/v1/api_client.py index 5cc232a67a..d8d21cb9d6 100644 --- a/src/datadog_api_client/v1/api_client.py +++ b/src/datadog_api_client/v1/api_client.py @@ -124,7 +124,7 @@ def __call_api( _return_http_data_only: typing.Optional[bool] = None, collection_formats: typing.Optional[typing.Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, ): @@ -325,7 +325,7 @@ def call_api( _return_http_data_only: typing.Optional[bool] = None, collection_formats: typing.Optional[typing.Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, ): @@ -689,7 +689,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, headers_map=No "async_req": (bool,), "_host_index": (none_type, int), "_preload_content": (bool,), - "_request_timeout": (none_type, int, (int,), [int]), + "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), "_return_http_data_only": (bool,), "_check_input_type": (bool,), "_check_return_type": (bool,), diff --git a/src/datadog_api_client/v1/model/access_role.py b/src/datadog_api_client/v1/model/access_role.py index 82742dbe4d..2331b914ab 100644 --- a/src/datadog_api_client/v1/model/access_role.py +++ b/src/datadog_api_client/v1/model/access_role.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AccessRole(ModelSimple): @@ -53,7 +55,23 @@ class AccessRole(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -176,3 +196,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AccessRole - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The access role of the user. Options are **st** (standard user), **adm** (admin user), or **ro** (read-only user).. if omitted defaults to "st", must be one of ["st", "adm", "ro", "ERROR", ] # noqa: E501 + + Keyword Args: + value (str): The access role of the user. Options are **st** (standard user), **adm** (admin user), or **ro** (read-only user).. if omitted defaults to "st", must be one of ["st", "adm", "ro", "ERROR", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "st" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/alert_graph_widget_definition.py b/src/datadog_api_client/v1/model/alert_graph_widget_definition.py index ae19c05e3a..802a6d0e33 100644 --- a/src/datadog_api_client/v1/model/alert_graph_widget_definition.py +++ b/src/datadog_api_client/v1/model/alert_graph_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class AlertGraphWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, alert_id, type, viz_type, *args, **kwargs): # noqa: E501 + """AlertGraphWidgetDefinition - a model defined in OpenAPI + + Args: + alert_id (str): ID of the alert to use in the widget. + type (AlertGraphWidgetDefinitionType): + viz_type (WidgetVizType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + time (WidgetTime): [optional] # noqa: E501 + title (str): The title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.alert_id = alert_id + self.type = type + self.viz_type = viz_type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -197,3 +304,8 @@ def __init__(self, alert_id, type, viz_type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/alert_graph_widget_definition_type.py b/src/datadog_api_client/v1/model/alert_graph_widget_definition_type.py index c7c24d3c6a..ca6b05b942 100644 --- a/src/datadog_api_client/v1/model/alert_graph_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/alert_graph_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AlertGraphWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class AlertGraphWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AlertGraphWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the alert graph widget.. if omitted defaults to "alert_graph", must be one of ["alert_graph", ] # noqa: E501 + + Keyword Args: + value (str): Type of the alert graph widget.. if omitted defaults to "alert_graph", must be one of ["alert_graph", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "alert_graph" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/alert_value_widget_definition.py b/src/datadog_api_client/v1/model/alert_value_widget_definition.py index c5a773dfe7..6e7ff09907 100644 --- a/src/datadog_api_client/v1/model/alert_value_widget_definition.py +++ b/src/datadog_api_client/v1/model/alert_value_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class AlertValueWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, alert_id, type, *args, **kwargs): # noqa: E501 + """AlertValueWidgetDefinition - a model defined in OpenAPI + + Args: + alert_id (str): ID of the alert to use in the widget. + type (AlertValueWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + precision (int): Number of decimal to show. If not defined, will use the raw value.. [optional] # noqa: E501 + text_align (WidgetTextAlign): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of value in the widget.. [optional] # noqa: E501 + unit (str): Unit to display with the value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.alert_id = alert_id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -195,3 +302,8 @@ def __init__(self, alert_id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/alert_value_widget_definition_type.py b/src/datadog_api_client/v1/model/alert_value_widget_definition_type.py index 72da635403..8571c22883 100644 --- a/src/datadog_api_client/v1/model/alert_value_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/alert_value_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AlertValueWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class AlertValueWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AlertValueWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the alert value widget.. if omitted defaults to "alert_value", must be one of ["alert_value", ] # noqa: E501 + + Keyword Args: + value (str): Type of the alert value widget.. if omitted defaults to "alert_value", must be one of ["alert_value", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "alert_value" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/api_error_response.py b/src/datadog_api_client/v1/model/api_error_response.py index 71dd3d3b33..0af458aca4 100644 --- a/src/datadog_api_client/v1/model/api_error_response.py +++ b/src/datadog_api_client/v1/model/api_error_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class APIErrorResponse(ModelNormal): @@ -50,7 +52,23 @@ class APIErrorResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, errors, *args, **kwargs): # noqa: E501 + """APIErrorResponse - a model defined in OpenAPI + + Args: + errors ([str]): Array of errors returned by the API. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.errors = errors + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, errors, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/api_key.py b/src/datadog_api_client/v1/model/api_key.py index a9e944cfcb..c0183db1b5 100644 --- a/src/datadog_api_client/v1/model/api_key.py +++ b/src/datadog_api_client/v1/model/api_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ApiKey(ModelNormal): @@ -55,7 +57,23 @@ class ApiKey(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +107,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApiKey - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (str): Date of creation of the API key.. [optional] # noqa: E501 + created_by (str): Datadog user handle that created the API key.. [optional] # noqa: E501 + key (str): API key.. [optional] # noqa: E501 + name (str): Name of your API key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +273,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/api_key_list_response.py b/src/datadog_api_client/v1/model/api_key_list_response.py index 3887546307..d768952549 100644 --- a/src/datadog_api_client/v1/model/api_key_list_response.py +++ b/src/datadog_api_client/v1/model/api_key_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApiKeyListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApiKeyListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + api_keys ([ApiKey]): Array of API keys.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/api_key_response.py b/src/datadog_api_client/v1/model/api_key_response.py index acb9244efe..05d761ed25 100644 --- a/src/datadog_api_client/v1/model/api_key_response.py +++ b/src/datadog_api_client/v1/model/api_key_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApiKeyResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApiKeyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + api_key (ApiKey): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/apm_stats_query_column_type.py b/src/datadog_api_client/v1/model/apm_stats_query_column_type.py index c978d5d853..647c9ed904 100644 --- a/src/datadog_api_client/v1/model/apm_stats_query_column_type.py +++ b/src/datadog_api_client/v1/model/apm_stats_query_column_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ApmStatsQueryColumnType(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """ApmStatsQueryColumnType - a model defined in OpenAPI + + Args: + name (str): Column name. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alias (str): A user-assigned alias for the column.. [optional] # noqa: E501 + cell_display_mode (TableWidgetCellDisplayMode): [optional] # noqa: E501 + order (WidgetSort): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/apm_stats_query_definition.py b/src/datadog_api_client/v1/model/apm_stats_query_definition.py index fc491e2398..0561d4d02d 100644 --- a/src/datadog_api_client/v1/model/apm_stats_query_definition.py +++ b/src/datadog_api_client/v1/model/apm_stats_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ApmStatsQueryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, env, name, primary_tag, row_type, service, *args, **kwargs): # noqa: E501 + """ApmStatsQueryDefinition - a model defined in OpenAPI + + Args: + env (str): Environment name. + name (str): Operation name associated with service. + primary_tag (str): The organization's host group name and value. + row_type (ApmStatsQueryRowType): + service (str): Service name. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + columns ([ApmStatsQueryColumnType]): Column properties used by the front end for display.. [optional] # noqa: E501 + resource (str): Resource name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.env = env + self.name = name + self.primary_tag = primary_tag + self.row_type = row_type + self.service = service + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -195,3 +304,8 @@ def __init__(self, env, name, primary_tag, row_type, service, *args, **kwargs): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/apm_stats_query_row_type.py b/src/datadog_api_client/v1/model/apm_stats_query_row_type.py index 78b6ea3db7..bc5e769935 100644 --- a/src/datadog_api_client/v1/model/apm_stats_query_row_type.py +++ b/src/datadog_api_client/v1/model/apm_stats_query_row_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ApmStatsQueryRowType(ModelSimple): @@ -52,7 +54,23 @@ class ApmStatsQueryRowType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ApmStatsQueryRowType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The level of detail for the request.., must be one of ["service", "resource", "span", ] # noqa: E501 + + Keyword Args: + value (str): The level of detail for the request.., must be one of ["service", "resource", "span", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/application_key.py b/src/datadog_api_client/v1/model/application_key.py index 8ac858b840..7c244f26d8 100644 --- a/src/datadog_api_client/v1/model/application_key.py +++ b/src/datadog_api_client/v1/model/application_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ApplicationKey(ModelNormal): @@ -55,7 +57,23 @@ class ApplicationKey(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +105,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApplicationKey - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hash (str): Hash of an application key.. [optional] # noqa: E501 + name (str): Name of an application key.. [optional] # noqa: E501 + owner (str): Owner of an application key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -172,3 +269,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/application_key_list_response.py b/src/datadog_api_client/v1/model/application_key_list_response.py index 1fed671677..46ef9c51a0 100644 --- a/src/datadog_api_client/v1/model/application_key_list_response.py +++ b/src/datadog_api_client/v1/model/application_key_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApplicationKeyListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApplicationKeyListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + application_keys ([ApplicationKey]): Array of application keys.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/application_key_response.py b/src/datadog_api_client/v1/model/application_key_response.py index 5ac836843d..4eeb5dda9f 100644 --- a/src/datadog_api_client/v1/model/application_key_response.py +++ b/src/datadog_api_client/v1/model/application_key_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApplicationKeyResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApplicationKeyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + application_key (ApplicationKey): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/authentication_validation_response.py b/src/datadog_api_client/v1/model/authentication_validation_response.py index 3d88a766cd..fd79e34db8 100644 --- a/src/datadog_api_client/v1/model/authentication_validation_response.py +++ b/src/datadog_api_client/v1/model/authentication_validation_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AuthenticationValidationResponse(ModelNormal): @@ -50,7 +52,23 @@ class AuthenticationValidationResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AuthenticationValidationResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + valid (bool): Return `true` if the authentication response is valid.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_account.py b/src/datadog_api_client/v1/model/aws_account.py index 1fc0b405f6..52b179d24a 100644 --- a/src/datadog_api_client/v1/model/aws_account.py +++ b/src/datadog_api_client/v1/model/aws_account.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSAccount(ModelNormal): @@ -50,7 +52,23 @@ class AWSAccount(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + access_key_id (str): Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.. [optional] # noqa: E501 + account_id (str): Your AWS Account ID without dashes.. [optional] # noqa: E501 + account_specific_namespace_rules ({str: (bool,)}): An object, (in the form `{\"namespace1\":true/false, \"namespace2\":true/false}`), that enables or disables metric collection for specific AWS namespaces for this AWS account only.. [optional] # noqa: E501 + excluded_regions ([str]): An array of AWS regions to exclude from metrics collection.. [optional] # noqa: E501 + filter_tags ([str]): The array of EC2 tags (in the form `key:value`) defines a filter that Datadog uses when collecting metrics from EC2. Wildcards, such as `?` (for single characters) and `*` (for multiple characters) can also be used. Only hosts that match one of the defined tags will be imported into Datadog. The rest will be ignored. Host matching a given tag can also be excluded by adding `!` before the tag. For example, `env:production,instance-type:c1.*,!region:us-east-1`. [optional] # noqa: E501 + host_tags ([str]): Array of tags (in the form `key:value`) to add to all hosts and metrics reporting through this integration.. [optional] # noqa: E501 + role_name (str): Your Datadog role delegation name.. [optional] # noqa: E501 + secret_access_key (str): Your AWS secret access key. Only required if your AWS account is a GovCloud or China account.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_account_and_lambda_request.py b/src/datadog_api_client/v1/model/aws_account_and_lambda_request.py index a9af92baf7..391578d29d 100644 --- a/src/datadog_api_client/v1/model/aws_account_and_lambda_request.py +++ b/src/datadog_api_client/v1/model/aws_account_and_lambda_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSAccountAndLambdaRequest(ModelNormal): @@ -50,7 +52,23 @@ class AWSAccountAndLambdaRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, account_id, lambda_arn, *args, **kwargs): # noqa: E501 + """AWSAccountAndLambdaRequest - a model defined in OpenAPI + + Args: + account_id (str): Your AWS Account ID without dashes. + lambda_arn (str): ARN of the Datadog Lambda created during the Datadog-Amazon Web services Log collection setup. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.account_id = account_id + self.lambda_arn = lambda_arn + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, account_id, lambda_arn, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_account_create_response.py b/src/datadog_api_client/v1/model/aws_account_create_response.py index 292bb20bfa..4e37b0bdb0 100644 --- a/src/datadog_api_client/v1/model/aws_account_create_response.py +++ b/src/datadog_api_client/v1/model/aws_account_create_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSAccountCreateResponse(ModelNormal): @@ -50,7 +52,23 @@ class AWSAccountCreateResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSAccountCreateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + external_id (str): AWS external_id.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_account_delete_request.py b/src/datadog_api_client/v1/model/aws_account_delete_request.py index 19c4ba9728..e5795a77f7 100644 --- a/src/datadog_api_client/v1/model/aws_account_delete_request.py +++ b/src/datadog_api_client/v1/model/aws_account_delete_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSAccountDeleteRequest(ModelNormal): @@ -50,7 +52,23 @@ class AWSAccountDeleteRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSAccountDeleteRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + access_key_id (str): Your AWS access key ID. Only required if your AWS account is a GovCloud or China account.. [optional] # noqa: E501 + account_id (str): Your AWS Account ID without dashes.. [optional] # noqa: E501 + role_name (str): Your Datadog role delegation name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_account_list_response.py b/src/datadog_api_client/v1/model/aws_account_list_response.py index 7cb49bb981..eb6e1601eb 100644 --- a/src/datadog_api_client/v1/model/aws_account_list_response.py +++ b/src/datadog_api_client/v1/model/aws_account_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSAccountListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSAccountListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + accounts ([AWSAccount]): List of enabled AWS accounts.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_logs_async_error.py b/src/datadog_api_client/v1/model/aws_logs_async_error.py index da8d6cf9cc..9c4e8ee72f 100644 --- a/src/datadog_api_client/v1/model/aws_logs_async_error.py +++ b/src/datadog_api_client/v1/model/aws_logs_async_error.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSLogsAsyncError(ModelNormal): @@ -50,7 +52,23 @@ class AWSLogsAsyncError(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSLogsAsyncError - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + code (str): Code properties. [optional] # noqa: E501 + message (str): Message content.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_logs_async_response.py b/src/datadog_api_client/v1/model/aws_logs_async_response.py index 14dc9d6ff5..9b1c0db61b 100644 --- a/src/datadog_api_client/v1/model/aws_logs_async_response.py +++ b/src/datadog_api_client/v1/model/aws_logs_async_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSLogsAsyncResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSLogsAsyncResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + errors ([AWSLogsAsyncError]): List of errors.. [optional] # noqa: E501 + status (str): Status of the properties.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_logs_lambda.py b/src/datadog_api_client/v1/model/aws_logs_lambda.py index a97bdd252f..c2e4161321 100644 --- a/src/datadog_api_client/v1/model/aws_logs_lambda.py +++ b/src/datadog_api_client/v1/model/aws_logs_lambda.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSLogsLambda(ModelNormal): @@ -50,7 +52,23 @@ class AWSLogsLambda(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSLogsLambda - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + arn (str): Available ARN IDs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_logs_list_response.py b/src/datadog_api_client/v1/model/aws_logs_list_response.py index d80b819bf5..b7105e7602 100644 --- a/src/datadog_api_client/v1/model/aws_logs_list_response.py +++ b/src/datadog_api_client/v1/model/aws_logs_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSLogsListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSLogsListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account_id (str): Your AWS Account ID without dashes.. [optional] # noqa: E501 + lambdas ([AWSLogsLambda]): List of ARNs configured in your Datadog account.. [optional] # noqa: E501 + services ([str]): Array of services IDs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_logs_list_services_response.py b/src/datadog_api_client/v1/model/aws_logs_list_services_response.py index 0541688cf9..1e66ba5174 100644 --- a/src/datadog_api_client/v1/model/aws_logs_list_services_response.py +++ b/src/datadog_api_client/v1/model/aws_logs_list_services_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSLogsListServicesResponse(ModelNormal): @@ -50,7 +52,23 @@ class AWSLogsListServicesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSLogsListServicesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): Key value in returned object.. [optional] # noqa: E501 + label (str): Name of service available for configuration with Datadog logs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_logs_services_request.py b/src/datadog_api_client/v1/model/aws_logs_services_request.py index 7c1cf2d573..800967a0ca 100644 --- a/src/datadog_api_client/v1/model/aws_logs_services_request.py +++ b/src/datadog_api_client/v1/model/aws_logs_services_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSLogsServicesRequest(ModelNormal): @@ -50,7 +52,23 @@ class AWSLogsServicesRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, account_id, services, *args, **kwargs): # noqa: E501 + """AWSLogsServicesRequest - a model defined in OpenAPI + + Args: + account_id (str): Your AWS Account ID without dashes. + services ([str]): Array of services IDs set to enable automatic log collection. Discover the list of available services with the get list of AWS log ready services API endpoint. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.account_id = account_id + self.services = services + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, account_id, services, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_namespace.py b/src/datadog_api_client/v1/model/aws_namespace.py index 445b392be2..9caac5dcbb 100644 --- a/src/datadog_api_client/v1/model/aws_namespace.py +++ b/src/datadog_api_client/v1/model/aws_namespace.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AWSNamespace(ModelSimple): @@ -56,7 +58,23 @@ class AWSNamespace(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AWSNamespace - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The namespace associated with the tag filter entry.., must be one of ["elb", "application_elb", "sqs", "rds", "custom", "network_elb", "lambda", ] # noqa: E501 + + Keyword Args: + value (str): The namespace associated with the tag filter entry.., must be one of ["elb", "application_elb", "sqs", "rds", "custom", "network_elb", "lambda", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/aws_tag_filter.py b/src/datadog_api_client/v1/model/aws_tag_filter.py index 274af8e019..17050a9a06 100644 --- a/src/datadog_api_client/v1/model/aws_tag_filter.py +++ b/src/datadog_api_client/v1/model/aws_tag_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSTagFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSTagFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + namespace (AWSNamespace): [optional] # noqa: E501 + tag_filter_str (str): The tag filter string.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py b/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py index 390ac737d0..e44e86e042 100644 --- a/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py +++ b/src/datadog_api_client/v1/model/aws_tag_filter_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSTagFilterCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSTagFilterCreateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account_id (str): Your AWS Account ID without dashes.. [optional] # noqa: E501 + namespace (AWSNamespace): [optional] # noqa: E501 + tag_filter_str (str): The tag filter string.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_tag_filter_delete_request.py b/src/datadog_api_client/v1/model/aws_tag_filter_delete_request.py index ecd855c7cf..215d8a6c07 100644 --- a/src/datadog_api_client/v1/model/aws_tag_filter_delete_request.py +++ b/src/datadog_api_client/v1/model/aws_tag_filter_delete_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSTagFilterDeleteRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSTagFilterDeleteRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account_id (str): The unique identifier of your AWS account.. [optional] # noqa: E501 + namespace (AWSNamespace): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/aws_tag_filter_list_response.py b/src/datadog_api_client/v1/model/aws_tag_filter_list_response.py index fa7eb7e024..5cd9813caa 100644 --- a/src/datadog_api_client/v1/model/aws_tag_filter_list_response.py +++ b/src/datadog_api_client/v1/model/aws_tag_filter_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class AWSTagFilterListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AWSTagFilterListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filters ([AWSTagFilter]): An array of tag filters.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/azure_account.py b/src/datadog_api_client/v1/model/azure_account.py index 3627a56db6..6f5340a43f 100644 --- a/src/datadog_api_client/v1/model/azure_account.py +++ b/src/datadog_api_client/v1/model/azure_account.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class AzureAccount(ModelNormal): @@ -50,7 +52,23 @@ class AzureAccount(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """AzureAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + client_id (str): Your Azure web application ID.. [optional] # noqa: E501 + client_secret (str): Your Azure web application secret key.. [optional] # noqa: E501 + errors ([str]): Errors in your configuration.. [optional] # noqa: E501 + host_filters (str): Limit the Azure instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.. [optional] # noqa: E501 + new_client_id (str): Your New Azure web application ID.. [optional] # noqa: E501 + new_tenant_name (str): Your New Azure Active Directory ID.. [optional] # noqa: E501 + tenant_name (str): Your Azure Active Directory ID.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/azure_account_list_response.py b/src/datadog_api_client/v1/model/azure_account_list_response.py index 508a3eed4d..423e03de06 100644 --- a/src/datadog_api_client/v1/model/azure_account_list_response.py +++ b/src/datadog_api_client/v1/model/azure_account_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class AzureAccountListResponse(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """AzureAccountListResponse - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([AzureAccount]): Accounts configured for your organization.. # noqa: E501 + + Keyword Args: + value ([AzureAccount]): Accounts configured for your organization.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/cancel_downtimes_by_scope_request.py b/src/datadog_api_client/v1/model/cancel_downtimes_by_scope_request.py index 3b8582368b..3c17e2fa4c 100644 --- a/src/datadog_api_client/v1/model/cancel_downtimes_by_scope_request.py +++ b/src/datadog_api_client/v1/model/cancel_downtimes_by_scope_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class CancelDowntimesByScopeRequest(ModelNormal): @@ -50,7 +52,23 @@ class CancelDowntimesByScopeRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, scope, *args, **kwargs): # noqa: E501 + """CancelDowntimesByScopeRequest - a model defined in OpenAPI + + Args: + scope (str): The scope(s) to which the downtime applies. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`). + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.scope = scope + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, scope, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/canceled_downtimes_ids.py b/src/datadog_api_client/v1/model/canceled_downtimes_ids.py index a4ddbeeeac..77ab8b08f6 100644 --- a/src/datadog_api_client/v1/model/canceled_downtimes_ids.py +++ b/src/datadog_api_client/v1/model/canceled_downtimes_ids.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class CanceledDowntimesIds(ModelNormal): @@ -50,7 +52,23 @@ class CanceledDowntimesIds(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CanceledDowntimesIds - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cancelled_ids ([int]): ID of downtimes that were canceled.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/change_widget_definition.py b/src/datadog_api_client/v1/model/change_widget_definition.py index d153b9b427..a2abc1e8f6 100644 --- a/src/datadog_api_client/v1/model/change_widget_definition.py +++ b/src/datadog_api_client/v1/model/change_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -69,7 +71,24 @@ class ChangeWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -110,6 +129,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """ChangeWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([ChangeWidgetRequest]): Array of one request object to display in the widget. See the dedicated [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json) to learn how to build the `REQUEST_SCHEMA`. + type (ChangeWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +309,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/change_widget_definition_type.py b/src/datadog_api_client/v1/model/change_widget_definition_type.py index e68c3f4673..1a17343f9b 100644 --- a/src/datadog_api_client/v1/model/change_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/change_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ChangeWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ChangeWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ChangeWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the change widget.. if omitted defaults to "change", must be one of ["change", ] # noqa: E501 + + Keyword Args: + value (str): Type of the change widget.. if omitted defaults to "change", must be one of ["change", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "change" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/change_widget_request.py b/src/datadog_api_client/v1/model/change_widget_request.py index c125b1673c..4cbaf5eef0 100644 --- a/src/datadog_api_client/v1/model/change_widget_request.py +++ b/src/datadog_api_client/v1/model/change_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class ChangeWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -123,6 +142,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ChangeWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_query (LogQueryDefinition): [optional] # noqa: E501 + change_type (WidgetChangeType): [optional] # noqa: E501 + compare_to (WidgetCompareTo): [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + increase_good (bool): Whether to show increase as good.. [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + order_by (WidgetOrderBy): [optional] # noqa: E501 + order_dir (WidgetSort): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Query definition.. [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + show_present (bool): Whether to show the present value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -220,3 +330,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/check_can_delete_monitor_response.py b/src/datadog_api_client/v1/model/check_can_delete_monitor_response.py index bfbde67df7..c3375add21 100644 --- a/src/datadog_api_client/v1/model/check_can_delete_monitor_response.py +++ b/src/datadog_api_client/v1/model/check_can_delete_monitor_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class CheckCanDeleteMonitorResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """CheckCanDeleteMonitorResponse - a model defined in OpenAPI + + Args: + data (CheckCanDeleteMonitorResponseData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + errors ({str: ([str],)}): A mapping of Monitor ID to strings denoting where it's used.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +274,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/check_can_delete_monitor_response_data.py b/src/datadog_api_client/v1/model/check_can_delete_monitor_response_data.py index 600af7cf33..64548baafb 100644 --- a/src/datadog_api_client/v1/model/check_can_delete_monitor_response_data.py +++ b/src/datadog_api_client/v1/model/check_can_delete_monitor_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class CheckCanDeleteMonitorResponseData(ModelNormal): @@ -50,7 +52,23 @@ class CheckCanDeleteMonitorResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CheckCanDeleteMonitorResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + ok ([int]): An array of of Monitor IDs that can be safely deleted.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/check_can_delete_slo_response.py b/src/datadog_api_client/v1/model/check_can_delete_slo_response.py index c854f5f91b..6d73df48d5 100644 --- a/src/datadog_api_client/v1/model/check_can_delete_slo_response.py +++ b/src/datadog_api_client/v1/model/check_can_delete_slo_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class CheckCanDeleteSLOResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CheckCanDeleteSLOResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (CheckCanDeleteSLOResponseData): [optional] # noqa: E501 + errors ({str: (str,)}): A mapping of SLO id to it's current usages.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/check_can_delete_slo_response_data.py b/src/datadog_api_client/v1/model/check_can_delete_slo_response_data.py index c95d0fe383..a95bbfcfbf 100644 --- a/src/datadog_api_client/v1/model/check_can_delete_slo_response_data.py +++ b/src/datadog_api_client/v1/model/check_can_delete_slo_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class CheckCanDeleteSLOResponseData(ModelNormal): @@ -50,7 +52,23 @@ class CheckCanDeleteSLOResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """CheckCanDeleteSLOResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + ok ([str]): An array of of SLO IDs that can be safely deleted.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/check_status_widget_definition.py b/src/datadog_api_client/v1/model/check_status_widget_definition.py index c8c9dec36c..5e19edc457 100644 --- a/src/datadog_api_client/v1/model/check_status_widget_definition.py +++ b/src/datadog_api_client/v1/model/check_status_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class CheckStatusWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, check, grouping, type, *args, **kwargs): # noqa: E501 + """CheckStatusWidgetDefinition - a model defined in OpenAPI + + Args: + check (str): Name of the check to use in the widget. + grouping (WidgetGrouping): + type (CheckStatusWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + group (str): Group reporting a single check.. [optional] # noqa: E501 + group_by ([str]): List of tag prefixes to group by in the case of a cluster check.. [optional] # noqa: E501 + tags ([str]): List of tags used to filter the groups reporting a cluster check.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.check = check + self.grouping = grouping + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -206,3 +316,8 @@ def __init__(self, check, grouping, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/check_status_widget_definition_type.py b/src/datadog_api_client/v1/model/check_status_widget_definition_type.py index 4719c03c3c..f381494bdb 100644 --- a/src/datadog_api_client/v1/model/check_status_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/check_status_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class CheckStatusWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class CheckStatusWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """CheckStatusWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the check status widget.. if omitted defaults to "check_status", must be one of ["check_status", ] # noqa: E501 + + Keyword Args: + value (str): Type of the check status widget.. if omitted defaults to "check_status", must be one of ["check_status", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "check_status" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/content_encoding.py b/src/datadog_api_client/v1/model/content_encoding.py index fb91d6e2e2..f2e0d8b3a3 100644 --- a/src/datadog_api_client/v1/model/content_encoding.py +++ b/src/datadog_api_client/v1/model/content_encoding.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ContentEncoding(ModelSimple): @@ -51,7 +53,23 @@ class ContentEncoding(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ContentEncoding - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): HTTP header used to compress the media-type., must be one of ["gzip", "deflate", ] # noqa: E501 + + Keyword Args: + value (str): HTTP header used to compress the media-type., must be one of ["gzip", "deflate", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/creator.py b/src/datadog_api_client/v1/model/creator.py index 9f2c603f1e..74d3857137 100644 --- a/src/datadog_api_client/v1/model/creator.py +++ b/src/datadog_api_client/v1/model/creator.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class Creator(ModelNormal): @@ -50,7 +52,23 @@ class Creator(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Creator - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + email (str): Email of the creator.. [optional] # noqa: E501 + handle (str): Handle of the creator.. [optional] # noqa: E501 + name (str): Name of the creator.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard.py b/src/datadog_api_client/v1/model/dashboard.py index c522a79e4a..217704f908 100644 --- a/src/datadog_api_client/v1/model/dashboard.py +++ b/src/datadog_api_client/v1/model/dashboard.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class Dashboard(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -133,6 +152,102 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, layout_type, title, widgets, *args, **kwargs): # noqa: E501 + """Dashboard - a model defined in OpenAPI + + Args: + layout_type (DashboardLayoutType): + title (str): Title of the dashboard. + widgets ([Widget]): List of widgets to display on the dashboard. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + author_handle (str): Identifier of the dashboard author.. [optional] # noqa: E501 + created_at (datetime): Creation date of the dashboard.. [optional] # noqa: E501 + description (str, none_type): Description of the dashboard.. [optional] # noqa: E501 + id (str): ID of the dashboard.. [optional] # noqa: E501 + is_read_only (bool): Whether this dashboard is read-only. If True, only the author and admins can make changes to it.. [optional] if omitted the server will use the default value of False # noqa: E501 + modified_at (datetime): Modification date of the dashboard.. [optional] # noqa: E501 + notify_list ([str], none_type): List of handles of users to notify when changes are made to this dashboard.. [optional] # noqa: E501 + reflow_type (DashboardReflowType): [optional] # noqa: E501 + restricted_roles ([str]): A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard. Overrides the `is_read_only` property if both are present. **This feature is currently in beta.**. [optional] # noqa: E501 + template_variable_presets ([DashboardTemplateVariablePreset], none_type): Array of template variables saved views.. [optional] # noqa: E501 + template_variables ([DashboardTemplateVariable], none_type): List of template variables for this dashboard.. [optional] # noqa: E501 + url (str): The URL of the dashboard.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.layout_type = layout_type + self.title = title + self.widgets = widgets + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -235,3 +350,8 @@ def __init__(self, layout_type, title, widgets, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_bulk_action_data.py b/src/datadog_api_client/v1/model/dashboard_bulk_action_data.py index 0d5982afb7..d2a6540a96 100644 --- a/src/datadog_api_client/v1/model/dashboard_bulk_action_data.py +++ b/src/datadog_api_client/v1/model/dashboard_bulk_action_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardBulkActionData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """DashboardBulkActionData - a model defined in OpenAPI + + Args: + id (str): Dashboard resource ID. + type (DashboardResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_bulk_action_data_list.py b/src/datadog_api_client/v1/model/dashboard_bulk_action_data_list.py index 6f25ae7b6b..a40a0a608d 100644 --- a/src/datadog_api_client/v1/model/dashboard_bulk_action_data_list.py +++ b/src/datadog_api_client/v1/model/dashboard_bulk_action_data_list.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class DashboardBulkActionDataList(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DashboardBulkActionDataList - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([DashboardBulkActionData]): List of dashboard bulk action request data objects.. # noqa: E501 + + Keyword Args: + value ([DashboardBulkActionData]): List of dashboard bulk action request data objects.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/dashboard_bulk_delete_request.py b/src/datadog_api_client/v1/model/dashboard_bulk_delete_request.py index 15a1c06666..47812871fb 100644 --- a/src/datadog_api_client/v1/model/dashboard_bulk_delete_request.py +++ b/src/datadog_api_client/v1/model/dashboard_bulk_delete_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardBulkDeleteRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """DashboardBulkDeleteRequest - a model defined in OpenAPI + + Args: + data (DashboardBulkActionDataList): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_delete_response.py b/src/datadog_api_client/v1/model/dashboard_delete_response.py index 370a63f4d1..a2c73130c1 100644 --- a/src/datadog_api_client/v1/model/dashboard_delete_response.py +++ b/src/datadog_api_client/v1/model/dashboard_delete_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardDeleteResponse(ModelNormal): @@ -50,7 +52,23 @@ class DashboardDeleteResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardDeleteResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted_dashboard_id (str): ID of the deleted dashboard.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_layout_type.py b/src/datadog_api_client/v1/model/dashboard_layout_type.py index e80aff5051..67a1e4ba59 100644 --- a/src/datadog_api_client/v1/model/dashboard_layout_type.py +++ b/src/datadog_api_client/v1/model/dashboard_layout_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardLayoutType(ModelSimple): @@ -51,7 +53,23 @@ class DashboardLayoutType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DashboardLayoutType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Layout type of the dashboard.., must be one of ["ordered", "free", ] # noqa: E501 + + Keyword Args: + value (str): Layout type of the dashboard.., must be one of ["ordered", "free", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/dashboard_list.py b/src/datadog_api_client/v1/model/dashboard_list.py index 00bbc2d5a8..2359c144ae 100644 --- a/src/datadog_api_client/v1/model/dashboard_list.py +++ b/src/datadog_api_client/v1/model/dashboard_list.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardList(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """DashboardList - a model defined in OpenAPI + + Args: + name (str): The name of the dashboard list. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + author (Creator): [optional] # noqa: E501 + created (datetime): Date of creation of the dashboard list.. [optional] # noqa: E501 + dashboard_count (int): The number of dashboards in the list.. [optional] # noqa: E501 + id (int): The ID of the dashboard list.. [optional] # noqa: E501 + is_favorite (bool): Whether or not the list is in the favorites.. [optional] # noqa: E501 + modified (datetime): Date of last edition of the dashboard list.. [optional] # noqa: E501 + type (str): The type of dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +298,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_list_delete_response.py b/src/datadog_api_client/v1/model/dashboard_list_delete_response.py index 5de953784a..05ac7dde6f 100644 --- a/src/datadog_api_client/v1/model/dashboard_list_delete_response.py +++ b/src/datadog_api_client/v1/model/dashboard_list_delete_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardListDeleteResponse(ModelNormal): @@ -50,7 +52,23 @@ class DashboardListDeleteResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListDeleteResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted_dashboard_list_id (int): ID of the deleted dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_list_list_response.py b/src/datadog_api_client/v1/model/dashboard_list_list_response.py index 72b2138eda..edd13c6163 100644 --- a/src/datadog_api_client/v1/model/dashboard_list_list_response.py +++ b/src/datadog_api_client/v1/model/dashboard_list_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dashboard_lists ([DashboardList]): List of all your dashboard lists.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_reflow_type.py b/src/datadog_api_client/v1/model/dashboard_reflow_type.py index a7c5ffec27..ea7b08e2c9 100644 --- a/src/datadog_api_client/v1/model/dashboard_reflow_type.py +++ b/src/datadog_api_client/v1/model/dashboard_reflow_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardReflowType(ModelSimple): @@ -51,7 +53,23 @@ class DashboardReflowType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DashboardReflowType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Reflow type for a **new dashboard layout** dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts.., must be one of ["auto", "fixed", ] # noqa: E501 + + Keyword Args: + value (str): Reflow type for a **new dashboard layout** dashboard. Set this only when layout type is 'ordered'. If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto', widgets should not have layouts.., must be one of ["auto", "fixed", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/dashboard_resource_type.py b/src/datadog_api_client/v1/model/dashboard_resource_type.py index 7c0a0e23c4..e9052a16ef 100644 --- a/src/datadog_api_client/v1/model/dashboard_resource_type.py +++ b/src/datadog_api_client/v1/model/dashboard_resource_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardResourceType(ModelSimple): @@ -50,7 +52,23 @@ class DashboardResourceType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DashboardResourceType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Dashboard resource type.. if omitted defaults to "dashboard", must be one of ["dashboard", ] # noqa: E501 + + Keyword Args: + value (str): Dashboard resource type.. if omitted defaults to "dashboard", must be one of ["dashboard", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "dashboard" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/dashboard_restore_request.py b/src/datadog_api_client/v1/model/dashboard_restore_request.py index c17d0d6e46..39b5ed1cd2 100644 --- a/src/datadog_api_client/v1/model/dashboard_restore_request.py +++ b/src/datadog_api_client/v1/model/dashboard_restore_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardRestoreRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """DashboardRestoreRequest - a model defined in OpenAPI + + Args: + data (DashboardBulkActionDataList): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_summary.py b/src/datadog_api_client/v1/model/dashboard_summary.py index 6fc29b9b70..0ee003dea1 100644 --- a/src/datadog_api_client/v1/model/dashboard_summary.py +++ b/src/datadog_api_client/v1/model/dashboard_summary.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardSummary(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardSummary - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dashboards ([DashboardSummaryDefinition]): List of dashboard definitions.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_summary_definition.py b/src/datadog_api_client/v1/model/dashboard_summary_definition.py index d10e516dc5..abfa259562 100644 --- a/src/datadog_api_client/v1/model/dashboard_summary_definition.py +++ b/src/datadog_api_client/v1/model/dashboard_summary_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardSummaryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardSummaryDefinition - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + author_handle (str): Identifier of the dashboard author.. [optional] # noqa: E501 + created_at (datetime): Creation date of the dashboard.. [optional] # noqa: E501 + description (str): Description of the dashboard.. [optional] # noqa: E501 + id (str): Dashboard identifier.. [optional] # noqa: E501 + is_read_only (bool): Whether this dashboard is read-only. If True, only the author and admins can make changes to it.. [optional] # noqa: E501 + layout_type (DashboardLayoutType): [optional] # noqa: E501 + modified_at (datetime): Modification date of the dashboard.. [optional] # noqa: E501 + title (str): Title of the dashboard.. [optional] # noqa: E501 + url (str): URL of the dashboard.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +296,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_template_variable.py b/src/datadog_api_client/v1/model/dashboard_template_variable.py index a03a00a1eb..ba7f33c498 100644 --- a/src/datadog_api_client/v1/model/dashboard_template_variable.py +++ b/src/datadog_api_client/v1/model/dashboard_template_variable.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardTemplateVariable(ModelNormal): @@ -50,7 +52,23 @@ class DashboardTemplateVariable(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """DashboardTemplateVariable - a model defined in OpenAPI + + Args: + name (str): The name of the variable. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + default (str, none_type): The default value for the template variable on dashboard load.. [optional] # noqa: E501 + prefix (str, none_type): The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_template_variable_preset.py b/src/datadog_api_client/v1/model/dashboard_template_variable_preset.py index 1cae53e2f8..12a23803b9 100644 --- a/src/datadog_api_client/v1/model/dashboard_template_variable_preset.py +++ b/src/datadog_api_client/v1/model/dashboard_template_variable_preset.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class DashboardTemplateVariablePreset(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardTemplateVariablePreset - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the variable.. [optional] # noqa: E501 + template_variables ([DashboardTemplateVariablePresetValue]): List of variables.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/dashboard_template_variable_preset_value.py b/src/datadog_api_client/v1/model/dashboard_template_variable_preset_value.py index ac3c88b86c..a38a47b0bd 100644 --- a/src/datadog_api_client/v1/model/dashboard_template_variable_preset_value.py +++ b/src/datadog_api_client/v1/model/dashboard_template_variable_preset_value.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DashboardTemplateVariablePresetValue(ModelNormal): @@ -50,7 +52,23 @@ class DashboardTemplateVariablePresetValue(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardTemplateVariablePresetValue - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the variable.. [optional] # noqa: E501 + value (str): The value of the template variable within the saved view.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/deleted_monitor.py b/src/datadog_api_client/v1/model/deleted_monitor.py index cbbad702ab..28c8359901 100644 --- a/src/datadog_api_client/v1/model/deleted_monitor.py +++ b/src/datadog_api_client/v1/model/deleted_monitor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DeletedMonitor(ModelNormal): @@ -50,7 +52,23 @@ class DeletedMonitor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DeletedMonitor - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted_monitor_id (int): ID of the deleted monitor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/distribution_widget_definition.py b/src/datadog_api_client/v1/model/distribution_widget_definition.py index ceeedcfcd7..57d8363f90 100644 --- a/src/datadog_api_client/v1/model/distribution_widget_definition.py +++ b/src/datadog_api_client/v1/model/distribution_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -73,7 +75,24 @@ class DistributionWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -122,6 +141,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """DistributionWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([DistributionWidgetRequest]): Array of one request object to display in the widget. See the dedicated [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json) to learn how to build the `REQUEST_SCHEMA`. + type (DistributionWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + legend_size (str): (Deprecated) The widget legend was replaced by a tooltip and sidebar.. [optional] # noqa: E501 + markers ([WidgetMarker]): List of markers.. [optional] # noqa: E501 + show_legend (bool): (Deprecated) The widget legend was replaced by a tooltip and sidebar.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + xaxis (DistributionWidgetXAxis): [optional] # noqa: E501 + yaxis (DistributionWidgetYAxis): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -219,3 +329,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/distribution_widget_definition_type.py b/src/datadog_api_client/v1/model/distribution_widget_definition_type.py index 9d11b6a789..b49fa6601c 100644 --- a/src/datadog_api_client/v1/model/distribution_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/distribution_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DistributionWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class DistributionWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DistributionWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the distribution widget.. if omitted defaults to "distribution", must be one of ["distribution", ] # noqa: E501 + + Keyword Args: + value (str): Type of the distribution widget.. if omitted defaults to "distribution", must be one of ["distribution", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "distribution" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/distribution_widget_request.py b/src/datadog_api_client/v1/model/distribution_widget_request.py index 4a67453f04..179604d49c 100644 --- a/src/datadog_api_client/v1/model/distribution_widget_request.py +++ b/src/datadog_api_client/v1/model/distribution_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class DistributionWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -107,6 +126,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DistributionWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_query (LogQueryDefinition): [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Widget query.. [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + style (WidgetStyle): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -199,3 +304,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/distribution_widget_x_axis.py b/src/datadog_api_client/v1/model/distribution_widget_x_axis.py index 6e856e2d4d..2d84098801 100644 --- a/src/datadog_api_client/v1/model/distribution_widget_x_axis.py +++ b/src/datadog_api_client/v1/model/distribution_widget_x_axis.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DistributionWidgetXAxis(ModelNormal): @@ -50,7 +52,23 @@ class DistributionWidgetXAxis(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DistributionWidgetXAxis - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_zero (bool): True includes zero.. [optional] # noqa: E501 + max (str): Specifies maximum value to show on the x-axis. It takes a number, percentile (p90 === 90th percentile), or auto for default behavior.. [optional] if omitted the server will use the default value of "auto" # noqa: E501 + min (str): Specifies minimum value to show on the x-axis. It takes a number, percentile (p90 === 90th percentile), or auto for default behavior.. [optional] if omitted the server will use the default value of "auto" # noqa: E501 + scale (str): Specifies the scale type. Possible values are `linear`.. [optional] if omitted the server will use the default value of "linear" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/distribution_widget_y_axis.py b/src/datadog_api_client/v1/model/distribution_widget_y_axis.py index 81a4aa42f4..1fcb52de53 100644 --- a/src/datadog_api_client/v1/model/distribution_widget_y_axis.py +++ b/src/datadog_api_client/v1/model/distribution_widget_y_axis.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DistributionWidgetYAxis(ModelNormal): @@ -50,7 +52,23 @@ class DistributionWidgetYAxis(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DistributionWidgetYAxis - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_zero (bool): True includes zero.. [optional] # noqa: E501 + label (str): The label of the axis to display on the graph.. [optional] # noqa: E501 + max (str): Specifies the maximum value to show on the y-axis. It takes a number, or auto for default behavior.. [optional] if omitted the server will use the default value of "auto" # noqa: E501 + min (str): Specifies minimum value to show on the y-axis. It takes a number, or auto for default behavior.. [optional] if omitted the server will use the default value of "auto" # noqa: E501 + scale (str): Specifies the scale type. Possible values are `linear` or `log`.. [optional] if omitted the server will use the default value of "linear" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/downtime.py b/src/datadog_api_client/v1/model/downtime.py index 51ac6f272e..c7b32111c1 100644 --- a/src/datadog_api_client/v1/model/downtime.py +++ b/src/datadog_api_client/v1/model/downtime.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -68,7 +70,24 @@ class Downtime(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -144,6 +163,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Downtime - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + active (bool): If a scheduled downtime currently exists.. [optional] # noqa: E501 + active_child (DowntimeChild): [optional] # noqa: E501 + canceled (int, none_type): If a scheduled downtime is canceled.. [optional] # noqa: E501 + creator_id (int): User ID of the downtime creator.. [optional] # noqa: E501 + disabled (bool): If a downtime has been disabled.. [optional] # noqa: E501 + downtime_type (int): `0` for a downtime applied on `*` or all, `1` when the downtime is only scoped to hosts, or `2` when the downtime is scoped to anything but hosts.. [optional] # noqa: E501 + end (int, none_type): POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.. [optional] # noqa: E501 + id (int): The downtime ID.. [optional] # noqa: E501 + message (str): A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same `@username` notation as events.. [optional] # noqa: E501 + monitor_id (int, none_type): A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.. [optional] # noqa: E501 + monitor_tags ([str]): A comma-separated list of monitor tags. For example, tags that are applied directly to monitors, not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags. For example, `service:postgres` **AND** `team:frontend`.. [optional] # noqa: E501 + parent_id (int, none_type): ID of the parent Downtime.. [optional] # noqa: E501 + recurrence (DowntimeRecurrence): [optional] # noqa: E501 + scope ([str]): The scope(s) to which the downtime applies. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`).. [optional] # noqa: E501 + start (int): POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.. [optional] # noqa: E501 + timezone (str): The timezone in which to display the downtime's start and end times in Datadog applications.. [optional] # noqa: E501 + updater_id (int, none_type): ID of the last user that updated the downtime.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -243,3 +355,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/downtime_child.py b/src/datadog_api_client/v1/model/downtime_child.py index c1c4e8f8d6..c281d53f56 100644 --- a/src/datadog_api_client/v1/model/downtime_child.py +++ b/src/datadog_api_client/v1/model/downtime_child.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class DowntimeChild(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = True @@ -140,6 +159,98 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DowntimeChild - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + active (bool): If a scheduled downtime currently exists.. [optional] # noqa: E501 + canceled (int, none_type): If a scheduled downtime is canceled.. [optional] # noqa: E501 + creator_id (int): User ID of the downtime creator.. [optional] # noqa: E501 + disabled (bool): If a downtime has been disabled.. [optional] # noqa: E501 + downtime_type (int): `0` for a downtime applied on `*` or all, `1` when the downtime is only scoped to hosts, or `2` when the downtime is scoped to anything but hosts.. [optional] # noqa: E501 + end (int, none_type): POSIX timestamp to end the downtime. If not provided, the downtime is in effect indefinitely until you cancel it.. [optional] # noqa: E501 + id (int): The downtime ID.. [optional] # noqa: E501 + message (str): A message to include with notifications for this downtime. Email notifications can be sent to specific users by using the same `@username` notation as events.. [optional] # noqa: E501 + monitor_id (int, none_type): A single monitor to which the downtime applies. If not provided, the downtime applies to all monitors.. [optional] # noqa: E501 + monitor_tags ([str]): A comma-separated list of monitor tags. For example, tags that are applied directly to monitors, not tags that are used in monitor queries (which are filtered by the scope parameter), to which the downtime applies. The resulting downtime applies to monitors that match ALL provided monitor tags. For example, `service:postgres` **AND** `team:frontend`.. [optional] # noqa: E501 + parent_id (int, none_type): ID of the parent Downtime.. [optional] # noqa: E501 + recurrence (DowntimeRecurrence): [optional] # noqa: E501 + scope ([str]): The scope(s) to which the downtime applies. For example, `host:app2`. Provide multiple scopes as a comma-separated list like `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (`env:dev` **AND** `env:prod`).. [optional] # noqa: E501 + start (int): POSIX timestamp to start the downtime. If not provided, the downtime starts the moment it is created.. [optional] # noqa: E501 + timezone (str): The timezone in which to display the downtime's start and end times in Datadog applications.. [optional] # noqa: E501 + updater_id (int, none_type): ID of the last user that updated the downtime.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -238,3 +349,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/downtime_recurrence.py b/src/datadog_api_client/v1/model/downtime_recurrence.py index 8da3691fd4..4ea5551229 100644 --- a/src/datadog_api_client/v1/model/downtime_recurrence.py +++ b/src/datadog_api_client/v1/model/downtime_recurrence.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class DowntimeRecurrence(ModelNormal): @@ -57,7 +59,23 @@ class DowntimeRecurrence(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = True @@ -101,6 +119,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DowntimeRecurrence - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + period (int): How often to repeat as an integer. For example, to repeat every 3 days, select a type of `days` and a period of `3`.. [optional] # noqa: E501 + rrule (str): The `RRULE` standard for defining recurring events (**requires to set \"type\" to rrule**) For example, to have a recurring event on the first day of each month, set the type to `rrule` and set the `FREQ` to `MONTHLY` and `BYMONTHDAY` to `1`. Most common `rrule` options from the [iCalendar Spec](https://tools.ietf.org/html/rfc5545) are supported. **Note**: Attributes specifying the duration in `RRULE` are not supported (for example, `DTSTART`, `DTEND`, `DURATION`). More examples available in this [downtime guide](https://docs.datadoghq.com/monitors/guide/supress-alert-with-downtimes/?tab=api). [optional] # noqa: E501 + type (str): The type of recurrence. Choose from `days`, `weeks`, `months`, `years`, `rrule`.. [optional] # noqa: E501 + until_date (int, none_type): The date at which the recurrence should end as a POSIX timestamp. `until_occurences` and `until_date` are mutually exclusive.. [optional] # noqa: E501 + until_occurrences (int, none_type): How many times the downtime is rescheduled. `until_occurences` and `until_date` are mutually exclusive.. [optional] # noqa: E501 + week_days ([str]): A list of week days to repeat on. Choose from `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. Only applicable when type is weeks. First letter must be capitalized.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +289,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event.py b/src/datadog_api_client/v1/model/event.py index 727f46cf60..3d9e44bcd1 100644 --- a/src/datadog_api_client/v1/model/event.py +++ b/src/datadog_api_client/v1/model/event.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -65,7 +67,24 @@ class Event(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -116,6 +135,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Event - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alert_type (EventAlertType): [optional] # noqa: E501 + date_happened (int): POSIX timestamp of the event. Must be sent as an integer (i.e. no quotes). Limited to events no older than 7 days.. [optional] # noqa: E501 + device_name (str): A device name.. [optional] # noqa: E501 + host (str): Host name to associate with the event. Any tags associated with the host are also applied to this event.. [optional] # noqa: E501 + id (int): Integer ID of the event.. [optional] # noqa: E501 + payload (str): Payload of the event.. [optional] # noqa: E501 + priority (EventPriority): [optional] # noqa: E501 + source_type_name (str): The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).. [optional] # noqa: E501 + tags ([str]): A list of tags to apply to the event.. [optional] # noqa: E501 + text (str): The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with `%%% \\n` and end the text block with `\\n %%%`. Use `msg_text` with the Datadog Ruby library.. [optional] # noqa: E501 + title (str): The event title. Limited to 100 characters. Use `msg_title` with the Datadog Ruby library.. [optional] # noqa: E501 + url (str): URL of the event.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -210,3 +317,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_alert_type.py b/src/datadog_api_client/v1/model/event_alert_type.py index b86c84bd10..91319c693a 100644 --- a/src/datadog_api_client/v1/model/event_alert_type.py +++ b/src/datadog_api_client/v1/model/event_alert_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class EventAlertType(ModelSimple): @@ -56,7 +58,23 @@ class EventAlertType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EventAlertType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): If an alert event is enabled, set its type. For example, `error`, `warning`, `info`, `success`, `user_update`, `recommendation`, and `snapshot`.., must be one of ["error", "warning", "info", "success", "user_update", "recommendation", "snapshot", ] # noqa: E501 + + Keyword Args: + value (str): If an alert event is enabled, set its type. For example, `error`, `warning`, `info`, `success`, `user_update`, `recommendation`, and `snapshot`.., must be one of ["error", "warning", "info", "success", "user_update", "recommendation", "snapshot", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/event_create_request.py b/src/datadog_api_client/v1/model/event_create_request.py index 0c0791b326..2452fe09dd 100644 --- a/src/datadog_api_client/v1/model/event_create_request.py +++ b/src/datadog_api_client/v1/model/event_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -68,7 +70,24 @@ class EventCreateRequest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -123,6 +142,100 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text, title, *args, **kwargs): # noqa: E501 + """EventCreateRequest - a model defined in OpenAPI + + Args: + text (str): The body of the event. Limited to 4000 characters. The text supports markdown. To use markdown in the event text, start the text block with `%%% \\n` and end the text block with `\\n %%%`. Use `msg_text` with the Datadog Ruby library. + title (str): The event title. Limited to 100 characters. Use `msg_title` with the Datadog Ruby library. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregation_key (str): An arbitrary string to use for aggregation. Limited to 100 characters. If you specify a key, all events using that key are grouped together in the Event Stream.. [optional] # noqa: E501 + alert_type (EventAlertType): [optional] # noqa: E501 + date_happened (int): POSIX timestamp of the event. Must be sent as an integer (i.e. no quotes). Limited to events no older than 7 days.. [optional] # noqa: E501 + device_name (str): A device name.. [optional] # noqa: E501 + host (str): Host name to associate with the event. Any tags associated with the host are also applied to this event.. [optional] # noqa: E501 + id (int): Integer ID of the event.. [optional] # noqa: E501 + payload (str): Payload of the event.. [optional] # noqa: E501 + priority (EventPriority): [optional] # noqa: E501 + related_event_id (int): ID of the parent event. Must be sent as an integer (i.e. no quotes).. [optional] # noqa: E501 + source_type_name (str): The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).. [optional] # noqa: E501 + tags ([str]): A list of tags to apply to the event.. [optional] # noqa: E501 + url (str): URL of the event.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text = text + self.title = title + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -223,3 +336,8 @@ def __init__(self, text, title, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_create_response.py b/src/datadog_api_client/v1/model/event_create_response.py index 650b5caba2..f337f8bf10 100644 --- a/src/datadog_api_client/v1/model/event_create_response.py +++ b/src/datadog_api_client/v1/model/event_create_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -65,7 +67,24 @@ class EventCreateResponse(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -120,6 +139,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EventCreateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alert_type (EventAlertType): [optional] # noqa: E501 + date_happened (int): POSIX timestamp of the event. Must be sent as an integer (i.e. no quotes). Limited to events no older than 7 days.. [optional] # noqa: E501 + device_name (str): A device name.. [optional] # noqa: E501 + host (str): Host name to associate with the event. Any tags associated with the host are also applied to this event.. [optional] # noqa: E501 + id (int): Integer ID of the event.. [optional] # noqa: E501 + payload (str): Payload of the event.. [optional] # noqa: E501 + priority (EventPriority): [optional] # noqa: E501 + related_event_id (int): ID of the parent event. Must be sent as an integer (i.e. no quotes).. [optional] # noqa: E501 + source_type_name (str): The type of event being posted. Option examples include nagios, hudson, jenkins, my_apps, chef, puppet, git, bitbucket, etc. A complete list of source attribute values [available here](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).. [optional] # noqa: E501 + status (str): A status.. [optional] # noqa: E501 + tags ([str]): A list of tags to apply to the event.. [optional] # noqa: E501 + text (str): The body of the event. Limited to 4000 characters. The text supports markdown. Use `msg_text` with the Datadog Ruby library.. [optional] # noqa: E501 + title (str): The event title. Limited to 100 characters. Use `msg_title` with the Datadog Ruby library.. [optional] # noqa: E501 + url (str): URL of the event.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -216,3 +325,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_list_response.py b/src/datadog_api_client/v1/model/event_list_response.py index 89c0f02bdc..2fcfb0ebe8 100644 --- a/src/datadog_api_client/v1/model/event_list_response.py +++ b/src/datadog_api_client/v1/model/event_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class EventListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EventListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + events ([Event]): An array of events.. [optional] # noqa: E501 + status (str): A status.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_priority.py b/src/datadog_api_client/v1/model/event_priority.py index c18240f518..16b4ee7cdf 100644 --- a/src/datadog_api_client/v1/model/event_priority.py +++ b/src/datadog_api_client/v1/model/event_priority.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class EventPriority(ModelSimple): @@ -51,7 +53,23 @@ class EventPriority(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EventPriority - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The priority of the event. For example, `normal` or `low`.., must be one of ["normal", "low", ] # noqa: E501 + + Keyword Args: + value (str): The priority of the event. For example, `normal` or `low`.., must be one of ["normal", "low", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/event_query_definition.py b/src/datadog_api_client/v1/model/event_query_definition.py index 83c18fa6de..acd57643cc 100644 --- a/src/datadog_api_client/v1/model/event_query_definition.py +++ b/src/datadog_api_client/v1/model/event_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class EventQueryDefinition(ModelNormal): @@ -50,7 +52,23 @@ class EventQueryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, search, tags_execution, *args, **kwargs): # noqa: E501 + """EventQueryDefinition - a model defined in OpenAPI + + Args: + search (str): The query being made on the event. + tags_execution (str): The execution method for multi-value filters. Can be either and or or. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.search = search + self.tags_execution = tags_execution + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, search, tags_execution, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_response.py b/src/datadog_api_client/v1/model/event_response.py index 73cc20e27f..eb6a9fedaf 100644 --- a/src/datadog_api_client/v1/model/event_response.py +++ b/src/datadog_api_client/v1/model/event_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class EventResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """EventResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + event (Event): [optional] # noqa: E501 + status (str): A status.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_stream_widget_definition.py b/src/datadog_api_client/v1/model/event_stream_widget_definition.py index 7f8aadd0d0..8b75c499b8 100644 --- a/src/datadog_api_client/v1/model/event_stream_widget_definition.py +++ b/src/datadog_api_client/v1/model/event_stream_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class EventStreamWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,6 +124,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, type, *args, **kwargs): # noqa: E501 + """EventStreamWidgetDefinition - a model defined in OpenAPI + + Args: + query (str): Query to filter the event stream with. + type (EventStreamWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + event_size (WidgetEventSize): [optional] # noqa: E501 + tags_execution (str): The execution method for multi-value filters. Can be either and or or.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -199,3 +306,8 @@ def __init__(self, query, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_stream_widget_definition_type.py b/src/datadog_api_client/v1/model/event_stream_widget_definition_type.py index c929544785..df869d4580 100644 --- a/src/datadog_api_client/v1/model/event_stream_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/event_stream_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class EventStreamWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class EventStreamWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EventStreamWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the event stream widget.. if omitted defaults to "event_stream", must be one of ["event_stream", ] # noqa: E501 + + Keyword Args: + value (str): Type of the event stream widget.. if omitted defaults to "event_stream", must be one of ["event_stream", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "event_stream" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/event_timeline_widget_definition.py b/src/datadog_api_client/v1/model/event_timeline_widget_definition.py index 0cfb6d6224..15c791f47e 100644 --- a/src/datadog_api_client/v1/model/event_timeline_widget_definition.py +++ b/src/datadog_api_client/v1/model/event_timeline_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class EventTimelineWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, type, *args, **kwargs): # noqa: E501 + """EventTimelineWidgetDefinition - a model defined in OpenAPI + + Args: + query (str): Query to filter the event timeline with. + type (EventTimelineWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tags_execution (str): The execution method for multi-value filters. Can be either and or or.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -194,3 +300,8 @@ def __init__(self, query, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/event_timeline_widget_definition_type.py b/src/datadog_api_client/v1/model/event_timeline_widget_definition_type.py index b21dc34923..ebac327148 100644 --- a/src/datadog_api_client/v1/model/event_timeline_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/event_timeline_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class EventTimelineWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class EventTimelineWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """EventTimelineWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the event timeline widget.. if omitted defaults to "event_timeline", must be one of ["event_timeline", ] # noqa: E501 + + Keyword Args: + value (str): Type of the event timeline widget.. if omitted defaults to "event_timeline", must be one of ["event_timeline", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "event_timeline" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/formula_and_function_event_aggregation.py b/src/datadog_api_client/v1/model/formula_and_function_event_aggregation.py index 4e91262e09..8cc3614cf5 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_event_aggregation.py +++ b/src/datadog_api_client/v1/model/formula_and_function_event_aggregation.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionEventAggregation(ModelSimple): @@ -61,7 +63,23 @@ class FormulaAndFunctionEventAggregation(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +103,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -188,3 +208,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FormulaAndFunctionEventAggregation - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Aggregation methods for event platform queries.., must be one of ["count", "cardinality", "median", "pc75", "pc90", "pc95", "pc98", "pc99", "sum", "min", "max", "avg", ] # noqa: E501 + + Keyword Args: + value (str): Aggregation methods for event platform queries.., must be one of ["count", "cardinality", "median", "pc75", "pc90", "pc95", "pc98", "pc99", "sum", "min", "max", "avg", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/formula_and_function_event_query_definition.py b/src/datadog_api_client/v1/model/formula_and_function_event_query_definition.py index 9c375d6a03..5e4ae83a13 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_event_query_definition.py +++ b/src/datadog_api_client/v1/model/formula_and_function_event_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -68,7 +70,24 @@ class FormulaAndFunctionEventQueryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -107,6 +126,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, compute, data_source, name, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionEventQueryDefinition - a model defined in OpenAPI + + Args: + compute (FormulaAndFunctionEventQueryDefinitionCompute): + data_source (FormulaAndFunctionEventsDataSource): + name (str): Name of the query for use in formulas. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + group_by ([FormulaAndFunctionEventQueryGroupBy]): Group by options.. [optional] # noqa: E501 + indexes ([str]): An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.. [optional] # noqa: E501 + search (FormulaAndFunctionEventQueryDefinitionSearch): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.compute = compute + self.data_source = data_source + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -200,3 +306,8 @@ def __init__(self, compute, data_source, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_compute.py b/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_compute.py index 5c55d6160e..3078cc125e 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_compute.py +++ b/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_compute.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class FormulaAndFunctionEventQueryDefinitionCompute(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, aggregation, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionEventQueryDefinitionCompute - a model defined in OpenAPI + + Args: + aggregation (FormulaAndFunctionEventAggregation): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + interval (int): A time interval in milliseconds.. [optional] # noqa: E501 + metric (str): Measurable attribute to compute.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.aggregation = aggregation + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, aggregation, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_search.py b/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_search.py index 45c3e950c6..3eab03192e 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_search.py +++ b/src/datadog_api_client/v1/model/formula_and_function_event_query_definition_search.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionEventQueryDefinitionSearch(ModelNormal): @@ -50,7 +52,23 @@ class FormulaAndFunctionEventQueryDefinitionSearch(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionEventQueryDefinitionSearch - a model defined in OpenAPI + + Args: + query (str): Events search string. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by.py b/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by.py index 030ad8be34..0ad1fbed1c 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by.py +++ b/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class FormulaAndFunctionEventQueryGroupBy(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, facet, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionEventQueryGroupBy - a model defined in OpenAPI + + Args: + facet (str): Event facet. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + limit (int): Number of groups to return.. [optional] # noqa: E501 + sort (FormulaAndFunctionEventQueryGroupBySort): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.facet = facet + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, facet, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by_sort.py b/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by_sort.py index e4f6533ddd..c729d66ae2 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by_sort.py +++ b/src/datadog_api_client/v1/model/formula_and_function_event_query_group_by_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class FormulaAndFunctionEventQueryGroupBySort(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, aggregation, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionEventQueryGroupBySort - a model defined in OpenAPI + + Args: + aggregation (FormulaAndFunctionEventAggregation): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + metric (str): Metric used for sorting group by results.. [optional] # noqa: E501 + order (QuerySortOrder): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.aggregation = aggregation + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, aggregation, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py b/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py index 9750ace1d2..1526fc07c6 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py +++ b/src/datadog_api_client/v1/model/formula_and_function_events_data_source.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionEventsDataSource(ModelSimple): @@ -56,7 +58,23 @@ class FormulaAndFunctionEventsDataSource(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FormulaAndFunctionEventsDataSource - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Data source for event platform-based queries.., must be one of ["logs", "spans", "network", "rum", "security_signals", "profiles", "audit", ] # noqa: E501 + + Keyword Args: + value (str): Data source for event platform-based queries.., must be one of ["logs", "spans", "network", "rum", "security_signals", "profiles", "audit", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/formula_and_function_metric_aggregation.py b/src/datadog_api_client/v1/model/formula_and_function_metric_aggregation.py index 07a011a885..000edb5831 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_metric_aggregation.py +++ b/src/datadog_api_client/v1/model/formula_and_function_metric_aggregation.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionMetricAggregation(ModelSimple): @@ -56,7 +58,23 @@ class FormulaAndFunctionMetricAggregation(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FormulaAndFunctionMetricAggregation - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The aggregation methods available for metrics queries.., must be one of ["avg", "min", "max", "sum", "last", "area", "l2norm", ] # noqa: E501 + + Keyword Args: + value (str): The aggregation methods available for metrics queries.., must be one of ["avg", "min", "max", "sum", "last", "area", "l2norm", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/formula_and_function_metric_data_source.py b/src/datadog_api_client/v1/model/formula_and_function_metric_data_source.py index 87c54d6596..dbd1d747dc 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_metric_data_source.py +++ b/src/datadog_api_client/v1/model/formula_and_function_metric_data_source.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionMetricDataSource(ModelSimple): @@ -50,7 +52,23 @@ class FormulaAndFunctionMetricDataSource(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FormulaAndFunctionMetricDataSource - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Data source for metrics queries.. if omitted defaults to "metrics", must be one of ["metrics", ] # noqa: E501 + + Keyword Args: + value (str): Data source for metrics queries.. if omitted defaults to "metrics", must be one of ["metrics", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "metrics" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/formula_and_function_metric_query_definition.py b/src/datadog_api_client/v1/model/formula_and_function_metric_query_definition.py index e308ca62d5..eebd38f4e1 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_metric_query_definition.py +++ b/src/datadog_api_client/v1/model/formula_and_function_metric_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class FormulaAndFunctionMetricQueryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data_source, name, query, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionMetricQueryDefinition - a model defined in OpenAPI + + Args: + data_source (FormulaAndFunctionMetricDataSource): + name (str): Name of the query for use in formulas. + query (str): Metrics query definition. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregator (FormulaAndFunctionMetricAggregation): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data_source = data_source + self.name = name + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +288,8 @@ def __init__(self, data_source, name, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_process_query_data_source.py b/src/datadog_api_client/v1/model/formula_and_function_process_query_data_source.py index 90ee0de99a..e24c467a0d 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_process_query_data_source.py +++ b/src/datadog_api_client/v1/model/formula_and_function_process_query_data_source.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionProcessQueryDataSource(ModelSimple): @@ -51,7 +53,23 @@ class FormulaAndFunctionProcessQueryDataSource(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FormulaAndFunctionProcessQueryDataSource - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Data sources that rely on the process backend.., must be one of ["process", "container", ] # noqa: E501 + + Keyword Args: + value (str): Data sources that rely on the process backend.., must be one of ["process", "container", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/formula_and_function_process_query_definition.py b/src/datadog_api_client/v1/model/formula_and_function_process_query_definition.py index 7735d3f45f..eca290a06e 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_process_query_definition.py +++ b/src/datadog_api_client/v1/model/formula_and_function_process_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class FormulaAndFunctionProcessQueryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -107,6 +126,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data_source, metric, name, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionProcessQueryDefinition - a model defined in OpenAPI + + Args: + data_source (FormulaAndFunctionProcessQueryDataSource): + metric (str): Process metric name. + name (str): Name of query for use in formulas. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregator (FormulaAndFunctionMetricAggregation): [optional] # noqa: E501 + is_normalized_cpu (bool): Whether to normalize the CPU percentages.. [optional] # noqa: E501 + limit (int): Number of hits to return.. [optional] # noqa: E501 + sort (QuerySortOrder): [optional] # noqa: E501 + tag_filters ([str]): An array of tags to filter by.. [optional] # noqa: E501 + text_filter (str): Text to use as filter.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data_source = data_source + self.metric = metric + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +312,8 @@ def __init__(self, data_source, metric, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/formula_and_function_query_definition.py b/src/datadog_api_client/v1/model/formula_and_function_query_definition.py index 10154f8062..e0a128a203 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_query_definition.py +++ b/src/datadog_api_client/v1/model/formula_and_function_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -125,6 +127,110 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FormulaAndFunctionQueryDefinition - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregator (FormulaAndFunctionMetricAggregation): [optional] # noqa: E501 + group_by ([FormulaAndFunctionEventQueryGroupBy]): Group by options.. [optional] # noqa: E501 + indexes ([str]): An array of index names to query in the stream. Omit or use `[]` to query all indexes at once.. [optional] # noqa: E501 + search (FormulaAndFunctionEventQueryDefinitionSearch): [optional] # noqa: E501 + is_normalized_cpu (bool): Whether to normalize the CPU percentages.. [optional] # noqa: E501 + limit (int): Number of hits to return.. [optional] # noqa: E501 + sort (QuerySortOrder): [optional] # noqa: E501 + tag_filters ([str]): An array of tags to filter by.. [optional] # noqa: E501 + text_filter (str): Text to use as filter.. [optional] # noqa: E501 + data_source (FormulaAndFunctionProcessQueryDataSource): [optional] # noqa: E501 + name (str): Name of query for use in formulas.. [optional] # noqa: E501 + query (str): Metrics query definition.. [optional] # noqa: E501 + compute (FormulaAndFunctionEventQueryDefinitionCompute): [optional] # noqa: E501 + metric (str): Process metric name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -221,28 +327,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/formula_and_function_response_format.py b/src/datadog_api_client/v1/model/formula_and_function_response_format.py index a57ec05175..11028063b0 100644 --- a/src/datadog_api_client/v1/model/formula_and_function_response_format.py +++ b/src/datadog_api_client/v1/model/formula_and_function_response_format.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FormulaAndFunctionResponseFormat(ModelSimple): @@ -51,7 +53,23 @@ class FormulaAndFunctionResponseFormat(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FormulaAndFunctionResponseFormat - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Timeseries or Scalar response. **This feature is currently in beta.**., must be one of ["timeseries", "scalar", ] # noqa: E501 + + Keyword Args: + value (str): Timeseries or Scalar response. **This feature is currently in beta.**., must be one of ["timeseries", "scalar", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/free_text_widget_definition.py b/src/datadog_api_client/v1/model/free_text_widget_definition.py index b01df9dd9a..41fb441cb3 100644 --- a/src/datadog_api_client/v1/model/free_text_widget_definition.py +++ b/src/datadog_api_client/v1/model/free_text_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class FreeTextWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text, type, *args, **kwargs): # noqa: E501 + """FreeTextWidgetDefinition - a model defined in OpenAPI + + Args: + text (str): Text to display. + type (FreeTextWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color (str): Color of the text.. [optional] # noqa: E501 + font_size (str): Size of the text.. [optional] # noqa: E501 + text_align (WidgetTextAlign): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text = text + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +290,8 @@ def __init__(self, text, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/free_text_widget_definition_type.py b/src/datadog_api_client/v1/model/free_text_widget_definition_type.py index 66160db252..1a4fe64fbc 100644 --- a/src/datadog_api_client/v1/model/free_text_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/free_text_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class FreeTextWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class FreeTextWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """FreeTextWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the free text widget.. if omitted defaults to "free_text", must be one of ["free_text", ] # noqa: E501 + + Keyword Args: + value (str): Type of the free text widget.. if omitted defaults to "free_text", must be one of ["free_text", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "free_text" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/gcp_account.py b/src/datadog_api_client/v1/model/gcp_account.py index 6b6e76affc..f1d991f39c 100644 --- a/src/datadog_api_client/v1/model/gcp_account.py +++ b/src/datadog_api_client/v1/model/gcp_account.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class GCPAccount(ModelNormal): @@ -50,7 +52,23 @@ class GCPAccount(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -102,6 +120,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GCPAccount - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + auth_provider_x509_cert_url (str): Should be `https://www.googleapis.com/oauth2/v1/certs`.. [optional] # noqa: E501 + auth_uri (str): Should be `https://accounts.google.com/o/oauth2/auth`.. [optional] # noqa: E501 + automute (bool): Silence monitors for expected GCE instance shutdowns.. [optional] # noqa: E501 + client_email (str): Your email found in your JSON service account key.. [optional] # noqa: E501 + client_id (str): Your ID found in your JSON service account key.. [optional] # noqa: E501 + client_x509_cert_url (str): Should be `https://www.googleapis.com/robot/v1/metadata/x509/` where `` is the email found in your JSON service account key.. [optional] # noqa: E501 + errors ([str]): An array of errors.. [optional] # noqa: E501 + host_filters (str): Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.. [optional] # noqa: E501 + private_key (str): Your private key name found in your JSON service account key.. [optional] # noqa: E501 + private_key_id (str): Your private key ID found in your JSON service account key.. [optional] # noqa: E501 + project_id (str): Your Google Cloud project ID found in your JSON service account key.. [optional] # noqa: E501 + token_uri (str): Should be `https://accounts.google.com/o/oauth2/token`.. [optional] # noqa: E501 + type (str): The value for service_account found in your JSON service account key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -197,3 +304,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/gcp_account_list_response.py b/src/datadog_api_client/v1/model/gcp_account_list_response.py index 3044b81f90..341bbf6959 100644 --- a/src/datadog_api_client/v1/model/gcp_account_list_response.py +++ b/src/datadog_api_client/v1/model/gcp_account_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class GCPAccountListResponse(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """GCPAccountListResponse - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([GCPAccount]): Array of GCP account responses.. # noqa: E501 + + Keyword Args: + value ([GCPAccount]): Array of GCP account responses.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/geomap_widget_definition.py b/src/datadog_api_client/v1/model/geomap_widget_definition.py index 31153fe93e..585c2028f4 100644 --- a/src/datadog_api_client/v1/model/geomap_widget_definition.py +++ b/src/datadog_api_client/v1/model/geomap_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -73,7 +75,24 @@ class GeomapWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -118,6 +137,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, style, type, view, *args, **kwargs): # noqa: E501 + """GeomapWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([GeomapWidgetRequest]): Array of one request object to display in the widget. The request must contain a `group-by` tag whose value is a country ISO code. See the [Request JSON schema documentation](https://docs.datadoghq.com/dashboards/graphing_json/request_json) for information about building the `REQUEST_SCHEMA`. + style (GeomapWidgetDefinitionStyle): + type (GeomapWidgetDefinitionType): + view (GeomapWidgetDefinitionView): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): A list of custom links.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): The title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): The size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.style = style + self.type = type + self.view = view + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -215,3 +325,8 @@ def __init__(self, requests, style, type, view, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/geomap_widget_definition_style.py b/src/datadog_api_client/v1/model/geomap_widget_definition_style.py index 8f089d3716..c652cffe18 100644 --- a/src/datadog_api_client/v1/model/geomap_widget_definition_style.py +++ b/src/datadog_api_client/v1/model/geomap_widget_definition_style.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class GeomapWidgetDefinitionStyle(ModelNormal): @@ -50,7 +52,23 @@ class GeomapWidgetDefinitionStyle(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, palette, palette_flip, *args, **kwargs): # noqa: E501 + """GeomapWidgetDefinitionStyle - a model defined in OpenAPI + + Args: + palette (str): The color palette to apply to the widget. + palette_flip (bool): Whether to flip the palette tones. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.palette = palette + self.palette_flip = palette_flip + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, palette, palette_flip, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/geomap_widget_definition_type.py b/src/datadog_api_client/v1/model/geomap_widget_definition_type.py index fcc2ef1793..0cf0b41a2b 100644 --- a/src/datadog_api_client/v1/model/geomap_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/geomap_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class GeomapWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class GeomapWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """GeomapWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the geomap widget.. if omitted defaults to "geomap", must be one of ["geomap", ] # noqa: E501 + + Keyword Args: + value (str): Type of the geomap widget.. if omitted defaults to "geomap", must be one of ["geomap", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "geomap" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/geomap_widget_definition_view.py b/src/datadog_api_client/v1/model/geomap_widget_definition_view.py index c57e9dba0c..b1c9f246b7 100644 --- a/src/datadog_api_client/v1/model/geomap_widget_definition_view.py +++ b/src/datadog_api_client/v1/model/geomap_widget_definition_view.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class GeomapWidgetDefinitionView(ModelNormal): @@ -50,7 +52,23 @@ class GeomapWidgetDefinitionView(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, focus, *args, **kwargs): # noqa: E501 + """GeomapWidgetDefinitionView - a model defined in OpenAPI + + Args: + focus (str): The 2-letter ISO code of a country to focus the map on. Or `WORLD`. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.focus = focus + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, focus, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/geomap_widget_request.py b/src/datadog_api_client/v1/model/geomap_widget_request.py index 185c0cb396..73f0eae128 100644 --- a/src/datadog_api_client/v1/model/geomap_widget_request.py +++ b/src/datadog_api_client/v1/model/geomap_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class GeomapWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GeomapWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + formulas ([WidgetFormula]): List of formulas that operate on queries. **This feature is currently in beta.**. [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): The widget metrics query.. [optional] # noqa: E501 + queries ([FormulaAndFunctionQueryDefinition]): List of queries that can be returned directly or used in formulas. **This feature is currently in beta.**. [optional] # noqa: E501 + response_format (FormulaAndFunctionResponseFormat): [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +294,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/graph_snapshot.py b/src/datadog_api_client/v1/model/graph_snapshot.py index a6583a8ee5..85fb74f359 100644 --- a/src/datadog_api_client/v1/model/graph_snapshot.py +++ b/src/datadog_api_client/v1/model/graph_snapshot.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class GraphSnapshot(ModelNormal): @@ -50,7 +52,23 @@ class GraphSnapshot(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """GraphSnapshot - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_def (str): A JSON document defining the graph. `graph_def` can be used instead of `metric_query`. The JSON document uses the [grammar defined here](https://docs.datadoghq.com/graphing/graphing_json/#grammar) and should be formatted to a single line then URL encoded.. [optional] # noqa: E501 + metric_query (str): The metric query. One of `metric_query` or `graph_def` is required.. [optional] # noqa: E501 + snapshot_url (str): URL of your [graph snapshot](https://docs.datadoghq.com/metrics/explorer/#snapshot).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/group_widget_definition.py b/src/datadog_api_client/v1/model/group_widget_definition.py index 146f923431..91bb2bf814 100644 --- a/src/datadog_api_client/v1/model/group_widget_definition.py +++ b/src/datadog_api_client/v1/model/group_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class GroupWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,6 +124,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, layout_type, type, widgets, *args, **kwargs): # noqa: E501 + """GroupWidgetDefinition - a model defined in OpenAPI + + Args: + layout_type (WidgetLayoutType): + type (GroupWidgetDefinitionType): + widgets ([Widget]): List of widget groups. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + background_color (str): Background color of the group title.. [optional] # noqa: E501 + banner_img (str): URL of image to display as a banner for the group.. [optional] # noqa: E501 + show_title (bool): Whether to show the title or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.layout_type = layout_type + self.type = type + self.widgets = widgets + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -200,3 +308,8 @@ def __init__(self, layout_type, type, widgets, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/group_widget_definition_type.py b/src/datadog_api_client/v1/model/group_widget_definition_type.py index 993c762d11..5ac027d61e 100644 --- a/src/datadog_api_client/v1/model/group_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/group_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class GroupWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class GroupWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """GroupWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the group widget.. if omitted defaults to "group", must be one of ["group", ] # noqa: E501 + + Keyword Args: + value (str): Type of the group widget.. if omitted defaults to "group", must be one of ["group", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "group" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/heat_map_widget_definition.py b/src/datadog_api_client/v1/model/heat_map_widget_definition.py index 9ab6a44c91..91d6fe4c07 100644 --- a/src/datadog_api_client/v1/model/heat_map_widget_definition.py +++ b/src/datadog_api_client/v1/model/heat_map_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -73,7 +75,24 @@ class HeatMapWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -122,6 +141,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """HeatMapWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([HeatMapWidgetRequest]): List of widget types. + type (HeatMapWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + events ([WidgetEvent]): List of widget events.. [optional] # noqa: E501 + legend_size (str): Available legend sizes for a widget. Should be one of \"0\", \"2\", \"4\", \"8\", \"16\", or \"auto\".. [optional] # noqa: E501 + show_legend (bool): Whether or not to display the legend on this widget.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + yaxis (WidgetAxis): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -219,3 +329,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/heat_map_widget_definition_type.py b/src/datadog_api_client/v1/model/heat_map_widget_definition_type.py index 3a37f5765c..990f3f661b 100644 --- a/src/datadog_api_client/v1/model/heat_map_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/heat_map_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HeatMapWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class HeatMapWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """HeatMapWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the heat map widget.. if omitted defaults to "heatmap", must be one of ["heatmap", ] # noqa: E501 + + Keyword Args: + value (str): Type of the heat map widget.. if omitted defaults to "heatmap", must be one of ["heatmap", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "heatmap" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/heat_map_widget_request.py b/src/datadog_api_client/v1/model/heat_map_widget_request.py index 03e783f7eb..c61200728f 100644 --- a/src/datadog_api_client/v1/model/heat_map_widget_request.py +++ b/src/datadog_api_client/v1/model/heat_map_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class HeatMapWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HeatMapWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_query (LogQueryDefinition): [optional] # noqa: E501 + event_query (EventQueryDefinition): [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Widget query.. [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + style (WidgetStyle): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -201,3 +306,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host.py b/src/datadog_api_client/v1/model/host.py index da7deab046..e336f4de1a 100644 --- a/src/datadog_api_client/v1/model/host.py +++ b/src/datadog_api_client/v1/model/host.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class Host(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Host - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aliases ([str]): Host aliases collected by Datadog.. [optional] # noqa: E501 + apps ([str]): The Datadog integrations reporting metrics for the host.. [optional] # noqa: E501 + aws_name (str): AWS name of your host.. [optional] # noqa: E501 + host_name (str): The host name.. [optional] # noqa: E501 + id (int): The host ID.. [optional] # noqa: E501 + is_muted (bool): If a host is muted or unmuted.. [optional] # noqa: E501 + last_reported_time (int): Last time the host reported a metric data point.. [optional] # noqa: E501 + meta (HostMeta): [optional] # noqa: E501 + metrics (HostMetrics): [optional] # noqa: E501 + mute_timeout (int): Timeout of the mute applied to your host.. [optional] # noqa: E501 + name (str): The host name.. [optional] # noqa: E501 + sources ([str]): Source or cloud provider associated with your host.. [optional] # noqa: E501 + tags_by_source ({str: ([str],)}): List of tags for each source (AWS, Datadog Agent, Chef..).. [optional] # noqa: E501 + up (bool): Displays UP when the expected metrics are received and displays `???` if no metrics are received.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -209,3 +318,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_list_response.py b/src/datadog_api_client/v1/model/host_list_response.py index 72b9d00637..5e557b17b9 100644 --- a/src/datadog_api_client/v1/model/host_list_response.py +++ b/src/datadog_api_client/v1/model/host_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class HostListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + host_list ([Host]): Array of hosts.. [optional] # noqa: E501 + total_matching (int): Number of host matching the query.. [optional] # noqa: E501 + total_returned (int): Number of host returned.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_map_request.py b/src/datadog_api_client/v1/model/host_map_request.py index 4fa25c34e4..193f253717 100644 --- a/src/datadog_api_client/v1/model/host_map_request.py +++ b/src/datadog_api_client/v1/model/host_map_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class HostMapRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMapRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_query (LogQueryDefinition): [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Query definition.. [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -194,3 +298,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition.py b/src/datadog_api_client/v1/model/host_map_widget_definition.py index 01f5e47403..f473fa90f3 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class HostMapWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -119,6 +138,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """HostMapWidgetDefinition - a model defined in OpenAPI + + Args: + requests (HostMapWidgetDefinitionRequests): + type (HostMapWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + group ([str]): List of tag prefixes to group by.. [optional] # noqa: E501 + no_group_hosts (bool): Whether to show the hosts that don’t fit in a group.. [optional] # noqa: E501 + no_metric_hosts (bool): Whether to show the hosts with no metrics.. [optional] # noqa: E501 + node_type (WidgetNodeType): [optional] # noqa: E501 + notes (str): Notes on the title.. [optional] # noqa: E501 + scope ([str]): List of tags used to filter the map.. [optional] # noqa: E501 + style (HostMapWidgetDefinitionStyle): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -218,3 +330,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py b/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py index db50d9d3dd..ff2491da92 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition_requests.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class HostMapWidgetDefinitionRequests(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMapWidgetDefinitionRequests - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + fill (HostMapRequest): [optional] # noqa: E501 + size (HostMapRequest): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition_style.py b/src/datadog_api_client/v1/model/host_map_widget_definition_style.py index de0ac36fd4..8a80f47fc4 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition_style.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition_style.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostMapWidgetDefinitionStyle(ModelNormal): @@ -50,7 +52,23 @@ class HostMapWidgetDefinitionStyle(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMapWidgetDefinitionStyle - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + fill_max (str): Max value to use to color the map.. [optional] # noqa: E501 + fill_min (str): Min value to use to color the map.. [optional] # noqa: E501 + palette (str): Color palette to apply to the widget.. [optional] # noqa: E501 + palette_flip (bool): Whether to flip the palette tones.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_map_widget_definition_type.py b/src/datadog_api_client/v1/model/host_map_widget_definition_type.py index aa2907b810..6471670541 100644 --- a/src/datadog_api_client/v1/model/host_map_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/host_map_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostMapWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class HostMapWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """HostMapWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the host map widget.. if omitted defaults to "hostmap", must be one of ["hostmap", ] # noqa: E501 + + Keyword Args: + value (str): Type of the host map widget.. if omitted defaults to "hostmap", must be one of ["hostmap", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "hostmap" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/host_meta.py b/src/datadog_api_client/v1/model/host_meta.py index 1258c47827..0baba1cacd 100644 --- a/src/datadog_api_client/v1/model/host_meta.py +++ b/src/datadog_api_client/v1/model/host_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostMeta(ModelNormal): @@ -50,7 +52,23 @@ class HostMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + nix_v ([str]): Array of Unix versions.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_metrics.py b/src/datadog_api_client/v1/model/host_metrics.py index f015dc721f..65efab4010 100644 --- a/src/datadog_api_client/v1/model/host_metrics.py +++ b/src/datadog_api_client/v1/model/host_metrics.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostMetrics(ModelNormal): @@ -50,7 +52,23 @@ class HostMetrics(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMetrics - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cpu (float): The percent of CPU used (everything but idle).. [optional] # noqa: E501 + iowait (float): The percent of CPU spent waiting on the IO (not reported for all platforms).. [optional] # noqa: E501 + load (float): The system load over the last 15 minutes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_mute_response.py b/src/datadog_api_client/v1/model/host_mute_response.py index 0e3b0c884a..b292d424ea 100644 --- a/src/datadog_api_client/v1/model/host_mute_response.py +++ b/src/datadog_api_client/v1/model/host_mute_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostMuteResponse(ModelNormal): @@ -50,7 +52,23 @@ class HostMuteResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMuteResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + action (str): Action applied to the hosts.. [optional] # noqa: E501 + end (int): POSIX timestamp in seconds when the host is unmuted.. [optional] # noqa: E501 + hostname (str): The host name.. [optional] # noqa: E501 + message (str): Message associated with the mute.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_mute_settings.py b/src/datadog_api_client/v1/model/host_mute_settings.py index ebe9f2fcf1..d50ec56b1a 100644 --- a/src/datadog_api_client/v1/model/host_mute_settings.py +++ b/src/datadog_api_client/v1/model/host_mute_settings.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostMuteSettings(ModelNormal): @@ -50,7 +52,23 @@ class HostMuteSettings(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostMuteSettings - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + end (int): POSIX timestamp in seconds when the host is unmuted. If omitted, the host remains muted until explicitly unmuted.. [optional] # noqa: E501 + message (str): Message to associate with the muting of this host.. [optional] # noqa: E501 + override (bool): If true and the host is already muted, replaces existing host mute settings.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_tags.py b/src/datadog_api_client/v1/model/host_tags.py index fb6ed1a613..106b1c11a0 100644 --- a/src/datadog_api_client/v1/model/host_tags.py +++ b/src/datadog_api_client/v1/model/host_tags.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostTags(ModelNormal): @@ -50,7 +52,23 @@ class HostTags(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostTags - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + host (str): Your host name.. [optional] # noqa: E501 + tags ([str]): A list of tags to apply to the host.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/host_totals.py b/src/datadog_api_client/v1/model/host_totals.py index 737a3faaa3..c3773a6b25 100644 --- a/src/datadog_api_client/v1/model/host_totals.py +++ b/src/datadog_api_client/v1/model/host_totals.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HostTotals(ModelNormal): @@ -50,7 +52,23 @@ class HostTotals(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HostTotals - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_active (int): Total number of active host (UP and ???) reporting to Datadog.. [optional] # noqa: E501 + total_up (int): Number of host that are UP and reporting to Datadog.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/http_log.py b/src/datadog_api_client/v1/model/http_log.py index 6f58eb9d92..a8ce30a0b4 100644 --- a/src/datadog_api_client/v1/model/http_log.py +++ b/src/datadog_api_client/v1/model/http_log.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class HTTPLog(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """HTTPLog - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([HTTPLogItem]): Structured log message.. # noqa: E501 + + Keyword Args: + value ([HTTPLogItem]): Structured log message.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/http_log_error.py b/src/datadog_api_client/v1/model/http_log_error.py index 7b5ba4f21e..9f7a52346f 100644 --- a/src/datadog_api_client/v1/model/http_log_error.py +++ b/src/datadog_api_client/v1/model/http_log_error.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HTTPLogError(ModelNormal): @@ -54,7 +56,23 @@ class HTTPLogError(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, code, message, *args, **kwargs): # noqa: E501 + """HTTPLogError - a model defined in OpenAPI + + Args: + code (int): Error code. + message (str): Error message. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.code = code + self.message = message + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -172,3 +272,8 @@ def __init__(self, code, message, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/http_log_item.py b/src/datadog_api_client/v1/model/http_log_item.py index 2925f126c5..1fc0822fe9 100644 --- a/src/datadog_api_client/v1/model/http_log_item.py +++ b/src/datadog_api_client/v1/model/http_log_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HTTPLogItem(ModelNormal): @@ -50,7 +52,23 @@ class HTTPLogItem(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """HTTPLogItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + ddsource (str): The integration name associated with your log: the technology from which the log originated. When it matches an integration name, Datadog automatically installs the corresponding parsers and facets. See [reserved attributes](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes).. [optional] # noqa: E501 + ddtags (str): Tags associated with your logs.. [optional] # noqa: E501 + hostname (str): The name of the originating host of the log.. [optional] # noqa: E501 + message (str): The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes) of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry. That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.. [optional] # noqa: E501 + service (str): The name of the application or service generating the log events. It is used to switch from Logs to APM, so make sure you define the same value when you use both products. See [reserved attributes](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/http_method.py b/src/datadog_api_client/v1/model/http_method.py index c5c451fbfc..b93e2af383 100644 --- a/src/datadog_api_client/v1/model/http_method.py +++ b/src/datadog_api_client/v1/model/http_method.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class HTTPMethod(ModelSimple): @@ -56,7 +58,23 @@ class HTTPMethod(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """HTTPMethod - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The HTTP method.., must be one of ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", ] # noqa: E501 + + Keyword Args: + value (str): The HTTP method.., must be one of ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD", "OPTIONS", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/i_frame_widget_definition.py b/src/datadog_api_client/v1/model/i_frame_widget_definition.py index 6cff8f3176..f2300261cb 100644 --- a/src/datadog_api_client/v1/model/i_frame_widget_definition.py +++ b/src/datadog_api_client/v1/model/i_frame_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IFrameWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, url, *args, **kwargs): # noqa: E501 + """IFrameWidgetDefinition - a model defined in OpenAPI + + Args: + type (IFrameWidgetDefinitionType): + url (str): URL of the iframe. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.url = url + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, type, url, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/i_frame_widget_definition_type.py b/src/datadog_api_client/v1/model/i_frame_widget_definition_type.py index 26b45c868d..f041c68dbd 100644 --- a/src/datadog_api_client/v1/model/i_frame_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/i_frame_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IFrameWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class IFrameWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IFrameWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the iframe widget.. if omitted defaults to "iframe", must be one of ["iframe", ] # noqa: E501 + + Keyword Args: + value (str): Type of the iframe widget.. if omitted defaults to "iframe", must be one of ["iframe", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "iframe" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/idp_form_data.py b/src/datadog_api_client/v1/model/idp_form_data.py index e0fed3612b..36ff1e3be2 100644 --- a/src/datadog_api_client/v1/model/idp_form_data.py +++ b/src/datadog_api_client/v1/model/idp_form_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IdpFormData(ModelNormal): @@ -50,7 +52,23 @@ class IdpFormData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, idp_file, *args, **kwargs): # noqa: E501 + """IdpFormData - a model defined in OpenAPI + + Args: + idp_file (file_type): The path to the XML metadata file you wish to upload. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.idp_file = idp_file + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, idp_file, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/idp_response.py b/src/datadog_api_client/v1/model/idp_response.py index 306374cb9b..6eeb76c58b 100644 --- a/src/datadog_api_client/v1/model/idp_response.py +++ b/src/datadog_api_client/v1/model/idp_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IdpResponse(ModelNormal): @@ -50,7 +52,23 @@ class IdpResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 + """IdpResponse - a model defined in OpenAPI + + Args: + message (str): Identity provider response. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message = message + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, message, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/image_widget_definition.py b/src/datadog_api_client/v1/model/image_widget_definition.py index 308f493e4a..1e66a71514 100644 --- a/src/datadog_api_client/v1/model/image_widget_definition.py +++ b/src/datadog_api_client/v1/model/image_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class ImageWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, url, *args, **kwargs): # noqa: E501 + """ImageWidgetDefinition - a model defined in OpenAPI + + Args: + type (ImageWidgetDefinitionType): + url (str): URL of the image. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + has_background (bool): Whether to display a background or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + has_border (bool): Whether to display a border or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + horizontal_align (WidgetHorizontalAlign): [optional] # noqa: E501 + margin (WidgetMargin): [optional] # noqa: E501 + sizing (WidgetImageSizing): [optional] # noqa: E501 + url_dark_theme (str): URL of the image in dark mode.. [optional] # noqa: E501 + vertical_align (WidgetVerticalAlign): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.url = url + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -204,3 +312,8 @@ def __init__(self, type, url, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/image_widget_definition_type.py b/src/datadog_api_client/v1/model/image_widget_definition_type.py index 72f2e5f892..e86dc04fcc 100644 --- a/src/datadog_api_client/v1/model/image_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/image_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ImageWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ImageWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ImageWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the image widget.. if omitted defaults to "image", must be one of ["image", ] # noqa: E501 + + Keyword Args: + value (str): Type of the image widget.. if omitted defaults to "image", must be one of ["image", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "image" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/intake_payload_accepted.py b/src/datadog_api_client/v1/model/intake_payload_accepted.py index 41cb1f731e..2166b22526 100644 --- a/src/datadog_api_client/v1/model/intake_payload_accepted.py +++ b/src/datadog_api_client/v1/model/intake_payload_accepted.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IntakePayloadAccepted(ModelNormal): @@ -50,7 +52,23 @@ class IntakePayloadAccepted(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IntakePayloadAccepted - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (str): The status of the intake payload.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_agents.py b/src/datadog_api_client/v1/model/ip_prefixes_agents.py index 35e475ac4a..43ad46636a 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_agents.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_agents.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesAgents(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesAgents(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesAgents - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_api.py b/src/datadog_api_client/v1/model/ip_prefixes_api.py index 5e8d7e6e16..28f4a6b234 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_api.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_api.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesAPI(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesAPI(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesAPI - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_apm.py b/src/datadog_api_client/v1/model/ip_prefixes_apm.py index cca9d0b97e..43d615b9ba 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_apm.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_apm.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesAPM(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesAPM(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesAPM - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_logs.py b/src/datadog_api_client/v1/model/ip_prefixes_logs.py index ba55c88634..4886fdc299 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_logs.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_logs.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesLogs(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesLogs(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesLogs - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_process.py b/src/datadog_api_client/v1/model/ip_prefixes_process.py index 0f963dd4e4..06a32e3652 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_process.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_process.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesProcess(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesProcess(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesProcess - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_synthetics.py b/src/datadog_api_client/v1/model/ip_prefixes_synthetics.py index d72aae478c..74ed505cb1 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_synthetics.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_synthetics.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesSynthetics(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesSynthetics(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesSynthetics - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv4_by_location ({str: ([str],)}): List of IPv4 prefixes by location.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + prefixes_ipv6_by_location ({str: ([str],)}): List of IPv6 prefixes by location.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_prefixes_webhooks.py b/src/datadog_api_client/v1/model/ip_prefixes_webhooks.py index 8bae9751a7..ded03130e9 100644 --- a/src/datadog_api_client/v1/model/ip_prefixes_webhooks.py +++ b/src/datadog_api_client/v1/model/ip_prefixes_webhooks.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class IPPrefixesWebhooks(ModelNormal): @@ -50,7 +52,23 @@ class IPPrefixesWebhooks(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPPrefixesWebhooks - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + prefixes_ipv4 ([str]): List of IPv4 prefixes.. [optional] # noqa: E501 + prefixes_ipv6 ([str]): List of IPv6 prefixes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/ip_ranges.py b/src/datadog_api_client/v1/model/ip_ranges.py index 013f668a45..6040c3586c 100644 --- a/src/datadog_api_client/v1/model/ip_ranges.py +++ b/src/datadog_api_client/v1/model/ip_ranges.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -68,7 +70,24 @@ class IPRanges(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IPRanges - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agents (IPPrefixesAgents): [optional] # noqa: E501 + api (IPPrefixesAPI): [optional] # noqa: E501 + apm (IPPrefixesAPM): [optional] # noqa: E501 + logs (IPPrefixesLogs): [optional] # noqa: E501 + modified (str): Date when last updated, in the form `YYYY-MM-DD-hh-mm-ss`.. [optional] # noqa: E501 + process (IPPrefixesProcess): [optional] # noqa: E501 + synthetics (IPPrefixesSynthetics): [optional] # noqa: E501 + version (int): Version of the IP list.. [optional] # noqa: E501 + webhooks (IPPrefixesWebhooks): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -204,3 +308,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/list_stream_column.py b/src/datadog_api_client/v1/model/list_stream_column.py index f2a278416c..220b5fe51a 100644 --- a/src/datadog_api_client/v1/model/list_stream_column.py +++ b/src/datadog_api_client/v1/model/list_stream_column.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ListStreamColumn(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, field, width, *args, **kwargs): # noqa: E501 + """ListStreamColumn - a model defined in OpenAPI + + Args: + field (str): Widget column field. + width (ListStreamColumnWidth): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.field = field + self.width = width + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, field, width, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/list_stream_column_width.py b/src/datadog_api_client/v1/model/list_stream_column_width.py index 6b5ddf4b37..c527bbf48e 100644 --- a/src/datadog_api_client/v1/model/list_stream_column_width.py +++ b/src/datadog_api_client/v1/model/list_stream_column_width.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ListStreamColumnWidth(ModelSimple): @@ -52,7 +54,23 @@ class ListStreamColumnWidth(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ListStreamColumnWidth - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Widget column width.., must be one of ["auto", "compact", "full", ] # noqa: E501 + + Keyword Args: + value (str): Widget column width.., must be one of ["auto", "compact", "full", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/list_stream_query.py b/src/datadog_api_client/v1/model/list_stream_query.py index 25b23e823f..2a79589492 100644 --- a/src/datadog_api_client/v1/model/list_stream_query.py +++ b/src/datadog_api_client/v1/model/list_stream_query.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ListStreamQuery(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data_source, query_string, *args, **kwargs): # noqa: E501 + """ListStreamQuery - a model defined in OpenAPI + + Args: + data_source (ListStreamSource): + query_string (str): Widget query. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + indexes ([str]): List of indexes.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data_source = data_source + self.query_string = query_string + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +280,8 @@ def __init__(self, data_source, query_string, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/list_stream_response_format.py b/src/datadog_api_client/v1/model/list_stream_response_format.py index 029646102a..6a789b98ac 100644 --- a/src/datadog_api_client/v1/model/list_stream_response_format.py +++ b/src/datadog_api_client/v1/model/list_stream_response_format.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ListStreamResponseFormat(ModelSimple): @@ -50,7 +52,23 @@ class ListStreamResponseFormat(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ListStreamResponseFormat - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Widget response format.. if omitted defaults to "event_list", must be one of ["event_list", ] # noqa: E501 + + Keyword Args: + value (str): Widget response format.. if omitted defaults to "event_list", must be one of ["event_list", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "event_list" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/list_stream_source.py b/src/datadog_api_client/v1/model/list_stream_source.py index 88114b6bbd..e9351c2ae0 100644 --- a/src/datadog_api_client/v1/model/list_stream_source.py +++ b/src/datadog_api_client/v1/model/list_stream_source.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ListStreamSource(ModelSimple): @@ -51,7 +53,23 @@ class ListStreamSource(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ListStreamSource - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Source from which to query items to display in the stream.. if omitted defaults to "issue_stream", must be one of ["issue_stream", "logs_stream", ] # noqa: E501 + + Keyword Args: + value (str): Source from which to query items to display in the stream.. if omitted defaults to "issue_stream", must be one of ["issue_stream", "logs_stream", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "issue_stream" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/list_stream_widget_definition.py b/src/datadog_api_client/v1/model/list_stream_widget_definition.py index 258d4914a7..585e4e8f2a 100644 --- a/src/datadog_api_client/v1/model/list_stream_widget_definition.py +++ b/src/datadog_api_client/v1/model/list_stream_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -67,7 +69,24 @@ class ListStreamWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -110,6 +129,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """ListStreamWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([ListStreamWidgetRequest]): Request payload used to query items. + type (ListStreamWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + legend_size (str): Available legend sizes for a widget. Should be one of \"0\", \"2\", \"4\", \"8\", \"16\", or \"auto\".. [optional] # noqa: E501 + show_legend (bool): Whether or not to display the legend on this widget.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -204,3 +311,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/list_stream_widget_definition_type.py b/src/datadog_api_client/v1/model/list_stream_widget_definition_type.py index bb66b071d5..3c22424687 100644 --- a/src/datadog_api_client/v1/model/list_stream_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/list_stream_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ListStreamWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ListStreamWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ListStreamWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the list stream widget.. if omitted defaults to "list_stream", must be one of ["list_stream", ] # noqa: E501 + + Keyword Args: + value (str): Type of the list stream widget.. if omitted defaults to "list_stream", must be one of ["list_stream", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "list_stream" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/list_stream_widget_request.py b/src/datadog_api_client/v1/model/list_stream_widget_request.py index 80f074baa9..17de9d14bd 100644 --- a/src/datadog_api_client/v1/model/list_stream_widget_request.py +++ b/src/datadog_api_client/v1/model/list_stream_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class ListStreamWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, columns, query, response_format, *args, **kwargs): # noqa: E501 + """ListStreamWidgetRequest - a model defined in OpenAPI + + Args: + columns ([ListStreamColumn]): Widget columns. + query (ListStreamQuery): + response_format (ListStreamResponseFormat): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.columns = columns + self.query = query + self.response_format = response_format + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +286,8 @@ def __init__(self, columns, query, response_format, *args, **kwargs): # noqa: E # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log.py b/src/datadog_api_client/v1/model/log.py index d80b6be649..3d80e3709c 100644 --- a/src/datadog_api_client/v1/model/log.py +++ b/src/datadog_api_client/v1/model/log.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class Log(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Log - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + content (LogContent): [optional] # noqa: E501 + id (str): Unique ID of the Log.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_content.py b/src/datadog_api_client/v1/model/log_content.py index 1789aae86e..2e86736234 100644 --- a/src/datadog_api_client/v1/model/log_content.py +++ b/src/datadog_api_client/v1/model/log_content.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogContent(ModelNormal): @@ -50,7 +52,23 @@ class LogContent(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogContent - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): JSON object of attributes from your log.. [optional] # noqa: E501 + host (str): Name of the machine from where the logs are being sent.. [optional] # noqa: E501 + message (str): The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes) of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry. That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.. [optional] # noqa: E501 + service (str): The name of the application or service generating the log events. It is used to switch from Logs to APM, so make sure you define the same value when you use both products.. [optional] # noqa: E501 + tags ([bool, date, datetime, dict, float, int, list, str, none_type]): Array of tags associated with your log.. [optional] # noqa: E501 + timestamp (datetime): Timestamp of your log.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_query_definition.py b/src/datadog_api_client/v1/model/log_query_definition.py index 056a16d183..ae58f48ee0 100644 --- a/src/datadog_api_client/v1/model/log_query_definition.py +++ b/src/datadog_api_client/v1/model/log_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogQueryDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogQueryDefinition - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + compute (LogsQueryCompute): [optional] # noqa: E501 + group_by ([LogQueryDefinitionGroupBy]): List of tag prefixes to group by in the case of a cluster check.. [optional] # noqa: E501 + index (str): A coma separated-list of index names. Use \"*\" query all indexes at once. [Multiple Indexes](https://docs.datadoghq.com/logs/indexes/#multiple-indexes). [optional] # noqa: E501 + multi_compute ([LogsQueryCompute]): This field is mutually exclusive with `compute`.. [optional] # noqa: E501 + search (LogQueryDefinitionSearch): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_query_definition_group_by.py b/src/datadog_api_client/v1/model/log_query_definition_group_by.py index 1f5eae6226..e6a7f103dc 100644 --- a/src/datadog_api_client/v1/model/log_query_definition_group_by.py +++ b/src/datadog_api_client/v1/model/log_query_definition_group_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogQueryDefinitionGroupBy(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, facet, *args, **kwargs): # noqa: E501 + """LogQueryDefinitionGroupBy - a model defined in OpenAPI + + Args: + facet (str): Facet name. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + limit (int): Maximum number of items in the group.. [optional] # noqa: E501 + sort (LogQueryDefinitionGroupBySort): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.facet = facet + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, facet, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_query_definition_group_by_sort.py b/src/datadog_api_client/v1/model/log_query_definition_group_by_sort.py index ef56caef5f..5ff88e7af1 100644 --- a/src/datadog_api_client/v1/model/log_query_definition_group_by_sort.py +++ b/src/datadog_api_client/v1/model/log_query_definition_group_by_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogQueryDefinitionGroupBySort(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, aggregation, order, *args, **kwargs): # noqa: E501 + """LogQueryDefinitionGroupBySort - a model defined in OpenAPI + + Args: + aggregation (str): The aggregation method. + order (WidgetSort): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + facet (str): Facet name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.aggregation = aggregation + self.order = order + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +280,8 @@ def __init__(self, aggregation, order, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_query_definition_search.py b/src/datadog_api_client/v1/model/log_query_definition_search.py index 5593104220..40cec78bae 100644 --- a/src/datadog_api_client/v1/model/log_query_definition_search.py +++ b/src/datadog_api_client/v1/model/log_query_definition_search.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogQueryDefinitionSearch(ModelNormal): @@ -50,7 +52,23 @@ class LogQueryDefinitionSearch(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, *args, **kwargs): # noqa: E501 + """LogQueryDefinitionSearch - a model defined in OpenAPI + + Args: + query (str): Search value to apply. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_stream_widget_definition.py b/src/datadog_api_client/v1/model/log_stream_widget_definition.py index 2027520d7d..188822d4aa 100644 --- a/src/datadog_api_client/v1/model/log_stream_widget_definition.py +++ b/src/datadog_api_client/v1/model/log_stream_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class LogStreamWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -117,6 +136,98 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogStreamWidgetDefinition - a model defined in OpenAPI + + Args: + type (LogStreamWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + columns ([str]): Which columns to display on the widget.. [optional] # noqa: E501 + indexes ([str]): An array of index names to query in the stream. Use [] to query all indexes at once.. [optional] # noqa: E501 + logset (str): ID of the log set to use.. [optional] # noqa: E501 + message_display (WidgetMessageDisplay): [optional] # noqa: E501 + query (str): Query to filter the log stream with.. [optional] # noqa: E501 + show_date_column (bool): Whether to show the date column or not. [optional] # noqa: E501 + show_message_column (bool): Whether to show the message column or not. [optional] # noqa: E501 + sort (WidgetFieldSort): [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -215,3 +326,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/log_stream_widget_definition_type.py b/src/datadog_api_client/v1/model/log_stream_widget_definition_type.py index f5e01d0ac2..eaa92afaaf 100644 --- a/src/datadog_api_client/v1/model/log_stream_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/log_stream_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogStreamWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class LogStreamWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogStreamWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the log stream widget.. if omitted defaults to "log_stream", must be one of ["log_stream", ] # noqa: E501 + + Keyword Args: + value (str): Type of the log stream widget.. if omitted defaults to "log_stream", must be one of ["log_stream", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "log_stream" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_api_error.py b/src/datadog_api_client/v1/model/logs_api_error.py index fdb3ad4a22..74ed3bc109 100644 --- a/src/datadog_api_client/v1/model/logs_api_error.py +++ b/src/datadog_api_client/v1/model/logs_api_error.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsAPIError(ModelNormal): @@ -50,7 +52,23 @@ class LogsAPIError(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAPIError - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + code (str): Code identifying the error. [optional] # noqa: E501 + details ([LogsAPIError]): Additional error details. [optional] # noqa: E501 + message (str): Error message. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_api_error_response.py b/src/datadog_api_client/v1/model/logs_api_error_response.py index a5118a6d60..cdee573ac7 100644 --- a/src/datadog_api_client/v1/model/logs_api_error_response.py +++ b/src/datadog_api_client/v1/model/logs_api_error_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsAPIErrorResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAPIErrorResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error (LogsAPIError): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_arithmetic_processor.py b/src/datadog_api_client/v1/model/logs_arithmetic_processor.py index 906807daff..6fb42e6e15 100644 --- a/src/datadog_api_client/v1/model/logs_arithmetic_processor.py +++ b/src/datadog_api_client/v1/model/logs_arithmetic_processor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArithmeticProcessor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, expression, target, type, *args, **kwargs): # noqa: E501 + """LogsArithmeticProcessor - a model defined in OpenAPI + + Args: + expression (str): Arithmetic operation between one or more log attributes. + target (str): Name of the attribute that contains the result of the arithmetic operation. + type (LogsArithmeticProcessorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + is_replace_missing (bool): If `true`, it replaces all missing attributes of expression by `0`, `false` skip the operation if an attribute is missing.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.expression = expression + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +294,8 @@ def __init__(self, expression, target, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_arithmetic_processor_type.py b/src/datadog_api_client/v1/model/logs_arithmetic_processor_type.py index 686538cac5..7844217cea 100644 --- a/src/datadog_api_client/v1/model/logs_arithmetic_processor_type.py +++ b/src/datadog_api_client/v1/model/logs_arithmetic_processor_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsArithmeticProcessorType(ModelSimple): @@ -50,7 +52,23 @@ class LogsArithmeticProcessorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsArithmeticProcessorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs arithmetic processor.. if omitted defaults to "arithmetic-processor", must be one of ["arithmetic-processor", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs arithmetic processor.. if omitted defaults to "arithmetic-processor", must be one of ["arithmetic-processor", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "arithmetic-processor" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_attribute_remapper.py b/src/datadog_api_client/v1/model/logs_attribute_remapper.py index e496b14863..444de0e62b 100644 --- a/src/datadog_api_client/v1/model/logs_attribute_remapper.py +++ b/src/datadog_api_client/v1/model/logs_attribute_remapper.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsAttributeRemapper(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,6 +124,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, sources, target, type, *args, **kwargs): # noqa: E501 + """LogsAttributeRemapper - a model defined in OpenAPI + + Args: + sources ([str]): Array of source attributes. + target (str): Final attribute or tag name to remap the sources to. + type (LogsAttributeRemapperType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + override_on_conflict (bool): Override or not the target element if already set,. [optional] if omitted the server will use the default value of False # noqa: E501 + preserve_source (bool): Remove or preserve the remapped source element.. [optional] if omitted the server will use the default value of False # noqa: E501 + source_type (str): Defines if the sources are from log `attribute` or `tag`.. [optional] if omitted the server will use the default value of "attribute" # noqa: E501 + target_format (TargetFormatType): [optional] # noqa: E501 + target_type (str): Defines if the final attribute or tag name is from log `attribute` or `tag`.. [optional] if omitted the server will use the default value of "attribute" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -202,3 +312,8 @@ def __init__(self, sources, target, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_attribute_remapper_type.py b/src/datadog_api_client/v1/model/logs_attribute_remapper_type.py index 2149bc13cc..e8c8d83ce7 100644 --- a/src/datadog_api_client/v1/model/logs_attribute_remapper_type.py +++ b/src/datadog_api_client/v1/model/logs_attribute_remapper_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsAttributeRemapperType(ModelSimple): @@ -50,7 +52,23 @@ class LogsAttributeRemapperType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsAttributeRemapperType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs attribute remapper.. if omitted defaults to "attribute-remapper", must be one of ["attribute-remapper", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs attribute remapper.. if omitted defaults to "attribute-remapper", must be one of ["attribute-remapper", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "attribute-remapper" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_by_retention.py b/src/datadog_api_client/v1/model/logs_by_retention.py index 951306e11d..ea2777b47f 100644 --- a/src/datadog_api_client/v1/model/logs_by_retention.py +++ b/src/datadog_api_client/v1/model/logs_by_retention.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsByRetention(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsByRetention - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + orgs (LogsByRetentionOrgs): [optional] # noqa: E501 + usage ([LogsRetentionAggSumUsage]): Aggregated index logs usage for each retention period with usage.. [optional] # noqa: E501 + usage_by_month (LogsByRetentionMonthlyUsage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_by_retention_monthly_usage.py b/src/datadog_api_client/v1/model/logs_by_retention_monthly_usage.py index db3ec973ff..376b163a67 100644 --- a/src/datadog_api_client/v1/model/logs_by_retention_monthly_usage.py +++ b/src/datadog_api_client/v1/model/logs_by_retention_monthly_usage.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsByRetentionMonthlyUsage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsByRetentionMonthlyUsage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + date (str): The month for the usage.. [optional] # noqa: E501 + usage ([LogsRetentionSumUsage]): Indexed logs usage for each active retention for the month.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_by_retention_org_usage.py b/src/datadog_api_client/v1/model/logs_by_retention_org_usage.py index 57d5eb8a1b..f76beeddf0 100644 --- a/src/datadog_api_client/v1/model/logs_by_retention_org_usage.py +++ b/src/datadog_api_client/v1/model/logs_by_retention_org_usage.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsByRetentionOrgUsage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsByRetentionOrgUsage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([LogsRetentionSumUsage]): Indexed logs usage for each active retention for the organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_by_retention_orgs.py b/src/datadog_api_client/v1/model/logs_by_retention_orgs.py index ac621b5e22..98190f4f0a 100644 --- a/src/datadog_api_client/v1/model/logs_by_retention_orgs.py +++ b/src/datadog_api_client/v1/model/logs_by_retention_orgs.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsByRetentionOrgs(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsByRetentionOrgs - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([LogsByRetentionOrgUsage]): Indexed logs usage summary for each organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_category_processor.py b/src/datadog_api_client/v1/model/logs_category_processor.py index c87bccc88c..7f069c0739 100644 --- a/src/datadog_api_client/v1/model/logs_category_processor.py +++ b/src/datadog_api_client/v1/model/logs_category_processor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsCategoryProcessor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, categories, target, type, *args, **kwargs): # noqa: E501 + """LogsCategoryProcessor - a model defined in OpenAPI + + Args: + categories ([LogsCategoryProcessorCategory]): Array of filters to match or not a log and their corresponding `name`to assign a custom value to the log. + target (str): Name of the target attribute which value is defined by the matching category. + type (LogsCategoryProcessorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.categories = categories + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -187,3 +292,8 @@ def __init__(self, categories, target, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_category_processor_category.py b/src/datadog_api_client/v1/model/logs_category_processor_category.py index 2fc07135fa..01dadb9b49 100644 --- a/src/datadog_api_client/v1/model/logs_category_processor_category.py +++ b/src/datadog_api_client/v1/model/logs_category_processor_category.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsCategoryProcessorCategory(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsCategoryProcessorCategory - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsFilter): [optional] # noqa: E501 + name (str): Value to assign to the target attribute.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_category_processor_type.py b/src/datadog_api_client/v1/model/logs_category_processor_type.py index ad590eb9d6..840a19d188 100644 --- a/src/datadog_api_client/v1/model/logs_category_processor_type.py +++ b/src/datadog_api_client/v1/model/logs_category_processor_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsCategoryProcessorType(ModelSimple): @@ -50,7 +52,23 @@ class LogsCategoryProcessorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsCategoryProcessorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs category processor.. if omitted defaults to "category-processor", must be one of ["category-processor", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs category processor.. if omitted defaults to "category-processor", must be one of ["category-processor", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "category-processor" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_date_remapper.py b/src/datadog_api_client/v1/model/logs_date_remapper.py index 9b320f832b..5555c9ba79 100644 --- a/src/datadog_api_client/v1/model/logs_date_remapper.py +++ b/src/datadog_api_client/v1/model/logs_date_remapper.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsDateRemapper(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, sources, type, *args, **kwargs): # noqa: E501 + """LogsDateRemapper - a model defined in OpenAPI + + Args: + sources ([str]): Array of source attributes. + type (LogsDateRemapperType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, sources, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_date_remapper_type.py b/src/datadog_api_client/v1/model/logs_date_remapper_type.py index 7878c7ea1a..d4c31ee4b9 100644 --- a/src/datadog_api_client/v1/model/logs_date_remapper_type.py +++ b/src/datadog_api_client/v1/model/logs_date_remapper_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsDateRemapperType(ModelSimple): @@ -50,7 +52,23 @@ class LogsDateRemapperType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsDateRemapperType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs date remapper.. if omitted defaults to "date-remapper", must be one of ["date-remapper", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs date remapper.. if omitted defaults to "date-remapper", must be one of ["date-remapper", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "date-remapper" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_exclusion.py b/src/datadog_api_client/v1/model/logs_exclusion.py index 40c7891d30..dda500a1f1 100644 --- a/src/datadog_api_client/v1/model/logs_exclusion.py +++ b/src/datadog_api_client/v1/model/logs_exclusion.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsExclusion(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """LogsExclusion - a model defined in OpenAPI + + Args: + name (str): Name of the index exclusion filter. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsExclusionFilter): [optional] # noqa: E501 + is_enabled (bool): Whether or not the exclusion filter is active.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_exclusion_filter.py b/src/datadog_api_client/v1/model/logs_exclusion_filter.py index 5e58498b23..c6ac25f1b2 100644 --- a/src/datadog_api_client/v1/model/logs_exclusion_filter.py +++ b/src/datadog_api_client/v1/model/logs_exclusion_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsExclusionFilter(ModelNormal): @@ -50,7 +52,23 @@ class LogsExclusionFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, sample_rate, *args, **kwargs): # noqa: E501 + """LogsExclusionFilter - a model defined in OpenAPI + + Args: + sample_rate (float): Sample rate to apply to logs going through this exclusion filter, a value of 1 will exclude all logs matching the query. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + query (str): Default query is `*`, meaning all logs flowing in the index would be excluded. Scope down exclusion filter to only a subset of logs with a log query.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sample_rate = sample_rate + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +266,8 @@ def __init__(self, sample_rate, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_filter.py b/src/datadog_api_client/v1/model/logs_filter.py index 47f5dfc2fe..6d5bef8dc1 100644 --- a/src/datadog_api_client/v1/model/logs_filter.py +++ b/src/datadog_api_client/v1/model/logs_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsFilter(ModelNormal): @@ -50,7 +52,23 @@ class LogsFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + query (str): The filter query.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_geo_ip_parser.py b/src/datadog_api_client/v1/model/logs_geo_ip_parser.py index d9b641ede1..19085295c6 100644 --- a/src/datadog_api_client/v1/model/logs_geo_ip_parser.py +++ b/src/datadog_api_client/v1/model/logs_geo_ip_parser.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsGeoIPParser(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogsGeoIPParser - a model defined in OpenAPI + + Args: + type (LogsGeoIPParserType): + + Keyword Args: + sources ([str]): Array of source attributes.. defaults to ["network.client.ip"] # noqa: E501 + target (str): Name of the parent attribute that contains all the extracted details from the `sources`.. defaults to "network.client.geoip" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + sources = kwargs.get("sources", ["network.client.ip"]) + target = kwargs.get("target", "network.client.geoip") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -187,3 +294,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_geo_ip_parser_type.py b/src/datadog_api_client/v1/model/logs_geo_ip_parser_type.py index fd7e8b5817..af16660161 100644 --- a/src/datadog_api_client/v1/model/logs_geo_ip_parser_type.py +++ b/src/datadog_api_client/v1/model/logs_geo_ip_parser_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsGeoIPParserType(ModelSimple): @@ -50,7 +52,23 @@ class LogsGeoIPParserType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsGeoIPParserType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of GeoIP parser.. if omitted defaults to "geo-ip-parser", must be one of ["geo-ip-parser", ] # noqa: E501 + + Keyword Args: + value (str): Type of GeoIP parser.. if omitted defaults to "geo-ip-parser", must be one of ["geo-ip-parser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "geo-ip-parser" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_grok_parser.py b/src/datadog_api_client/v1/model/logs_grok_parser.py index 93fe145f03..c535ab6b3c 100644 --- a/src/datadog_api_client/v1/model/logs_grok_parser.py +++ b/src/datadog_api_client/v1/model/logs_grok_parser.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class LogsGrokParser(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, grok, type, *args, **kwargs): # noqa: E501 + """LogsGrokParser - a model defined in OpenAPI + + Args: + grok (LogsGrokParserRules): + type (LogsGrokParserType): + + Keyword Args: + source (str): Name of the log attribute to parse.. defaults to "message" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + samples ([str]): List of sample logs to test this grok parser.. [optional] # noqa: E501 + """ + + source = kwargs.get("source", "message") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.grok = grok + self.source = source + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -195,3 +302,8 @@ def __init__(self, grok, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_grok_parser_rules.py b/src/datadog_api_client/v1/model/logs_grok_parser_rules.py index 8cb3a8915e..86bde1ea65 100644 --- a/src/datadog_api_client/v1/model/logs_grok_parser_rules.py +++ b/src/datadog_api_client/v1/model/logs_grok_parser_rules.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsGrokParserRules(ModelNormal): @@ -50,7 +52,23 @@ class LogsGrokParserRules(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, match_rules, *args, **kwargs): # noqa: E501 + """LogsGrokParserRules - a model defined in OpenAPI + + Args: + match_rules (str): List of match rules for the grok parser, separated by a new line. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + support_rules (str): List of support rules for the grok parser, separated by a new line.. [optional] if omitted the server will use the default value of "" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.match_rules = match_rules + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +266,8 @@ def __init__(self, match_rules, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_grok_parser_type.py b/src/datadog_api_client/v1/model/logs_grok_parser_type.py index cd28336fad..e9e0924042 100644 --- a/src/datadog_api_client/v1/model/logs_grok_parser_type.py +++ b/src/datadog_api_client/v1/model/logs_grok_parser_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsGrokParserType(ModelSimple): @@ -50,7 +52,23 @@ class LogsGrokParserType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsGrokParserType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs grok parser.. if omitted defaults to "grok-parser", must be one of ["grok-parser", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs grok parser.. if omitted defaults to "grok-parser", must be one of ["grok-parser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "grok-parser" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_index.py b/src/datadog_api_client/v1/model/logs_index.py index da4db54dea..ef25903149 100644 --- a/src/datadog_api_client/v1/model/logs_index.py +++ b/src/datadog_api_client/v1/model/logs_index.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsIndex(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, filter, name, *args, **kwargs): # noqa: E501 + """LogsIndex - a model defined in OpenAPI + + Args: + filter (LogsFilter): + name (str): The name of the index. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + daily_limit (int): The number of log events you can send in this index per day before you are rate-limited.. [optional] # noqa: E501 + exclusion_filters ([LogsExclusion]): An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.. [optional] # noqa: E501 + is_rate_limited (bool): A boolean stating if the index is rate limited, meaning more logs than the daily limit have been sent. Rate limit is reset every-day at 2pm UTC.. [optional] # noqa: E501 + num_retention_days (int): The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.filter = filter + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +294,8 @@ def __init__(self, filter, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_index_list_response.py b/src/datadog_api_client/v1/model/logs_index_list_response.py index 016b3f278a..586f6c1a0c 100644 --- a/src/datadog_api_client/v1/model/logs_index_list_response.py +++ b/src/datadog_api_client/v1/model/logs_index_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsIndexListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsIndexListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + indexes ([LogsIndex]): Array of Log index configurations.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_index_update_request.py b/src/datadog_api_client/v1/model/logs_index_update_request.py index 586909ffa5..2edf765d57 100644 --- a/src/datadog_api_client/v1/model/logs_index_update_request.py +++ b/src/datadog_api_client/v1/model/logs_index_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsIndexUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, filter, *args, **kwargs): # noqa: E501 + """LogsIndexUpdateRequest - a model defined in OpenAPI + + Args: + filter (LogsFilter): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + daily_limit (int): The number of log events you can send in this index per day before you are rate-limited.. [optional] # noqa: E501 + disable_daily_limit (bool): If true, sets the `daily_limit` value to null and the index is not limited on a daily basis (any specified `daily_limit` value in the request is ignored). If false or omitted, the index's current `daily_limit` is maintained.. [optional] # noqa: E501 + exclusion_filters ([LogsExclusion]): An array of exclusion objects. The logs are tested against the query of each filter, following the order of the array. Only the first matching active exclusion matters, others (if any) are ignored.. [optional] # noqa: E501 + num_retention_days (int): The number of days before logs are deleted from this index. Available values depend on retention plans specified in your organization's contract/subscriptions. **Note:** Changing the retention for an index adjusts the length of retention for all logs already in this index. It may also affect billing.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.filter = filter + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +288,8 @@ def __init__(self, filter, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_indexes_order.py b/src/datadog_api_client/v1/model/logs_indexes_order.py index c34740d195..df8b7f65f0 100644 --- a/src/datadog_api_client/v1/model/logs_indexes_order.py +++ b/src/datadog_api_client/v1/model/logs_indexes_order.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsIndexesOrder(ModelNormal): @@ -50,7 +52,23 @@ class LogsIndexesOrder(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, index_names, *args, **kwargs): # noqa: E501 + """LogsIndexesOrder - a model defined in OpenAPI + + Args: + index_names ([str]): Array of strings identifying by their name(s) the index(es) of your organization. Logs are tested against the query filter of each index one by one, following the order of the array. Logs are eventually stored in the first matching index. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.index_names = index_names + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, index_names, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_list_request.py b/src/datadog_api_client/v1/model/logs_list_request.py index a28b216488..96bb2bc070 100644 --- a/src/datadog_api_client/v1/model/logs_list_request.py +++ b/src/datadog_api_client/v1/model/logs_list_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class LogsListRequest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, time, *args, **kwargs): # noqa: E501 + """LogsListRequest - a model defined in OpenAPI + + Args: + time (LogsListRequestTime): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + index (str): The log index on which the request is performed. For multi-index organizations, the default is all live indexes. Historical indexes of rehydrated logs must be specified.. [optional] # noqa: E501 + limit (int): Number of logs return in the response.. [optional] # noqa: E501 + query (str): The search query - following the log search syntax.. [optional] # noqa: E501 + sort (LogsSort): [optional] # noqa: E501 + start_at (str): Hash identifier of the first log to return in the list, available in a log `id` attribute. This parameter is used for the pagination feature. **Note**: This parameter is ignored if the corresponding log is out of the scope of the specified time window.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.time = time + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +296,8 @@ def __init__(self, time, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_list_request_time.py b/src/datadog_api_client/v1/model/logs_list_request_time.py index 886c4ed960..03fee6b0fe 100644 --- a/src/datadog_api_client/v1/model/logs_list_request_time.py +++ b/src/datadog_api_client/v1/model/logs_list_request_time.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsListRequestTime(ModelNormal): @@ -50,7 +52,23 @@ class LogsListRequestTime(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, _from, to, *args, **kwargs): # noqa: E501 + """LogsListRequestTime - a model defined in OpenAPI + + Args: + _from (datetime): Minimum timestamp for requested logs. + to (datetime): Maximum timestamp for requested logs. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + timezone (str): Timezone can be specified both as an offset (e.g. \"UTC+03:00\") or a regional zone (e.g. \"Europe/Paris\").. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self._from = _from + self.to = to + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +272,8 @@ def __init__(self, _from, to, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_list_response.py b/src/datadog_api_client/v1/model/logs_list_response.py index 71192fe9ae..b6b3d8e128 100644 --- a/src/datadog_api_client/v1/model/logs_list_response.py +++ b/src/datadog_api_client/v1/model/logs_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + logs ([Log]): Array of logs matching the request and the `nextLogId` if sent.. [optional] # noqa: E501 + next_log_id (str): Hash identifier of the next log to return in the list. This parameter is used for the pagination feature.. [optional] # noqa: E501 + status (str): Status of the response.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_lookup_processor.py b/src/datadog_api_client/v1/model/logs_lookup_processor.py index 488ec0d957..a2f028d077 100644 --- a/src/datadog_api_client/v1/model/logs_lookup_processor.py +++ b/src/datadog_api_client/v1/model/logs_lookup_processor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsLookupProcessor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, lookup_table, source, target, type, *args, **kwargs): # noqa: E501 + """LogsLookupProcessor - a model defined in OpenAPI + + Args: + lookup_table ([str]): Mapping table of values for the source attribute and their associated target attribute values, formatted as `[\"source_key1,target_value1\", \"source_key2,target_value2\"]` + source (str): Source attribute used to perform the lookup. + target (str): Name of the attribute that contains the corresponding value in the mapping list or the `default_lookup` if not found in the mapping list. + type (LogsLookupProcessorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + default_lookup (str): Value to set the target attribute if the source value is not found in the list.. [optional] # noqa: E501 + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.lookup_table = lookup_table + self.source = source + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +300,8 @@ def __init__(self, lookup_table, source, target, type, *args, **kwargs): # noqa # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_lookup_processor_type.py b/src/datadog_api_client/v1/model/logs_lookup_processor_type.py index 5dcae73ee2..d8a680edff 100644 --- a/src/datadog_api_client/v1/model/logs_lookup_processor_type.py +++ b/src/datadog_api_client/v1/model/logs_lookup_processor_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsLookupProcessorType(ModelSimple): @@ -50,7 +52,23 @@ class LogsLookupProcessorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsLookupProcessorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs lookup processor.. if omitted defaults to "lookup-processor", must be one of ["lookup-processor", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs lookup processor.. if omitted defaults to "lookup-processor", must be one of ["lookup-processor", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "lookup-processor" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_message_remapper.py b/src/datadog_api_client/v1/model/logs_message_remapper.py index f74fc6299b..cf41dba30b 100644 --- a/src/datadog_api_client/v1/model/logs_message_remapper.py +++ b/src/datadog_api_client/v1/model/logs_message_remapper.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsMessageRemapper(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogsMessageRemapper - a model defined in OpenAPI + + Args: + type (LogsMessageRemapperType): + + Keyword Args: + sources ([str]): Array of source attributes.. defaults to ["msg"] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + sources = kwargs.get("sources", ["msg"]) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +286,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_message_remapper_type.py b/src/datadog_api_client/v1/model/logs_message_remapper_type.py index 059b8cf4df..935d578635 100644 --- a/src/datadog_api_client/v1/model/logs_message_remapper_type.py +++ b/src/datadog_api_client/v1/model/logs_message_remapper_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsMessageRemapperType(ModelSimple): @@ -50,7 +52,23 @@ class LogsMessageRemapperType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsMessageRemapperType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs message remapper.. if omitted defaults to "message-remapper", must be one of ["message-remapper", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs message remapper.. if omitted defaults to "message-remapper", must be one of ["message-remapper", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "message-remapper" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_pipeline.py b/src/datadog_api_client/v1/model/logs_pipeline.py index 40bddacc42..5adb2475b0 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline.py +++ b/src/datadog_api_client/v1/model/logs_pipeline.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsPipeline(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """LogsPipeline - a model defined in OpenAPI + + Args: + name (str): Name of the pipeline. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsFilter): [optional] # noqa: E501 + id (str): ID of the pipeline.. [optional] # noqa: E501 + is_enabled (bool): Whether or not the pipeline is enabled.. [optional] # noqa: E501 + is_read_only (bool): Whether or not the pipeline can be edited.. [optional] # noqa: E501 + processors ([LogsProcessor]): Ordered list of processors in this pipeline.. [optional] # noqa: E501 + type (str): Type of pipeline.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -191,3 +296,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_pipeline_list.py b/src/datadog_api_client/v1/model/logs_pipeline_list.py index c5536b4003..8389467077 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline_list.py +++ b/src/datadog_api_client/v1/model/logs_pipeline_list.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class LogsPipelineList(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsPipelineList - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([LogsPipeline]): Array of pipeline ID strings.. # noqa: E501 + + Keyword Args: + value ([LogsPipeline]): Array of pipeline ID strings.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_pipeline_processor.py b/src/datadog_api_client/v1/model/logs_pipeline_processor.py index 7dbbd32faa..b83da469f6 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline_processor.py +++ b/src/datadog_api_client/v1/model/logs_pipeline_processor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsPipelineProcessor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogsPipelineProcessor - a model defined in OpenAPI + + Args: + type (LogsPipelineProcessorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsFilter): [optional] # noqa: E501 + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + processors ([LogsProcessor]): Ordered list of processors in this pipeline.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -187,3 +290,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_pipeline_processor_type.py b/src/datadog_api_client/v1/model/logs_pipeline_processor_type.py index 4ef4b93453..543a6344e3 100644 --- a/src/datadog_api_client/v1/model/logs_pipeline_processor_type.py +++ b/src/datadog_api_client/v1/model/logs_pipeline_processor_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsPipelineProcessorType(ModelSimple): @@ -50,7 +52,23 @@ class LogsPipelineProcessorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsPipelineProcessorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs pipeline processor.. if omitted defaults to "pipeline", must be one of ["pipeline", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs pipeline processor.. if omitted defaults to "pipeline", must be one of ["pipeline", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "pipeline" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_pipelines_order.py b/src/datadog_api_client/v1/model/logs_pipelines_order.py index 38b6c138f5..b4cb677a38 100644 --- a/src/datadog_api_client/v1/model/logs_pipelines_order.py +++ b/src/datadog_api_client/v1/model/logs_pipelines_order.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsPipelinesOrder(ModelNormal): @@ -50,7 +52,23 @@ class LogsPipelinesOrder(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, pipeline_ids, *args, **kwargs): # noqa: E501 + """LogsPipelinesOrder - a model defined in OpenAPI + + Args: + pipeline_ids ([str]): Ordered Array of `` strings, the order of pipeline IDs in the array define the overall Pipelines order for Datadog. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.pipeline_ids = pipeline_ids + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, pipeline_ids, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_processor.py b/src/datadog_api_client/v1/model/logs_processor.py index 281ce2b9bc..2165a0725c 100644 --- a/src/datadog_api_client/v1/model/logs_processor.py +++ b/src/datadog_api_client/v1/model/logs_processor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -137,6 +139,119 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsProcessor - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + samples ([str]): List of sample logs to test this grok parser.. [optional] # noqa: E501 + override_on_conflict (bool): Override or not the target element if already set,. [optional] if omitted the server will use the default value of False # noqa: E501 + preserve_source (bool): Remove or preserve the remapped source element.. [optional] if omitted the server will use the default value of False # noqa: E501 + source_type (str): Defines if the sources are from log `attribute` or `tag`.. [optional] if omitted the server will use the default value of "attribute" # noqa: E501 + target_format (TargetFormatType): [optional] # noqa: E501 + target_type (str): Defines if the final attribute or tag name is from log `attribute` or `tag`.. [optional] if omitted the server will use the default value of "attribute" # noqa: E501 + normalize_ending_slashes (bool, none_type): Normalize the ending slashes or not.. [optional] if omitted the server will use the default value of False # noqa: E501 + is_encoded (bool): Define if the source attribute is URL encoded or not.. [optional] if omitted the server will use the default value of False # noqa: E501 + is_replace_missing (bool): If true, it replaces all missing attributes of `template` by an empty string. If `false` (default), skips the operation for missing attributes.. [optional] if omitted the server will use the default value of False # noqa: E501 + filter (LogsFilter): [optional] # noqa: E501 + processors ([LogsProcessor]): Ordered list of processors in this pipeline.. [optional] # noqa: E501 + default_lookup (str): Value to set the target attribute if the source value is not found in the list.. [optional] # noqa: E501 + grok (LogsGrokParserRules): [optional] # noqa: E501 + source (str): Source attribute used to perform the lookup.. [optional] # noqa: E501 + type (LogsTraceRemapperType): [optional] # noqa: E501 + sources ([str]): Array of source attributes.. [optional] if omitted the server will use the default value of ["dd.trace_id"] # noqa: E501 + target (str): Name of the attribute that contains the corresponding value in the mapping list or the `default_lookup` if not found in the mapping list.. [optional] # noqa: E501 + categories ([LogsCategoryProcessorCategory]): Array of filters to match or not a log and their corresponding `name`to assign a custom value to the log.. [optional] # noqa: E501 + expression (str): Arithmetic operation between one or more log attributes.. [optional] # noqa: E501 + template (str): A formula with one or more attributes and raw text.. [optional] # noqa: E501 + lookup_table ([str]): Mapping table of values for the source attribute and their associated target attribute values, formatted as `[\"source_key1,target_value1\", \"source_key2,target_value2\"]`. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -242,28 +357,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/logs_query_compute.py b/src/datadog_api_client/v1/model/logs_query_compute.py index cc1f2d028a..3e21cab4ba 100644 --- a/src/datadog_api_client/v1/model/logs_query_compute.py +++ b/src/datadog_api_client/v1/model/logs_query_compute.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsQueryCompute(ModelNormal): @@ -50,7 +52,23 @@ class LogsQueryCompute(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, aggregation, *args, **kwargs): # noqa: E501 + """LogsQueryCompute - a model defined in OpenAPI + + Args: + aggregation (str): The aggregation method. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + facet (str): Facet name.. [optional] # noqa: E501 + interval (int): Define a time interval in seconds.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.aggregation = aggregation + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +270,8 @@ def __init__(self, aggregation, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_retention_agg_sum_usage.py b/src/datadog_api_client/v1/model/logs_retention_agg_sum_usage.py index fd1ab573ed..614751f0af 100644 --- a/src/datadog_api_client/v1/model/logs_retention_agg_sum_usage.py +++ b/src/datadog_api_client/v1/model/logs_retention_agg_sum_usage.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsRetentionAggSumUsage(ModelNormal): @@ -50,7 +52,23 @@ class LogsRetentionAggSumUsage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsRetentionAggSumUsage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + logs_indexed_logs_usage_agg_sum (int): Total indexed logs for this retention period.. [optional] # noqa: E501 + logs_live_indexed_logs_usage_agg_sum (int): Live indexed logs for this retention period.. [optional] # noqa: E501 + logs_rehydrated_indexed_logs_usage_agg_sum (int): Rehydrated indexed logs for this retention period.. [optional] # noqa: E501 + retention (str): The retention period in days or \"custom\" for all custom retention periods.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_retention_sum_usage.py b/src/datadog_api_client/v1/model/logs_retention_sum_usage.py index b9a8dd540d..4215408268 100644 --- a/src/datadog_api_client/v1/model/logs_retention_sum_usage.py +++ b/src/datadog_api_client/v1/model/logs_retention_sum_usage.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsRetentionSumUsage(ModelNormal): @@ -50,7 +52,23 @@ class LogsRetentionSumUsage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsRetentionSumUsage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + logs_indexed_logs_usage_sum (int): Total indexed logs for this retention period.. [optional] # noqa: E501 + logs_live_indexed_logs_usage_sum (int): Live indexed logs for this retention period.. [optional] # noqa: E501 + logs_rehydrated_indexed_logs_usage_sum (int): Rehydrated indexed logs for this retention period.. [optional] # noqa: E501 + retention (str): The retention period in days or \"custom\" for all custom retention periods.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_service_remapper.py b/src/datadog_api_client/v1/model/logs_service_remapper.py index 2640631ced..dd9938315d 100644 --- a/src/datadog_api_client/v1/model/logs_service_remapper.py +++ b/src/datadog_api_client/v1/model/logs_service_remapper.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsServiceRemapper(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, sources, type, *args, **kwargs): # noqa: E501 + """LogsServiceRemapper - a model defined in OpenAPI + + Args: + sources ([str]): Array of source attributes. + type (LogsServiceRemapperType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, sources, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_service_remapper_type.py b/src/datadog_api_client/v1/model/logs_service_remapper_type.py index f979d6cbc8..b3cf8f9d99 100644 --- a/src/datadog_api_client/v1/model/logs_service_remapper_type.py +++ b/src/datadog_api_client/v1/model/logs_service_remapper_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsServiceRemapperType(ModelSimple): @@ -50,7 +52,23 @@ class LogsServiceRemapperType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsServiceRemapperType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs service remapper.. if omitted defaults to "service-remapper", must be one of ["service-remapper", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs service remapper.. if omitted defaults to "service-remapper", must be one of ["service-remapper", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "service-remapper" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_sort.py b/src/datadog_api_client/v1/model/logs_sort.py index efad78dbfc..ac028cd0ee 100644 --- a/src/datadog_api_client/v1/model/logs_sort.py +++ b/src/datadog_api_client/v1/model/logs_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsSort(ModelSimple): @@ -51,7 +53,23 @@ class LogsSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Time-ascending `asc` or time-descending `desc`results.., must be one of ["asc", "desc", ] # noqa: E501 + + Keyword Args: + value (str): Time-ascending `asc` or time-descending `desc`results.., must be one of ["asc", "desc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_status_remapper.py b/src/datadog_api_client/v1/model/logs_status_remapper.py index 91013c2221..d92eecdb99 100644 --- a/src/datadog_api_client/v1/model/logs_status_remapper.py +++ b/src/datadog_api_client/v1/model/logs_status_remapper.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsStatusRemapper(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, sources, type, *args, **kwargs): # noqa: E501 + """LogsStatusRemapper - a model defined in OpenAPI + + Args: + sources ([str]): Array of source attributes. + type (LogsStatusRemapperType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, sources, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_status_remapper_type.py b/src/datadog_api_client/v1/model/logs_status_remapper_type.py index 5cf6019312..3aa8edf1e5 100644 --- a/src/datadog_api_client/v1/model/logs_status_remapper_type.py +++ b/src/datadog_api_client/v1/model/logs_status_remapper_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsStatusRemapperType(ModelSimple): @@ -50,7 +52,23 @@ class LogsStatusRemapperType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsStatusRemapperType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs status remapper.. if omitted defaults to "status-remapper", must be one of ["status-remapper", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs status remapper.. if omitted defaults to "status-remapper", must be one of ["status-remapper", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "status-remapper" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_string_builder_processor.py b/src/datadog_api_client/v1/model/logs_string_builder_processor.py index 86e10e9bc2..677786df58 100644 --- a/src/datadog_api_client/v1/model/logs_string_builder_processor.py +++ b/src/datadog_api_client/v1/model/logs_string_builder_processor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsStringBuilderProcessor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, target, template, type, *args, **kwargs): # noqa: E501 + """LogsStringBuilderProcessor - a model defined in OpenAPI + + Args: + target (str): The name of the attribute that contains the result of the template. + template (str): A formula with one or more attributes and raw text. + type (LogsStringBuilderProcessorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + is_replace_missing (bool): If true, it replaces all missing attributes of `template` by an empty string. If `false` (default), skips the operation for missing attributes.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.target = target + self.template = template + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +294,8 @@ def __init__(self, target, template, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_string_builder_processor_type.py b/src/datadog_api_client/v1/model/logs_string_builder_processor_type.py index ea8567ebb3..9ec1f1d778 100644 --- a/src/datadog_api_client/v1/model/logs_string_builder_processor_type.py +++ b/src/datadog_api_client/v1/model/logs_string_builder_processor_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsStringBuilderProcessorType(ModelSimple): @@ -50,7 +52,23 @@ class LogsStringBuilderProcessorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsStringBuilderProcessorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs string builder processor.. if omitted defaults to "string-builder-processor", must be one of ["string-builder-processor", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs string builder processor.. if omitted defaults to "string-builder-processor", must be one of ["string-builder-processor", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "string-builder-processor" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_trace_remapper.py b/src/datadog_api_client/v1/model/logs_trace_remapper.py index 7a156bf4d1..6ef4b61dd9 100644 --- a/src/datadog_api_client/v1/model/logs_trace_remapper.py +++ b/src/datadog_api_client/v1/model/logs_trace_remapper.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsTraceRemapper(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogsTraceRemapper - a model defined in OpenAPI + + Args: + type (LogsTraceRemapperType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + sources ([str]): Array of source attributes.. [optional] if omitted the server will use the default value of ["dd.trace_id"] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +282,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_trace_remapper_type.py b/src/datadog_api_client/v1/model/logs_trace_remapper_type.py index 0a6f5705f8..61166ef71d 100644 --- a/src/datadog_api_client/v1/model/logs_trace_remapper_type.py +++ b/src/datadog_api_client/v1/model/logs_trace_remapper_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsTraceRemapperType(ModelSimple): @@ -50,7 +52,23 @@ class LogsTraceRemapperType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsTraceRemapperType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs trace remapper.. if omitted defaults to "trace-id-remapper", must be one of ["trace-id-remapper", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs trace remapper.. if omitted defaults to "trace-id-remapper", must be one of ["trace-id-remapper", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "trace-id-remapper" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_url_parser.py b/src/datadog_api_client/v1/model/logs_url_parser.py index 64d899e227..2b67b9a15b 100644 --- a/src/datadog_api_client/v1/model/logs_url_parser.py +++ b/src/datadog_api_client/v1/model/logs_url_parser.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsURLParser(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,6 +117,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogsURLParser - a model defined in OpenAPI + + Args: + type (LogsURLParserType): + + Keyword Args: + sources ([str]): Array of source attributes.. defaults to ["http.url"] # noqa: E501 + target (str): Name of the parent attribute that contains all the extracted details from the `sources`.. defaults to "http.url_details" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + normalize_ending_slashes (bool, none_type): Normalize the ending slashes or not.. [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + sources = kwargs.get("sources", ["http.url"]) + target = kwargs.get("target", "http.url_details") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -193,3 +301,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_url_parser_type.py b/src/datadog_api_client/v1/model/logs_url_parser_type.py index 20c619ed1a..2402ff69e2 100644 --- a/src/datadog_api_client/v1/model/logs_url_parser_type.py +++ b/src/datadog_api_client/v1/model/logs_url_parser_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsURLParserType(ModelSimple): @@ -50,7 +52,23 @@ class LogsURLParserType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsURLParserType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs URL parser.. if omitted defaults to "url-parser", must be one of ["url-parser", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs URL parser.. if omitted defaults to "url-parser", must be one of ["url-parser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "url-parser" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/logs_user_agent_parser.py b/src/datadog_api_client/v1/model/logs_user_agent_parser.py index 31e6f32528..a577b3783f 100644 --- a/src/datadog_api_client/v1/model/logs_user_agent_parser.py +++ b/src/datadog_api_client/v1/model/logs_user_agent_parser.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsUserAgentParser(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """LogsUserAgentParser - a model defined in OpenAPI + + Args: + type (LogsUserAgentParserType): + + Keyword Args: + sources ([str]): Array of source attributes.. defaults to ["http.useragent"] # noqa: E501 + target (str): Name of the parent attribute that contains all the extracted details from the `sources`.. defaults to "http.useragent_details" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_enabled (bool): Whether or not the processor is enabled.. [optional] if omitted the server will use the default value of False # noqa: E501 + is_encoded (bool): Define if the source attribute is URL encoded or not.. [optional] if omitted the server will use the default value of False # noqa: E501 + name (str): Name of the processor.. [optional] # noqa: E501 + """ + + sources = kwargs.get("sources", ["http.useragent"]) + target = kwargs.get("target", "http.useragent_details") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.sources = sources + self.target = target + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -190,3 +298,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/logs_user_agent_parser_type.py b/src/datadog_api_client/v1/model/logs_user_agent_parser_type.py index a6e249c32c..29783f006f 100644 --- a/src/datadog_api_client/v1/model/logs_user_agent_parser_type.py +++ b/src/datadog_api_client/v1/model/logs_user_agent_parser_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class LogsUserAgentParserType(ModelSimple): @@ -50,7 +52,23 @@ class LogsUserAgentParserType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsUserAgentParserType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of logs User-Agent parser.. if omitted defaults to "user-agent-parser", must be one of ["user-agent-parser", ] # noqa: E501 + + Keyword Args: + value (str): Type of logs User-Agent parser.. if omitted defaults to "user-agent-parser", must be one of ["user-agent-parser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "user-agent-parser" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/metric_metadata.py b/src/datadog_api_client/v1/model/metric_metadata.py index 3e746863b4..0a7cd74a91 100644 --- a/src/datadog_api_client/v1/model/metric_metadata.py +++ b/src/datadog_api_client/v1/model/metric_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MetricMetadata(ModelNormal): @@ -50,7 +52,23 @@ class MetricMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Metric description.. [optional] # noqa: E501 + integration (str): Name of the integration that sent the metric if applicable.. [optional] # noqa: E501 + per_unit (str): Per unit of the metric such as `second` in `bytes per second`.. [optional] # noqa: E501 + short_name (str): A more human-readable and abbreviated version of the metric name.. [optional] # noqa: E501 + statsd_interval (int): StatsD flush interval of the metric in seconds if applicable.. [optional] # noqa: E501 + type (str): Metric type such as `gauge` or `rate`.. [optional] # noqa: E501 + unit (str): Primary unit of the metric such as `byte` or `operation`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metric_search_response.py b/src/datadog_api_client/v1/model/metric_search_response.py index 2f86228e5e..f05b5a4345 100644 --- a/src/datadog_api_client/v1/model/metric_search_response.py +++ b/src/datadog_api_client/v1/model/metric_search_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricSearchResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricSearchResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + results (MetricSearchResponseResults): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metric_search_response_results.py b/src/datadog_api_client/v1/model/metric_search_response_results.py index 73789edd64..d927ee28a7 100644 --- a/src/datadog_api_client/v1/model/metric_search_response_results.py +++ b/src/datadog_api_client/v1/model/metric_search_response_results.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MetricSearchResponseResults(ModelNormal): @@ -50,7 +52,23 @@ class MetricSearchResponseResults(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricSearchResponseResults - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + metrics ([str]): List of metrics that match the search query.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metrics_list_response.py b/src/datadog_api_client/v1/model/metrics_list_response.py index d250c58327..69ea538007 100644 --- a/src/datadog_api_client/v1/model/metrics_list_response.py +++ b/src/datadog_api_client/v1/model/metrics_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MetricsListResponse(ModelNormal): @@ -50,7 +52,23 @@ class MetricsListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricsListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _from (str): Time when the metrics were active, seconds since the Unix epoch.. [optional] # noqa: E501 + metrics ([str]): List of metric names.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metrics_payload.py b/src/datadog_api_client/v1/model/metrics_payload.py index 9c91097c17..76df6090eb 100644 --- a/src/datadog_api_client/v1/model/metrics_payload.py +++ b/src/datadog_api_client/v1/model/metrics_payload.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricsPayload(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, series, *args, **kwargs): # noqa: E501 + """MetricsPayload - a model defined in OpenAPI + + Args: + series ([Series]): A list of time series to submit to Datadog. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.series = series + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, series, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metrics_query_metadata.py b/src/datadog_api_client/v1/model/metrics_query_metadata.py index 90c2fdb20e..aaf86e3eab 100644 --- a/src/datadog_api_client/v1/model/metrics_query_metadata.py +++ b/src/datadog_api_client/v1/model/metrics_query_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -63,7 +65,24 @@ class MetricsQueryMetadata(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -116,6 +135,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricsQueryMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggr (str): Aggregation type.. [optional] # noqa: E501 + display_name (str): Display name of the metric.. [optional] # noqa: E501 + end (int): End of the time window, milliseconds since Unix epoch.. [optional] # noqa: E501 + expression (str): Metric expression.. [optional] # noqa: E501 + interval (int): Number of seconds between data samples.. [optional] # noqa: E501 + length (int): Number of data samples.. [optional] # noqa: E501 + metric (str): Metric name.. [optional] # noqa: E501 + pointlist ([Point]): List of points of the time series.. [optional] # noqa: E501 + query_index (int): The index of the series' query within the request.. [optional] # noqa: E501 + scope (str): Metric scope, comma separated list of tags.. [optional] # noqa: E501 + start (int): Start of the time window, milliseconds since Unix epoch.. [optional] # noqa: E501 + tag_set ([str]): Unique tags identifying this series.. [optional] # noqa: E501 + unit ([MetricsQueryUnit]): Detailed information about the metric unit. First element describes the \"primary unit\" (for example, `bytes` in `bytes per second`), second describes the \"per unit\" (for example, `second` in `bytes per second`).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -211,3 +319,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metrics_query_response.py b/src/datadog_api_client/v1/model/metrics_query_response.py index 882a83098a..2d9dc2d44f 100644 --- a/src/datadog_api_client/v1/model/metrics_query_response.py +++ b/src/datadog_api_client/v1/model/metrics_query_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricsQueryResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricsQueryResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error (str): Message indicating the errors if status is not `ok`.. [optional] # noqa: E501 + from_date (int): Start of requested time window, milliseconds since Unix epoch.. [optional] # noqa: E501 + group_by ([str]): List of tag keys on which to group.. [optional] # noqa: E501 + message (str): Message indicating `success` if status is `ok`.. [optional] # noqa: E501 + query (str): Query string. [optional] # noqa: E501 + res_type (str): Type of response.. [optional] # noqa: E501 + series ([MetricsQueryMetadata]): List of timeseries queried.. [optional] # noqa: E501 + status (str): Status of the query.. [optional] # noqa: E501 + to_date (int): End of requested time window, milliseconds since Unix epoch.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +296,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/metrics_query_unit.py b/src/datadog_api_client/v1/model/metrics_query_unit.py index eca77f9f32..2f6dea1e75 100644 --- a/src/datadog_api_client/v1/model/metrics_query_unit.py +++ b/src/datadog_api_client/v1/model/metrics_query_unit.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MetricsQueryUnit(ModelNormal): @@ -50,7 +52,23 @@ class MetricsQueryUnit(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = True @@ -86,6 +104,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricsQueryUnit - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + family (str): Unit family, allows for conversion between units of the same family, for scaling.. [optional] # noqa: E501 + name (str): Unit name. [optional] # noqa: E501 + plural (str): Plural form of the unit name.. [optional] # noqa: E501 + scale_factor (float): Factor for scaling between units of the same family.. [optional] # noqa: E501 + short_name (str): Abbreviation of the unit.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor.py b/src/datadog_api_client/v1/model/monitor.py index 439184ceb8..53aa75d451 100644 --- a/src/datadog_api_client/v1/model/monitor.py +++ b/src/datadog_api_client/v1/model/monitor.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -69,7 +71,24 @@ class Monitor(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -131,6 +150,102 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, type, *args, **kwargs): # noqa: E501 + """Monitor - a model defined in OpenAPI + + Args: + query (str): The monitor query. + type (MonitorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (datetime): Timestamp of the monitor creation.. [optional] # noqa: E501 + creator (Creator): [optional] # noqa: E501 + deleted (datetime, none_type): Whether or not the monitor is deleted. (Always `null`). [optional] # noqa: E501 + id (int): ID of this monitor.. [optional] # noqa: E501 + message (str): A message to include with notifications for this monitor.. [optional] # noqa: E501 + modified (datetime): Last timestamp when the monitor was edited.. [optional] # noqa: E501 + multi (bool): Whether or not the monitor is broken down on different groups.. [optional] # noqa: E501 + name (str): The monitor name.. [optional] # noqa: E501 + options (MonitorOptions): [optional] # noqa: E501 + overall_state (MonitorOverallStates): [optional] # noqa: E501 + priority (int): Integer from 1 (high) to 5 (low) indicating alert severity.. [optional] # noqa: E501 + restricted_roles ([str]): A list of role identifiers that can be pulled from the Roles API. Cannot be used with `locked` option.. [optional] # noqa: E501 + state (MonitorState): [optional] # noqa: E501 + tags ([str]): Tags associated to your monitor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -233,3 +348,8 @@ def __init__(self, query, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_device_id.py b/src/datadog_api_client/v1/model/monitor_device_id.py index 2cbba7c2b8..aa8e44ffac 100644 --- a/src/datadog_api_client/v1/model/monitor_device_id.py +++ b/src/datadog_api_client/v1/model/monitor_device_id.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorDeviceID(ModelSimple): @@ -58,7 +60,23 @@ class MonitorDeviceID(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -185,3 +205,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MonitorDeviceID - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): ID of the device the Synthetics monitor is running on. Same as `SyntheticsDeviceID`.., must be one of ["laptop_large", "tablet", "mobile_small", "chrome.laptop_large", "chrome.tablet", "chrome.mobile_small", "firefox.laptop_large", "firefox.tablet", "firefox.mobile_small", ] # noqa: E501 + + Keyword Args: + value (str): ID of the device the Synthetics monitor is running on. Same as `SyntheticsDeviceID`.., must be one of ["laptop_large", "tablet", "mobile_small", "chrome.laptop_large", "chrome.tablet", "chrome.mobile_small", "firefox.laptop_large", "firefox.tablet", "firefox.mobile_small", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/monitor_group_search_response.py b/src/datadog_api_client/v1/model/monitor_group_search_response.py index d8b9a86442..a4ab90eef9 100644 --- a/src/datadog_api_client/v1/model/monitor_group_search_response.py +++ b/src/datadog_api_client/v1/model/monitor_group_search_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class MonitorGroupSearchResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorGroupSearchResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + counts (MonitorGroupSearchResponseCounts): [optional] # noqa: E501 + groups ([MonitorGroupSearchResult]): The list of found monitor groups.. [optional] # noqa: E501 + metadata (MonitorSearchResponseMetadata): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_group_search_response_counts.py b/src/datadog_api_client/v1/model/monitor_group_search_response_counts.py index f5cc8faae2..2eac79deb5 100644 --- a/src/datadog_api_client/v1/model/monitor_group_search_response_counts.py +++ b/src/datadog_api_client/v1/model/monitor_group_search_response_counts.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MonitorGroupSearchResponseCounts(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorGroupSearchResponseCounts - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (MonitorSearchCount): [optional] # noqa: E501 + type (MonitorSearchCount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_group_search_result.py b/src/datadog_api_client/v1/model/monitor_group_search_result.py index 0de79da17f..bedd73ea3f 100644 --- a/src/datadog_api_client/v1/model/monitor_group_search_result.py +++ b/src/datadog_api_client/v1/model/monitor_group_search_result.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MonitorGroupSearchResult(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -100,6 +119,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorGroupSearchResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + group (str): The name of the group.. [optional] # noqa: E501 + group_tags ([str]): The list of tags of the monitor group.. [optional] # noqa: E501 + last_nodata_ts (int): Latest timestamp the monitor group was in NO_DATA state.. [optional] # noqa: E501 + last_triggered_ts (int, none_type): Latest timestamp the monitor group triggered.. [optional] # noqa: E501 + monitor_id (int): The ID of the monitor.. [optional] # noqa: E501 + monitor_name (str): The name of the monitor.. [optional] # noqa: E501 + status (MonitorOverallStates): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +291,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_options.py b/src/datadog_api_client/v1/model/monitor_options.py index d3ba41c687..a110713677 100644 --- a/src/datadog_api_client/v1/model/monitor_options.py +++ b/src/datadog_api_client/v1/model/monitor_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -67,7 +69,24 @@ class MonitorOptions(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -160,6 +179,103 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregation (MonitorOptionsAggregation): [optional] # noqa: E501 + device_ids ([MonitorDeviceID]): IDs of the device the Synthetics monitor is running on.. [optional] # noqa: E501 + enable_logs_sample (bool): Whether or not to send a log sample when the log monitor triggers.. [optional] # noqa: E501 + escalation_message (str): We recommend using the [is_renotify](https://docs.datadoghq.com/monitors/notifications/?tab=is_alert#renotify), block in the original message instead. A message to include with a re-notification. Supports the `@username` notification we allow elsewhere. Not applicable if `renotify_interval` is `None`.. [optional] if omitted the server will use the default value of "none" # noqa: E501 + evaluation_delay (int, none_type): Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to `300` (5min), the timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation.. [optional] # noqa: E501 + groupby_simple_monitor (bool): Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold.. [optional] # noqa: E501 + include_tags (bool): A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title. **Examples** - If `True`, `[Triggered on {host:h1}] Monitor Title` - If `False`, `[Triggered] Monitor Title`. [optional] if omitted the server will use the default value of True # noqa: E501 + locked (bool): Whether or not the monitor is locked (only editable by creator and admins).. [optional] # noqa: E501 + min_failure_duration (int, none_type): How long the test should be in failure before alerting (integer, number of seconds, max 7200).. [optional] if omitted the server will use the default value of 0 # noqa: E501 + min_location_failed (int, none_type): The minimum number of locations in failure at the same time during at least one moment in the `min_failure_duration` period (`min_location_failed` and `min_failure_duration` are part of the advanced alerting rules - integer, >= 1).. [optional] if omitted the server will use the default value of 1 # noqa: E501 + new_host_delay (int, none_type): Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non negative integer.. [optional] if omitted the server will use the default value of 300 # noqa: E501 + no_data_timeframe (int, none_type): The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for metric alerts, and 24 hours is used for service checks.. [optional] # noqa: E501 + notify_audit (bool): A Boolean indicating whether tagged users is notified on changes to this monitor.. [optional] if omitted the server will use the default value of False # noqa: E501 + notify_no_data (bool): A Boolean indicating whether this monitor notifies when data stops reporting.. [optional] if omitted the server will use the default value of False # noqa: E501 + renotify_interval (int, none_type): The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it’s not resolved.. [optional] # noqa: E501 + require_full_window (bool): A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. We highly recommend you set this to `false` for sparse metrics, otherwise some evaluations are skipped. Default is false.. [optional] # noqa: E501 + silenced ({str: (int, none_type)}): Information about the downtime applied to the monitor.. [optional] # noqa: E501 + synthetics_check_id (str, none_type): ID of the corresponding Synthetic check.. [optional] # noqa: E501 + threshold_windows (MonitorThresholdWindowOptions): [optional] # noqa: E501 + thresholds (MonitorThresholds): [optional] # noqa: E501 + timeout_h (int, none_type): The number of hours of the monitor not reporting data before it automatically resolves from a triggered state.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -263,3 +379,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_options_aggregation.py b/src/datadog_api_client/v1/model/monitor_options_aggregation.py index bb0cb09e38..5a6fee7887 100644 --- a/src/datadog_api_client/v1/model/monitor_options_aggregation.py +++ b/src/datadog_api_client/v1/model/monitor_options_aggregation.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorOptionsAggregation(ModelNormal): @@ -50,7 +52,23 @@ class MonitorOptionsAggregation(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorOptionsAggregation - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + group_by (str): Group to break down the monitor on.. [optional] # noqa: E501 + metric (str): Metric name used in the monitor.. [optional] # noqa: E501 + type (str): Metric type used in the monitor.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_overall_states.py b/src/datadog_api_client/v1/model/monitor_overall_states.py index ba8f7b56a7..1c60e586c1 100644 --- a/src/datadog_api_client/v1/model/monitor_overall_states.py +++ b/src/datadog_api_client/v1/model/monitor_overall_states.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorOverallStates(ModelSimple): @@ -56,7 +58,23 @@ class MonitorOverallStates(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MonitorOverallStates - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The different states your monitor can be in.., must be one of ["Alert", "Ignored", "No Data", "OK", "Skipped", "Unknown", "Warn", ] # noqa: E501 + + Keyword Args: + value (str): The different states your monitor can be in.., must be one of ["Alert", "Ignored", "No Data", "OK", "Skipped", "Unknown", "Warn", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/monitor_search_count.py b/src/datadog_api_client/v1/model/monitor_search_count.py index e0f5030733..4a97c40dda 100644 --- a/src/datadog_api_client/v1/model/monitor_search_count.py +++ b/src/datadog_api_client/v1/model/monitor_search_count.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorSearchCount(ModelSimple): @@ -46,7 +48,23 @@ class MonitorSearchCount(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -70,6 +88,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -156,9 +176,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MonitorSearchCount - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): Search facets.. # noqa: E501 + + Keyword Args: + value ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]): Search facets.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -184,3 +287,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/monitor_search_response.py b/src/datadog_api_client/v1/model/monitor_search_response.py index c2abbeec9b..ea81f0be5d 100644 --- a/src/datadog_api_client/v1/model/monitor_search_response.py +++ b/src/datadog_api_client/v1/model/monitor_search_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class MonitorSearchResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorSearchResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + counts (MonitorSearchResponseCounts): [optional] # noqa: E501 + metadata (MonitorSearchResponseMetadata): [optional] # noqa: E501 + monitors ([MonitorSearchResult]): The list of found monitors.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_search_response_counts.py b/src/datadog_api_client/v1/model/monitor_search_response_counts.py index 6f737e5fce..1f922629c4 100644 --- a/src/datadog_api_client/v1/model/monitor_search_response_counts.py +++ b/src/datadog_api_client/v1/model/monitor_search_response_counts.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MonitorSearchResponseCounts(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorSearchResponseCounts - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + muted (MonitorSearchCount): [optional] # noqa: E501 + status (MonitorSearchCount): [optional] # noqa: E501 + tag (MonitorSearchCount): [optional] # noqa: E501 + type (MonitorSearchCount): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_search_response_metadata.py b/src/datadog_api_client/v1/model/monitor_search_response_metadata.py index ce359be22c..21c3107304 100644 --- a/src/datadog_api_client/v1/model/monitor_search_response_metadata.py +++ b/src/datadog_api_client/v1/model/monitor_search_response_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorSearchResponseMetadata(ModelNormal): @@ -50,7 +52,23 @@ class MonitorSearchResponseMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorSearchResponseMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (int): The page to start paginating from.. [optional] # noqa: E501 + page_count (int): The number of pages.. [optional] # noqa: E501 + per_page (int): The number of monitors to return per page.. [optional] # noqa: E501 + total_count (int): The total number of monitors.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_search_result.py b/src/datadog_api_client/v1/model/monitor_search_result.py index e8620501ca..27d0591e52 100644 --- a/src/datadog_api_client/v1/model/monitor_search_result.py +++ b/src/datadog_api_client/v1/model/monitor_search_result.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class MonitorSearchResult(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -116,6 +135,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorSearchResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + classification (str): Classification of the monitor.. [optional] # noqa: E501 + creator (Creator): [optional] # noqa: E501 + id (int): ID of the monitor.. [optional] # noqa: E501 + last_triggered_ts (int, none_type): Latest timestamp the monitor triggered.. [optional] # noqa: E501 + metrics ([str]): Metrics used by the monitor.. [optional] # noqa: E501 + name (str): The monitor name.. [optional] # noqa: E501 + notifications ([MonitorSearchResultNotification]): The notification triggered by the monitor.. [optional] # noqa: E501 + org_id (int): The ID of the organization.. [optional] # noqa: E501 + scopes ([str]): The scope(s) to which the downtime applies, e.g. `host:app2`. Provide multiple scopes as a comma-separated list, e.g. `env:dev,env:prod`. The resulting downtime applies to sources that matches ALL provided scopes (i.e. `env:dev AND env:prod`), NOT any of them.. [optional] # noqa: E501 + status (MonitorOverallStates): [optional] # noqa: E501 + tags ([str]): Tags associated with the monitor.. [optional] # noqa: E501 + type (MonitorType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -210,3 +317,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_search_result_notification.py b/src/datadog_api_client/v1/model/monitor_search_result_notification.py index 9078541a62..58f58ec5d8 100644 --- a/src/datadog_api_client/v1/model/monitor_search_result_notification.py +++ b/src/datadog_api_client/v1/model/monitor_search_result_notification.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorSearchResultNotification(ModelNormal): @@ -50,7 +52,23 @@ class MonitorSearchResultNotification(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorSearchResultNotification - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + handle (str): The email address that received the notification.. [optional] # noqa: E501 + name (str): The username receiving the notification. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_state.py b/src/datadog_api_client/v1/model/monitor_state.py index d09ad6c1ee..0fbed563d3 100644 --- a/src/datadog_api_client/v1/model/monitor_state.py +++ b/src/datadog_api_client/v1/model/monitor_state.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MonitorState(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorState - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + groups ({str: (MonitorStateGroup,)}): Dictionary where the keys are groups (comma separated lists of tags) and the values are the list of groups your monitor is broken down on.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_state_group.py b/src/datadog_api_client/v1/model/monitor_state_group.py index b55943bf1e..dbadcb1d78 100644 --- a/src/datadog_api_client/v1/model/monitor_state_group.py +++ b/src/datadog_api_client/v1/model/monitor_state_group.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MonitorStateGroup(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorStateGroup - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + last_nodata_ts (int): Latest timestamp the monitor was in NO_DATA state.. [optional] # noqa: E501 + last_notified_ts (int): Latest timestamp of the notification sent for this monitor group.. [optional] # noqa: E501 + last_resolved_ts (int): Latest timestamp the monitor group was resolved.. [optional] # noqa: E501 + last_triggered_ts (int): Latest timestamp the monitor group triggered.. [optional] # noqa: E501 + name (str): The name of the monitor.. [optional] # noqa: E501 + status (MonitorOverallStates): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_summary_widget_definition.py b/src/datadog_api_client/v1/model/monitor_summary_widget_definition.py index 3dbc946774..6bb293fd28 100644 --- a/src/datadog_api_client/v1/model/monitor_summary_widget_definition.py +++ b/src/datadog_api_client/v1/model/monitor_summary_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class MonitorSummaryWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -119,6 +138,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, type, *args, **kwargs): # noqa: E501 + """MonitorSummaryWidgetDefinition - a model defined in OpenAPI + + Args: + query (str): Query to filter the monitors with. + type (MonitorSummaryWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color_preference (WidgetColorPreference): [optional] # noqa: E501 + count (int): The number of monitors to display.. [optional] # noqa: E501 + display_format (WidgetMonitorSummaryDisplayFormat): [optional] # noqa: E501 + hide_zero_counts (bool): Whether to show counts of 0 or not.. [optional] # noqa: E501 + show_last_triggered (bool): Whether to show the time that has elapsed since the monitor/group triggered.. [optional] # noqa: E501 + sort (WidgetMonitorSummarySort): [optional] # noqa: E501 + start (int): The start of the list. Typically 0.. [optional] # noqa: E501 + summary_type (WidgetSummaryType): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -218,3 +330,8 @@ def __init__(self, query, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_summary_widget_definition_type.py b/src/datadog_api_client/v1/model/monitor_summary_widget_definition_type.py index b35e17f940..2042e73070 100644 --- a/src/datadog_api_client/v1/model/monitor_summary_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/monitor_summary_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorSummaryWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class MonitorSummaryWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MonitorSummaryWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the monitor summary widget.. if omitted defaults to "manage_status", must be one of ["manage_status", ] # noqa: E501 + + Keyword Args: + value (str): Type of the monitor summary widget.. if omitted defaults to "manage_status", must be one of ["manage_status", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "manage_status" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/monitor_threshold_window_options.py b/src/datadog_api_client/v1/model/monitor_threshold_window_options.py index 02e3dd15f4..711c53015e 100644 --- a/src/datadog_api_client/v1/model/monitor_threshold_window_options.py +++ b/src/datadog_api_client/v1/model/monitor_threshold_window_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorThresholdWindowOptions(ModelNormal): @@ -50,7 +52,23 @@ class MonitorThresholdWindowOptions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorThresholdWindowOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + recovery_window (str, none_type): Describes how long an anomalous metric must be normal before the alert recovers.. [optional] # noqa: E501 + trigger_window (str, none_type): Describes how long a metric must be anomalous before an alert triggers.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +266,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_thresholds.py b/src/datadog_api_client/v1/model/monitor_thresholds.py index b938ae3190..9fc2774455 100644 --- a/src/datadog_api_client/v1/model/monitor_thresholds.py +++ b/src/datadog_api_client/v1/model/monitor_thresholds.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorThresholds(ModelNormal): @@ -50,7 +52,23 @@ class MonitorThresholds(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +121,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorThresholds - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + critical (float): The monitor `CRITICAL` threshold.. [optional] # noqa: E501 + critical_recovery (float, none_type): The monitor `CRITICAL` recovery threshold.. [optional] # noqa: E501 + ok (float, none_type): The monitor `OK` threshold.. [optional] # noqa: E501 + unknown (float, none_type): The monitor UNKNOWN threshold.. [optional] # noqa: E501 + warning (float, none_type): The monitor `WARNING` threshold.. [optional] # noqa: E501 + warning_recovery (float, none_type): The monitor `WARNING` recovery threshold.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -191,3 +291,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/monitor_type.py b/src/datadog_api_client/v1/model/monitor_type.py index 9b44896de8..1a6f1fe2bd 100644 --- a/src/datadog_api_client/v1/model/monitor_type.py +++ b/src/datadog_api_client/v1/model/monitor_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class MonitorType(ModelSimple): @@ -61,7 +63,23 @@ class MonitorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +103,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -188,3 +208,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MonitorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs.., must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", ] # noqa: E501 + + Keyword Args: + value (str): The type of the monitor. For more information about `type`, see the [monitor options](https://docs.datadoghq.com/monitors/guide/monitor_api_options/) docs.., must be one of ["composite", "event alert", "log alert", "metric alert", "process alert", "query alert", "rum alert", "service check", "synthetics alert", "trace-analytics alert", "slo alert", "event-v2 alert", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/monitor_update_request.py b/src/datadog_api_client/v1/model/monitor_update_request.py index 5929d314a2..5f6a8f87a1 100644 --- a/src/datadog_api_client/v1/model/monitor_update_request.py +++ b/src/datadog_api_client/v1/model/monitor_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -69,7 +71,24 @@ class MonitorUpdateRequest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -131,6 +150,98 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MonitorUpdateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (datetime): Timestamp of the monitor creation.. [optional] # noqa: E501 + creator (Creator): [optional] # noqa: E501 + deleted (datetime, none_type): Whether or not the monitor is deleted. (Always `null`). [optional] # noqa: E501 + id (int): ID of this monitor.. [optional] # noqa: E501 + message (str): A message to include with notifications for this monitor.. [optional] # noqa: E501 + modified (datetime): Last timestamp when the monitor was edited.. [optional] # noqa: E501 + multi (bool): Whether or not the monitor is broken down on different groups.. [optional] # noqa: E501 + name (str): The monitor name.. [optional] # noqa: E501 + options (MonitorOptions): [optional] # noqa: E501 + overall_state (MonitorOverallStates): [optional] # noqa: E501 + priority (int): Integer from 1 (high) to 5 (low) indicating alert severity.. [optional] # noqa: E501 + query (str): The monitor query.. [optional] # noqa: E501 + restricted_roles ([str]): A list of role identifiers that can be pulled from the Roles API. Cannot be used with `locked` option.. [optional] # noqa: E501 + state (MonitorState): [optional] # noqa: E501 + tags ([str]): Tags associated to your monitor.. [optional] # noqa: E501 + type (MonitorType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -229,3 +340,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/note_widget_definition.py b/src/datadog_api_client/v1/model/note_widget_definition.py index 2556836c09..67fa42bbbd 100644 --- a/src/datadog_api_client/v1/model/note_widget_definition.py +++ b/src/datadog_api_client/v1/model/note_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class NoteWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, content, type, *args, **kwargs): # noqa: E501 + """NoteWidgetDefinition - a model defined in OpenAPI + + Args: + content (str): Content of the note. + type (NoteWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + background_color (str): Background color of the note.. [optional] # noqa: E501 + font_size (str): Size of the text.. [optional] # noqa: E501 + has_padding (bool): Whether to add padding or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + show_tick (bool): Whether to show a tick or not.. [optional] # noqa: E501 + text_align (WidgetTextAlign): [optional] # noqa: E501 + tick_edge (WidgetTickEdge): [optional] # noqa: E501 + tick_pos (str): Where to position the tick on an edge.. [optional] # noqa: E501 + vertical_align (WidgetVerticalAlign): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.content = content + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -205,3 +314,8 @@ def __init__(self, content, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/note_widget_definition_type.py b/src/datadog_api_client/v1/model/note_widget_definition_type.py index 52a7281754..129dbcd53b 100644 --- a/src/datadog_api_client/v1/model/note_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/note_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NoteWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class NoteWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NoteWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the note widget.. if omitted defaults to "note", must be one of ["note", ] # noqa: E501 + + Keyword Args: + value (str): Type of the note widget.. if omitted defaults to "note", must be one of ["note", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "note" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/notebook_absolute_time.py b/src/datadog_api_client/v1/model/notebook_absolute_time.py index 3acce2612c..38f5c3008a 100644 --- a/src/datadog_api_client/v1/model/notebook_absolute_time.py +++ b/src/datadog_api_client/v1/model/notebook_absolute_time.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookAbsoluteTime(ModelNormal): @@ -50,7 +52,23 @@ class NotebookAbsoluteTime(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, end, start, *args, **kwargs): # noqa: E501 + """NotebookAbsoluteTime - a model defined in OpenAPI + + Args: + end (datetime): The end time. + start (datetime): The start time. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + live (bool): Indicates whether the timeframe should be shifted to end at the current time.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.end = end + self.start = start + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +272,8 @@ def __init__(self, end, start, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_author.py b/src/datadog_api_client/v1/model/notebook_author.py index a32e846e40..67ee54d988 100644 --- a/src/datadog_api_client/v1/model/notebook_author.py +++ b/src/datadog_api_client/v1/model/notebook_author.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookAuthor(ModelNormal): @@ -50,7 +52,23 @@ class NotebookAuthor(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -94,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookAuthor - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the user.. [optional] # noqa: E501 + disabled (bool): Whether the user is disabled.. [optional] # noqa: E501 + email (str): Email of the user.. [optional] # noqa: E501 + handle (str): Handle of the user.. [optional] # noqa: E501 + icon (str): URL of the user's icon.. [optional] # noqa: E501 + name (str): Name of the user.. [optional] # noqa: E501 + status (str): Status of the user.. [optional] # noqa: E501 + title (str): Title of the user.. [optional] # noqa: E501 + verified (bool): Whether the user is verified.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +288,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_cell_create_request.py b/src/datadog_api_client/v1/model/notebook_cell_create_request.py index 9639649511..9bc50bcc69 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_create_request.py +++ b/src/datadog_api_client/v1/model/notebook_cell_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebookCellCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """NotebookCellCreateRequest - a model defined in OpenAPI + + Args: + attributes (NotebookCellCreateRequestAttributes): + type (NotebookCellResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_cell_create_request_attributes.py b/src/datadog_api_client/v1/model/notebook_cell_create_request_attributes.py index b949a1521b..16e1d74cba 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_create_request_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_cell_create_request_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -113,6 +115,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookCellCreateRequestAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + definition (LogStreamWidgetDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -199,28 +295,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/notebook_cell_resource_type.py b/src/datadog_api_client/v1/model/notebook_cell_resource_type.py index d4bbc9334b..90db98e7ac 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_resource_type.py +++ b/src/datadog_api_client/v1/model/notebook_cell_resource_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookCellResourceType(ModelSimple): @@ -50,7 +52,23 @@ class NotebookCellResourceType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NotebookCellResourceType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Notebook Cell resource.. if omitted defaults to "notebook_cells", must be one of ["notebook_cells", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Notebook Cell resource.. if omitted defaults to "notebook_cells", must be one of ["notebook_cells", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "notebook_cells" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/notebook_cell_response.py b/src/datadog_api_client/v1/model/notebook_cell_response.py index 9870b7e9e1..39cd750cea 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_response.py +++ b/src/datadog_api_client/v1/model/notebook_cell_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebookCellResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """NotebookCellResponse - a model defined in OpenAPI + + Args: + attributes (NotebookCellResponseAttributes): + id (str): Notebook cell ID. + type (NotebookCellResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_cell_response_attributes.py b/src/datadog_api_client/v1/model/notebook_cell_response_attributes.py index 1a4bb178a7..1d5b78d0cc 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_response_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_cell_response_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -113,6 +115,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookCellResponseAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + definition (LogStreamWidgetDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -199,28 +295,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/notebook_cell_time.py b/src/datadog_api_client/v1/model/notebook_cell_time.py index b363752373..023769195e 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_time.py +++ b/src/datadog_api_client/v1/model/notebook_cell_time.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -99,6 +101,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookCellTime - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + live (bool): Indicates whether the timeframe should be shifted to end at the current time.. [optional] # noqa: E501 + live_span (WidgetLiveSpan): [optional] # noqa: E501 + end (datetime): The end time.. [optional] # noqa: E501 + start (datetime): The start time.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -185,28 +281,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/notebook_cell_update_request.py b/src/datadog_api_client/v1/model/notebook_cell_update_request.py index ffe8cd4d65..cb4c2d64d8 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_update_request.py +++ b/src/datadog_api_client/v1/model/notebook_cell_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebookCellUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """NotebookCellUpdateRequest - a model defined in OpenAPI + + Args: + attributes (NotebookCellUpdateRequestAttributes): + id (str): Notebook cell ID. + type (NotebookCellResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_cell_update_request_attributes.py b/src/datadog_api_client/v1/model/notebook_cell_update_request_attributes.py index eff5e7694a..569898d8a5 100644 --- a/src/datadog_api_client/v1/model/notebook_cell_update_request_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_cell_update_request_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -113,6 +115,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookCellUpdateRequestAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + definition (LogStreamWidgetDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -199,28 +295,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/notebook_create_data.py b/src/datadog_api_client/v1/model/notebook_create_data.py index 1ba8a7c9e3..49e8a1a786 100644 --- a/src/datadog_api_client/v1/model/notebook_create_data.py +++ b/src/datadog_api_client/v1/model/notebook_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebookCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """NotebookCreateData - a model defined in OpenAPI + + Args: + attributes (NotebookCreateDataAttributes): + type (NotebookResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_create_data_attributes.py b/src/datadog_api_client/v1/model/notebook_create_data_attributes.py index a91e9f2189..6007bf92bc 100644 --- a/src/datadog_api_client/v1/model/notebook_create_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_create_data_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -65,7 +67,24 @@ class NotebookCreateDataAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -100,6 +119,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cells, name, time, *args, **kwargs): # noqa: E501 + """NotebookCreateDataAttributes - a model defined in OpenAPI + + Args: + cells ([NotebookCellCreateRequest]): List of cells to display in the notebook. + name (str): The name of the notebook. + time (NotebookGlobalTime): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (NotebookStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cells = cells + self.name = name + self.time = time + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -191,3 +295,8 @@ def __init__(self, cells, name, time, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_create_request.py b/src/datadog_api_client/v1/model/notebook_create_request.py index bf9453d109..dd52b53152 100644 --- a/src/datadog_api_client/v1/model/notebook_create_request.py +++ b/src/datadog_api_client/v1/model/notebook_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebookCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """NotebookCreateRequest - a model defined in OpenAPI + + Args: + data (NotebookCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_distribution_cell_attributes.py b/src/datadog_api_client/v1/model/notebook_distribution_cell_attributes.py index b622b3790c..939a9a8279 100644 --- a/src/datadog_api_client/v1/model/notebook_distribution_cell_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_distribution_cell_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class NotebookDistributionCellAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """NotebookDistributionCellAttributes - a model defined in OpenAPI + + Args: + definition (DistributionWidgetDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +288,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_global_time.py b/src/datadog_api_client/v1/model/notebook_global_time.py index 3ef493b7d5..facbd98663 100644 --- a/src/datadog_api_client/v1/model/notebook_global_time.py +++ b/src/datadog_api_client/v1/model/notebook_global_time.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -99,6 +101,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookGlobalTime - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + live (bool): Indicates whether the timeframe should be shifted to end at the current time.. [optional] # noqa: E501 + live_span (WidgetLiveSpan): [optional] # noqa: E501 + end (datetime): The end time.. [optional] # noqa: E501 + start (datetime): The start time.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -185,28 +281,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/notebook_graph_size.py b/src/datadog_api_client/v1/model/notebook_graph_size.py index 8c0c8343de..170a3d64d4 100644 --- a/src/datadog_api_client/v1/model/notebook_graph_size.py +++ b/src/datadog_api_client/v1/model/notebook_graph_size.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookGraphSize(ModelSimple): @@ -54,7 +56,23 @@ class NotebookGraphSize(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NotebookGraphSize - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The size of the graph.., must be one of ["xs", "s", "m", "l", "xl", ] # noqa: E501 + + Keyword Args: + value (str): The size of the graph.., must be one of ["xs", "s", "m", "l", "xl", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/notebook_heat_map_cell_attributes.py b/src/datadog_api_client/v1/model/notebook_heat_map_cell_attributes.py index 127796ca24..ac48d3b58f 100644 --- a/src/datadog_api_client/v1/model/notebook_heat_map_cell_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_heat_map_cell_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class NotebookHeatMapCellAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """NotebookHeatMapCellAttributes - a model defined in OpenAPI + + Args: + definition (HeatMapWidgetDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +288,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_log_stream_cell_attributes.py b/src/datadog_api_client/v1/model/notebook_log_stream_cell_attributes.py index c26a76dff4..4f061dca46 100644 --- a/src/datadog_api_client/v1/model/notebook_log_stream_cell_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_log_stream_cell_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class NotebookLogStreamCellAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """NotebookLogStreamCellAttributes - a model defined in OpenAPI + + Args: + definition (LogStreamWidgetDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_markdown_cell_attributes.py b/src/datadog_api_client/v1/model/notebook_markdown_cell_attributes.py index c852c260e6..11d3d370dc 100644 --- a/src/datadog_api_client/v1/model/notebook_markdown_cell_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_markdown_cell_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebookMarkdownCellAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """NotebookMarkdownCellAttributes - a model defined in OpenAPI + + Args: + definition (NotebookMarkdownCellDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_markdown_cell_definition.py b/src/datadog_api_client/v1/model/notebook_markdown_cell_definition.py index c128883714..3b27cd36c2 100644 --- a/src/datadog_api_client/v1/model/notebook_markdown_cell_definition.py +++ b/src/datadog_api_client/v1/model/notebook_markdown_cell_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebookMarkdownCellDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, text, type, *args, **kwargs): # noqa: E501 + """NotebookMarkdownCellDefinition - a model defined in OpenAPI + + Args: + text (str): The markdown content. + type (NotebookMarkdownCellDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.text = text + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, text, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_markdown_cell_definition_type.py b/src/datadog_api_client/v1/model/notebook_markdown_cell_definition_type.py index 128400d7a7..61fd6fbece 100644 --- a/src/datadog_api_client/v1/model/notebook_markdown_cell_definition_type.py +++ b/src/datadog_api_client/v1/model/notebook_markdown_cell_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookMarkdownCellDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class NotebookMarkdownCellDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NotebookMarkdownCellDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the markdown cell.. if omitted defaults to "markdown", must be one of ["markdown", ] # noqa: E501 + + Keyword Args: + value (str): Type of the markdown cell.. if omitted defaults to "markdown", must be one of ["markdown", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "markdown" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/notebook_relative_time.py b/src/datadog_api_client/v1/model/notebook_relative_time.py index ab9af7d601..ae431abd47 100644 --- a/src/datadog_api_client/v1/model/notebook_relative_time.py +++ b/src/datadog_api_client/v1/model/notebook_relative_time.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebookRelativeTime(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, live_span, *args, **kwargs): # noqa: E501 + """NotebookRelativeTime - a model defined in OpenAPI + + Args: + live_span (WidgetLiveSpan): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.live_span = live_span + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, live_span, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_resource_type.py b/src/datadog_api_client/v1/model/notebook_resource_type.py index 54121119fe..853686207a 100644 --- a/src/datadog_api_client/v1/model/notebook_resource_type.py +++ b/src/datadog_api_client/v1/model/notebook_resource_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookResourceType(ModelSimple): @@ -50,7 +52,23 @@ class NotebookResourceType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NotebookResourceType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Notebook resource.. if omitted defaults to "notebooks", must be one of ["notebooks", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Notebook resource.. if omitted defaults to "notebooks", must be one of ["notebooks", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "notebooks" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/notebook_response.py b/src/datadog_api_client/v1/model/notebook_response.py index d21adfeb15..c7ef217b94 100644 --- a/src/datadog_api_client/v1/model/notebook_response.py +++ b/src/datadog_api_client/v1/model/notebook_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebookResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (NotebookResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_response_data.py b/src/datadog_api_client/v1/model/notebook_response_data.py index 5fc029537e..f00807887a 100644 --- a/src/datadog_api_client/v1/model/notebook_response_data.py +++ b/src/datadog_api_client/v1/model/notebook_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebookResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """NotebookResponseData - a model defined in OpenAPI + + Args: + attributes (NotebookResponseDataAttributes): + id (int): Unique notebook ID, assigned when you create the notebook. + type (NotebookResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -103,12 +206,11 @@ def discriminator(): ) @convert_js_args_to_python_args - def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 + def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 """NotebookResponseData - a model defined in OpenAPI Args: attributes (NotebookResponseDataAttributes): - id (int): Unique notebook ID, assigned when you create the notebook. type (NotebookResourceType): Keyword Args: @@ -169,7 +271,6 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.attributes = attributes - self.id = id self.type = type for var_name, var_value in kwargs.items(): if ( @@ -181,3 +282,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_response_data_attributes.py b/src/datadog_api_client/v1/model/notebook_response_data_attributes.py index 0998c04462..8e4955c2d7 100644 --- a/src/datadog_api_client/v1/model/notebook_response_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_response_data_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -67,7 +69,24 @@ class NotebookResponseDataAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -108,6 +127,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cells, name, time, *args, **kwargs): # noqa: E501 + """NotebookResponseDataAttributes - a model defined in OpenAPI + + Args: + cells ([NotebookCellResponse]): List of cells to display in the notebook. + name (str): The name of the notebook. + time (NotebookGlobalTime): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + author (NotebookAuthor): [optional] # noqa: E501 + created (datetime): UTC time stamp for when the notebook was created.. [optional] # noqa: E501 + modified (datetime): UTC time stamp for when the notebook was last modified.. [optional] # noqa: E501 + status (NotebookStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cells = cells + self.name = name + self.time = time + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -202,3 +309,8 @@ def __init__(self, cells, name, time, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_split_by.py b/src/datadog_api_client/v1/model/notebook_split_by.py index 5b9df1e68b..e71ffec47a 100644 --- a/src/datadog_api_client/v1/model/notebook_split_by.py +++ b/src/datadog_api_client/v1/model/notebook_split_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookSplitBy(ModelNormal): @@ -50,7 +52,23 @@ class NotebookSplitBy(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, keys, tags, *args, **kwargs): # noqa: E501 + """NotebookSplitBy - a model defined in OpenAPI + + Args: + keys ([str]): Keys to split on. + tags ([str]): Tags to split on. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.keys = keys + self.tags = tags + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, keys, tags, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_status.py b/src/datadog_api_client/v1/model/notebook_status.py index f434165134..7cc511632e 100644 --- a/src/datadog_api_client/v1/model/notebook_status.py +++ b/src/datadog_api_client/v1/model/notebook_status.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebookStatus(ModelSimple): @@ -50,7 +52,23 @@ class NotebookStatus(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """NotebookStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Publication status of the notebook. For now, always \"published\".. if omitted defaults to "published", must be one of ["published", ] # noqa: E501 + + Keyword Args: + value (str): Publication status of the notebook. For now, always \"published\".. if omitted defaults to "published", must be one of ["published", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "published" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/notebook_timeseries_cell_attributes.py b/src/datadog_api_client/v1/model/notebook_timeseries_cell_attributes.py index ead6ed403e..2fc1ed8a42 100644 --- a/src/datadog_api_client/v1/model/notebook_timeseries_cell_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_timeseries_cell_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class NotebookTimeseriesCellAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """NotebookTimeseriesCellAttributes - a model defined in OpenAPI + + Args: + definition (TimeseriesWidgetDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +288,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_toplist_cell_attributes.py b/src/datadog_api_client/v1/model/notebook_toplist_cell_attributes.py index d63a0717f7..a0e504d6ab 100644 --- a/src/datadog_api_client/v1/model/notebook_toplist_cell_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_toplist_cell_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class NotebookToplistCellAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """NotebookToplistCellAttributes - a model defined in OpenAPI + + Args: + definition (ToplistWidgetDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + graph_size (NotebookGraphSize): [optional] # noqa: E501 + split_by (NotebookSplitBy): [optional] # noqa: E501 + time (NotebookCellTime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +288,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_update_cell.py b/src/datadog_api_client/v1/model/notebook_update_cell.py index 1c2efae827..60ab6193f3 100644 --- a/src/datadog_api_client/v1/model/notebook_update_cell.py +++ b/src/datadog_api_client/v1/model/notebook_update_cell.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,99 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebookUpdateCell - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (NotebookCellUpdateRequestAttributes): [optional] # noqa: E501 + type (NotebookCellResourceType): [optional] # noqa: E501 + id (str): Notebook cell ID.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -186,28 +281,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/notebook_update_data.py b/src/datadog_api_client/v1/model/notebook_update_data.py index 869adf38e1..fdc9c6cee4 100644 --- a/src/datadog_api_client/v1/model/notebook_update_data.py +++ b/src/datadog_api_client/v1/model/notebook_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebookUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """NotebookUpdateData - a model defined in OpenAPI + + Args: + attributes (NotebookUpdateDataAttributes): + type (NotebookResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_update_data_attributes.py b/src/datadog_api_client/v1/model/notebook_update_data_attributes.py index 343ce3578b..db92022562 100644 --- a/src/datadog_api_client/v1/model/notebook_update_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebook_update_data_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -65,7 +67,24 @@ class NotebookUpdateDataAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -100,6 +119,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cells, name, time, *args, **kwargs): # noqa: E501 + """NotebookUpdateDataAttributes - a model defined in OpenAPI + + Args: + cells ([NotebookUpdateCell]): List of cells to display in the notebook. + name (str): The name of the notebook. + time (NotebookGlobalTime): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (NotebookStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cells = cells + self.name = name + self.time = time + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -191,3 +295,8 @@ def __init__(self, cells, name, time, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebook_update_request.py b/src/datadog_api_client/v1/model/notebook_update_request.py index aeb2b5a4db..68f8b4a1b7 100644 --- a/src/datadog_api_client/v1/model/notebook_update_request.py +++ b/src/datadog_api_client/v1/model/notebook_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebookUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """NotebookUpdateRequest - a model defined in OpenAPI + + Args: + data (NotebookUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebooks_response.py b/src/datadog_api_client/v1/model/notebooks_response.py index ddf3ddce96..611d7b97bf 100644 --- a/src/datadog_api_client/v1/model/notebooks_response.py +++ b/src/datadog_api_client/v1/model/notebooks_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebooksResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebooksResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([NotebooksResponseData]): List of notebook definitions.. [optional] # noqa: E501 + meta (NotebooksResponseMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebooks_response_data.py b/src/datadog_api_client/v1/model/notebooks_response_data.py index a35e37f6e3..d319336818 100644 --- a/src/datadog_api_client/v1/model/notebooks_response_data.py +++ b/src/datadog_api_client/v1/model/notebooks_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class NotebooksResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """NotebooksResponseData - a model defined in OpenAPI + + Args: + attributes (NotebooksResponseDataAttributes): + id (int): Unique notebook ID, assigned when you create the notebook. + type (NotebookResourceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -103,12 +206,11 @@ def discriminator(): ) @convert_js_args_to_python_args - def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 + def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 """NotebooksResponseData - a model defined in OpenAPI Args: attributes (NotebooksResponseDataAttributes): - id (int): Unique notebook ID, assigned when you create the notebook. type (NotebookResourceType): Keyword Args: @@ -169,7 +271,6 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) self.attributes = attributes - self.id = id self.type = type for var_name, var_value in kwargs.items(): if ( @@ -181,3 +282,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py b/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py index 2b1b420044..9e609437be 100644 --- a/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py +++ b/src/datadog_api_client/v1/model/notebooks_response_data_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -67,7 +69,24 @@ class NotebooksResponseDataAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -108,6 +127,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """NotebooksResponseDataAttributes - a model defined in OpenAPI + + Args: + name (str): The name of the notebook. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + author (NotebookAuthor): [optional] # noqa: E501 + cells ([NotebookCellResponse]): List of cells to display in the notebook.. [optional] # noqa: E501 + created (datetime): UTC time stamp for when the notebook was created.. [optional] # noqa: E501 + modified (datetime): UTC time stamp for when the notebook was last modified.. [optional] # noqa: E501 + status (NotebookStatus): [optional] # noqa: E501 + time (NotebookGlobalTime): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -200,3 +305,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebooks_response_meta.py b/src/datadog_api_client/v1/model/notebooks_response_meta.py index a0bd659970..2aedad194b 100644 --- a/src/datadog_api_client/v1/model/notebooks_response_meta.py +++ b/src/datadog_api_client/v1/model/notebooks_response_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class NotebooksResponseMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebooksResponseMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (NotebooksResponsePage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/notebooks_response_page.py b/src/datadog_api_client/v1/model/notebooks_response_page.py index 85c2805266..a64d4b2cb7 100644 --- a/src/datadog_api_client/v1/model/notebooks_response_page.py +++ b/src/datadog_api_client/v1/model/notebooks_response_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class NotebooksResponsePage(ModelNormal): @@ -50,7 +52,23 @@ class NotebooksResponsePage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """NotebooksResponsePage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_count (int): The total number of notebooks that would be returned if the request was not filtered by `start` and `count` parameters.. [optional] # noqa: E501 + total_filtered_count (int): The total number of notebooks returned.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization.py b/src/datadog_api_client/v1/model/organization.py index efc084c3b6..d5cb9501a1 100644 --- a/src/datadog_api_client/v1/model/organization.py +++ b/src/datadog_api_client/v1/model/organization.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class Organization(ModelNormal): ("name",): {}, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Organization - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + billing (OrganizationBilling): [optional] # noqa: E501 + created (str): Date of the organization creation.. [optional] # noqa: E501 + description (str): Description of the organization.. [optional] # noqa: E501 + name (str): The name of the new child-organization, limited to 32 characters.. [optional] # noqa: E501 + public_id (str): The `public_id` of the organization you are operating within.. [optional] # noqa: E501 + settings (OrganizationSettings): [optional] # noqa: E501 + subscription (OrganizationSubscription): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +294,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_billing.py b/src/datadog_api_client/v1/model/organization_billing.py index a70c3fc5b5..035c55cd3b 100644 --- a/src/datadog_api_client/v1/model/organization_billing.py +++ b/src/datadog_api_client/v1/model/organization_billing.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class OrganizationBilling(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationBilling(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationBilling - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): The type of billing. Only `parent_billing` is supported.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_create_body.py b/src/datadog_api_client/v1/model/organization_create_body.py index 587ba48bca..b14c0fd31c 100644 --- a/src/datadog_api_client/v1/model/organization_create_body.py +++ b/src/datadog_api_client/v1/model/organization_create_body.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class OrganizationCreateBody(ModelNormal): ("name",): {}, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """OrganizationCreateBody - a model defined in OpenAPI + + Args: + name (str): The name of the new child-organization, limited to 32 characters. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + billing (OrganizationBilling): [optional] # noqa: E501 + subscription (OrganizationSubscription): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_create_response.py b/src/datadog_api_client/v1/model/organization_create_response.py index c30ac5e165..06f1fd7e4d 100644 --- a/src/datadog_api_client/v1/model/organization_create_response.py +++ b/src/datadog_api_client/v1/model/organization_create_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class OrganizationCreateResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationCreateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + api_key (ApiKey): [optional] # noqa: E501 + application_key (ApplicationKey): [optional] # noqa: E501 + org (Organization): [optional] # noqa: E501 + user (User): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_list_response.py b/src/datadog_api_client/v1/model/organization_list_response.py index 40d14aec8d..3fcdf674e5 100644 --- a/src/datadog_api_client/v1/model/organization_list_response.py +++ b/src/datadog_api_client/v1/model/organization_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class OrganizationListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + orgs ([Organization]): Array of organization objects.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_response.py b/src/datadog_api_client/v1/model/organization_response.py index 68f9322040..e17575387c 100644 --- a/src/datadog_api_client/v1/model/organization_response.py +++ b/src/datadog_api_client/v1/model/organization_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class OrganizationResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + org (Organization): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_settings.py b/src/datadog_api_client/v1/model/organization_settings.py index 65c7478935..6ac5ddcd30 100644 --- a/src/datadog_api_client/v1/model/organization_settings.py +++ b/src/datadog_api_client/v1/model/organization_settings.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -68,7 +70,24 @@ class OrganizationSettings(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -115,6 +134,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationSettings - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + private_widget_share (bool): Whether or not the organization users can share widgets outside of Datadog.. [optional] # noqa: E501 + saml (OrganizationSettingsSaml): [optional] # noqa: E501 + saml_autocreate_access_role (AccessRole): [optional] # noqa: E501 + saml_autocreate_users_domains (OrganizationSettingsSamlAutocreateUsersDomains): [optional] # noqa: E501 + saml_can_be_enabled (bool): Whether or not SAML can be enabled for this organization.. [optional] # noqa: E501 + saml_idp_endpoint (str): Identity provider endpoint for SAML authentication.. [optional] # noqa: E501 + saml_idp_initiated_login (OrganizationSettingsSamlIdpInitiatedLogin): [optional] # noqa: E501 + saml_idp_metadata_uploaded (bool): Whether or not a SAML identity provider metadata file was provided to the Datadog organization.. [optional] # noqa: E501 + saml_login_url (str): URL for SAML logging.. [optional] # noqa: E501 + saml_strict_mode (OrganizationSettingsSamlStrictMode): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -207,3 +312,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_settings_saml.py b/src/datadog_api_client/v1/model/organization_settings_saml.py index e009276db0..d9e5d98b56 100644 --- a/src/datadog_api_client/v1/model/organization_settings_saml.py +++ b/src/datadog_api_client/v1/model/organization_settings_saml.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class OrganizationSettingsSaml(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationSettingsSaml(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationSettingsSaml - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enabled (bool): Whether or not SAML is enabled for this organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_settings_saml_autocreate_users_domains.py b/src/datadog_api_client/v1/model/organization_settings_saml_autocreate_users_domains.py index 3bf6bdad64..e9d28f94bb 100644 --- a/src/datadog_api_client/v1/model/organization_settings_saml_autocreate_users_domains.py +++ b/src/datadog_api_client/v1/model/organization_settings_saml_autocreate_users_domains.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class OrganizationSettingsSamlAutocreateUsersDomains(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationSettingsSamlAutocreateUsersDomains(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationSettingsSamlAutocreateUsersDomains - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + domains ([str]): List of domains where the SAML automated user creation is enabled.. [optional] # noqa: E501 + enabled (bool): Whether or not the automated user creation based on SAML domain is enabled.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_settings_saml_idp_initiated_login.py b/src/datadog_api_client/v1/model/organization_settings_saml_idp_initiated_login.py index db96cd534e..d50e8aca92 100644 --- a/src/datadog_api_client/v1/model/organization_settings_saml_idp_initiated_login.py +++ b/src/datadog_api_client/v1/model/organization_settings_saml_idp_initiated_login.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class OrganizationSettingsSamlIdpInitiatedLogin(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationSettingsSamlIdpInitiatedLogin(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationSettingsSamlIdpInitiatedLogin - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enabled (bool): Whether SAML IdP initiated login is enabled, learn more in the [SAML documentation](https://docs.datadoghq.com/account_management/saml/#idp-initiated-login).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_settings_saml_strict_mode.py b/src/datadog_api_client/v1/model/organization_settings_saml_strict_mode.py index e10c514e5f..d0debbce11 100644 --- a/src/datadog_api_client/v1/model/organization_settings_saml_strict_mode.py +++ b/src/datadog_api_client/v1/model/organization_settings_saml_strict_mode.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class OrganizationSettingsSamlStrictMode(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationSettingsSamlStrictMode(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationSettingsSamlStrictMode - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + enabled (bool): Whether or not the SAML strict mode is enabled. If true, all users must log in with SAML. Learn more on the [SAML Strict documentation](https://docs.datadoghq.com/account_management/saml/#saml-strict).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/organization_subscription.py b/src/datadog_api_client/v1/model/organization_subscription.py index f0bc307f26..99a582b29c 100644 --- a/src/datadog_api_client/v1/model/organization_subscription.py +++ b/src/datadog_api_client/v1/model/organization_subscription.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class OrganizationSubscription(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationSubscription(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationSubscription - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (str): The subscription type. Types available are `trial`, `free`, and `pro`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/pager_duty_service.py b/src/datadog_api_client/v1/model/pager_duty_service.py index c0713325e6..bed588ba29 100644 --- a/src/datadog_api_client/v1/model/pager_duty_service.py +++ b/src/datadog_api_client/v1/model/pager_duty_service.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class PagerDutyService(ModelNormal): @@ -50,7 +52,23 @@ class PagerDutyService(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, service_key, service_name, *args, **kwargs): # noqa: E501 + """PagerDutyService - a model defined in OpenAPI + + Args: + service_key (str): Your service key in PagerDuty. + service_name (str): Your service name associated with a service key in PagerDuty. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.service_key = service_key + self.service_name = service_name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, service_key, service_name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/pager_duty_service_key.py b/src/datadog_api_client/v1/model/pager_duty_service_key.py index ded6fa9817..4aa850fd46 100644 --- a/src/datadog_api_client/v1/model/pager_duty_service_key.py +++ b/src/datadog_api_client/v1/model/pager_duty_service_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class PagerDutyServiceKey(ModelNormal): @@ -50,7 +52,23 @@ class PagerDutyServiceKey(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, service_key, *args, **kwargs): # noqa: E501 + """PagerDutyServiceKey - a model defined in OpenAPI + + Args: + service_key (str): Your service key in PagerDuty. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.service_key = service_key + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, service_key, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/pager_duty_service_name.py b/src/datadog_api_client/v1/model/pager_duty_service_name.py index dd836af990..2f30632a70 100644 --- a/src/datadog_api_client/v1/model/pager_duty_service_name.py +++ b/src/datadog_api_client/v1/model/pager_duty_service_name.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class PagerDutyServiceName(ModelNormal): @@ -50,7 +52,23 @@ class PagerDutyServiceName(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, service_name, *args, **kwargs): # noqa: E501 + """PagerDutyServiceName - a model defined in OpenAPI + + Args: + service_name (str): Your service name associated service key in PagerDuty. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.service_name = service_name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, service_name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/pagination.py b/src/datadog_api_client/v1/model/pagination.py index d8dbe4419c..79ab73455f 100644 --- a/src/datadog_api_client/v1/model/pagination.py +++ b/src/datadog_api_client/v1/model/pagination.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class Pagination(ModelNormal): @@ -50,7 +52,23 @@ class Pagination(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Pagination - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_count (int): Total count.. [optional] # noqa: E501 + total_filtered_count (int): Total count of elements matched by the filter.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/point.py b/src/datadog_api_client/v1/model/point.py index 72110e60c9..22f4f47a62 100644 --- a/src/datadog_api_client/v1/model/point.py +++ b/src/datadog_api_client/v1/model/point.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class Point(ModelSimple): @@ -51,7 +53,23 @@ class Point(ModelSimple): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -161,9 +181,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """Point - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([float, none_type]): Array of timeseries points.. # noqa: E501 + + Keyword Args: + value ([float, none_type]): Array of timeseries points.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -189,3 +292,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/process_query_definition.py b/src/datadog_api_client/v1/model/process_query_definition.py index dafcb79857..5d2681d839 100644 --- a/src/datadog_api_client/v1/model/process_query_definition.py +++ b/src/datadog_api_client/v1/model/process_query_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ProcessQueryDefinition(ModelNormal): @@ -54,7 +56,23 @@ class ProcessQueryDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, metric, *args, **kwargs): # noqa: E501 + """ProcessQueryDefinition - a model defined in OpenAPI + + Args: + metric (str): Your chosen metric. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter_by ([str]): List of processes.. [optional] # noqa: E501 + limit (int): Max number of items in the filter list.. [optional] # noqa: E501 + search_by (str): Your chosen search term.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.metric = metric + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, metric, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/query_sort_order.py b/src/datadog_api_client/v1/model/query_sort_order.py index f53379052c..7befbfa79c 100644 --- a/src/datadog_api_client/v1/model/query_sort_order.py +++ b/src/datadog_api_client/v1/model/query_sort_order.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class QuerySortOrder(ModelSimple): @@ -51,7 +53,23 @@ class QuerySortOrder(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """QuerySortOrder - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Direction of sort.. if omitted defaults to "desc", must be one of ["asc", "desc", ] # noqa: E501 + + Keyword Args: + value (str): Direction of sort.. if omitted defaults to "desc", must be one of ["asc", "desc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "desc" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/query_value_widget_definition.py b/src/datadog_api_client/v1/model/query_value_widget_definition.py index d6aa002124..b4e9e24499 100644 --- a/src/datadog_api_client/v1/model/query_value_widget_definition.py +++ b/src/datadog_api_client/v1/model/query_value_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -69,7 +71,24 @@ class QueryValueWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -118,6 +137,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """QueryValueWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([QueryValueWidgetRequest]): Widget definition. + type (QueryValueWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + autoscale (bool): Whether to use auto-scaling or not.. [optional] # noqa: E501 + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + custom_unit (str): Display a unit of your choice on the widget.. [optional] # noqa: E501 + precision (int): Number of decimals to show. If not defined, the widget uses the raw value.. [optional] # noqa: E501 + text_align (WidgetTextAlign): [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -215,3 +325,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/query_value_widget_definition_type.py b/src/datadog_api_client/v1/model/query_value_widget_definition_type.py index 684a16ad0e..2d3e7424cf 100644 --- a/src/datadog_api_client/v1/model/query_value_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/query_value_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class QueryValueWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class QueryValueWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """QueryValueWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the query value widget.. if omitted defaults to "query_value", must be one of ["query_value", ] # noqa: E501 + + Keyword Args: + value (str): Type of the query value widget.. if omitted defaults to "query_value", must be one of ["query_value", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "query_value" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/query_value_widget_request.py b/src/datadog_api_client/v1/model/query_value_widget_request.py index 13c94bf2c2..a25017c412 100644 --- a/src/datadog_api_client/v1/model/query_value_widget_request.py +++ b/src/datadog_api_client/v1/model/query_value_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -68,7 +70,24 @@ class QueryValueWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -125,6 +144,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """QueryValueWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregator (WidgetAggregator): [optional] # noqa: E501 + apm_query (LogQueryDefinition): [optional] # noqa: E501 + audit_query (LogQueryDefinition): [optional] # noqa: E501 + conditional_formats ([WidgetConditionalFormat]): List of conditional formats.. [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + formulas ([WidgetFormula]): List of formulas that operate on queries. **This feature is currently in beta.**. [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): TODO.. [optional] # noqa: E501 + queries ([FormulaAndFunctionQueryDefinition]): List of queries that can be returned directly or used in formulas. **This feature is currently in beta.**. [optional] # noqa: E501 + response_format (FormulaAndFunctionResponseFormat): [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -222,3 +332,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/response_meta_attributes.py b/src/datadog_api_client/v1/model/response_meta_attributes.py index f58531723e..6a9a2dce58 100644 --- a/src/datadog_api_client/v1/model/response_meta_attributes.py +++ b/src/datadog_api_client/v1/model/response_meta_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ResponseMetaAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ResponseMetaAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (Pagination): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/scatter_plot_request.py b/src/datadog_api_client/v1/model/scatter_plot_request.py index 25917aff76..ae8848f8b4 100644 --- a/src/datadog_api_client/v1/model/scatter_plot_request.py +++ b/src/datadog_api_client/v1/model/scatter_plot_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class ScatterPlotRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -107,6 +126,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ScatterPlotRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregator (WidgetAggregator): [optional] # noqa: E501 + apm_query (LogQueryDefinition): [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Query definition.. [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -199,3 +304,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/scatter_plot_widget_definition.py b/src/datadog_api_client/v1/model/scatter_plot_widget_definition.py index 9d90f26c3a..3c91c81101 100644 --- a/src/datadog_api_client/v1/model/scatter_plot_widget_definition.py +++ b/src/datadog_api_client/v1/model/scatter_plot_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class ScatterPlotWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """ScatterPlotWidgetDefinition - a model defined in OpenAPI + + Args: + requests (ScatterPlotWidgetDefinitionRequests): + type (ScatterPlotWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + color_by_groups ([str]): List of groups used for colors.. [optional] # noqa: E501 + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + xaxis (WidgetAxis): [optional] # noqa: E501 + yaxis (WidgetAxis): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -209,3 +318,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py b/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py index 7f361be6bd..b6c6ca9524 100644 --- a/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py +++ b/src/datadog_api_client/v1/model/scatter_plot_widget_definition_requests.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ScatterPlotWidgetDefinitionRequests(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, x, y, *args, **kwargs): # noqa: E501 + """ScatterPlotWidgetDefinitionRequests - a model defined in OpenAPI + + Args: + x (ScatterPlotRequest): + y (ScatterPlotRequest): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.x = x + self.y = y + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, x, y, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/scatter_plot_widget_definition_type.py b/src/datadog_api_client/v1/model/scatter_plot_widget_definition_type.py index 2880fe907e..18da9051b7 100644 --- a/src/datadog_api_client/v1/model/scatter_plot_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/scatter_plot_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ScatterPlotWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ScatterPlotWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ScatterPlotWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the scatter plot widget.. if omitted defaults to "scatterplot", must be one of ["scatterplot", ] # noqa: E501 + + Keyword Args: + value (str): Type of the scatter plot widget.. if omitted defaults to "scatterplot", must be one of ["scatterplot", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "scatterplot" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/series.py b/src/datadog_api_client/v1/model/series.py index 9bc6db8cef..b2df35615b 100644 --- a/src/datadog_api_client/v1/model/series.py +++ b/src/datadog_api_client/v1/model/series.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class Series(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,6 +117,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, metric, points, *args, **kwargs): # noqa: E501 + """Series - a model defined in OpenAPI + + Args: + metric (str): The name of the timeseries. + points ([Point]): Points relating to a metric. All points must be tuples with timestamp and a scalar value (cannot be a string). Timestamps should be in POSIX time in seconds, and cannot be more than ten minutes in the future or more than one hour in the past. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + host (str): The name of the host that produced the metric.. [optional] # noqa: E501 + interval (int, none_type): If the type of the metric is rate or count, define the corresponding interval.. [optional] # noqa: E501 + tags ([str]): A list of tags associated with the metric.. [optional] # noqa: E501 + type (str): The type of the metric either `count`, `gauge`, or `rate`.. [optional] if omitted the server will use the default value of "gauge" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.metric = metric + self.points = points + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -190,3 +295,8 @@ def __init__(self, metric, points, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_check.py b/src/datadog_api_client/v1/model/service_check.py index c9f2bd0da5..7659754dc6 100644 --- a/src/datadog_api_client/v1/model/service_check.py +++ b/src/datadog_api_client/v1/model/service_check.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ServiceCheck(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, check, host_name, status, tags, *args, **kwargs): # noqa: E501 + """ServiceCheck - a model defined in OpenAPI + + Args: + check (str): The check. + host_name (str): The host name correlated with the check. + status (ServiceCheckStatus): + tags ([str]): Tags related to a check. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + message (str): Message containing check status.. [optional] # noqa: E501 + timestamp (int): Time of check.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.check = check + self.host_name = host_name + self.status = status + self.tags = tags + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +296,8 @@ def __init__(self, check, host_name, status, tags, *args, **kwargs): # noqa: E5 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_check_status.py b/src/datadog_api_client/v1/model/service_check_status.py index 05c9daba61..cce728cb66 100644 --- a/src/datadog_api_client/v1/model/service_check_status.py +++ b/src/datadog_api_client/v1/model/service_check_status.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ServiceCheckStatus(ModelSimple): @@ -53,7 +55,23 @@ class ServiceCheckStatus(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ServiceCheckStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): The status of a service check.., must be one of [0, 1, 2, 3, ] # noqa: E501 + + Keyword Args: + value (int): The status of a service check.., must be one of [0, 1, 2, 3, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/service_checks.py b/src/datadog_api_client/v1/model/service_checks.py index 811c4fb1e8..de6a20f425 100644 --- a/src/datadog_api_client/v1/model/service_checks.py +++ b/src/datadog_api_client/v1/model/service_checks.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class ServiceChecks(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ServiceChecks - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([ServiceCheck]): The service checks.. # noqa: E501 + + Keyword Args: + value ([ServiceCheck]): The service checks.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/service_level_objective.py b/src/datadog_api_client/v1/model/service_level_objective.py index 7efdfd073c..365b6ef9c5 100644 --- a/src/datadog_api_client/v1/model/service_level_objective.py +++ b/src/datadog_api_client/v1/model/service_level_objective.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class ServiceLevelObjective(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -118,6 +137,100 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, thresholds, type, *args, **kwargs): # noqa: E501 + """ServiceLevelObjective - a model defined in OpenAPI + + Args: + name (str): The name of the service level objective object. + thresholds ([SLOThreshold]): The thresholds (timeframes and associated targets) for this service level objective object. + type (SLOType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (int): Creation timestamp (UNIX time in seconds) Always included in service level objective responses.. [optional] # noqa: E501 + creator (Creator): [optional] # noqa: E501 + description (str, none_type): A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests.. [optional] # noqa: E501 + groups ([str]): A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one.. [optional] # noqa: E501 + id (str): A unique identifier for the service level objective object. Always included in service level objective responses.. [optional] # noqa: E501 + modified_at (int): Modification timestamp (UNIX time in seconds) Always included in service level objective responses.. [optional] # noqa: E501 + monitor_ids ([int]): A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**.. [optional] # noqa: E501 + monitor_tags ([str]): The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field).. [optional] # noqa: E501 + query (ServiceLevelObjectiveQuery): [optional] # noqa: E501 + tags ([str]): A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.thresholds = thresholds + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -218,3 +331,8 @@ def __init__(self, name, thresholds, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_level_objective_query.py b/src/datadog_api_client/v1/model/service_level_objective_query.py index 3c57c95df3..155db6effe 100644 --- a/src/datadog_api_client/v1/model/service_level_objective_query.py +++ b/src/datadog_api_client/v1/model/service_level_objective_query.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ServiceLevelObjectiveQuery(ModelNormal): @@ -50,7 +52,23 @@ class ServiceLevelObjectiveQuery(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, denominator, numerator, *args, **kwargs): # noqa: E501 + """ServiceLevelObjectiveQuery - a model defined in OpenAPI + + Args: + denominator (str): A Datadog metric query for total (valid) events. + numerator (str): A Datadog metric query for good events. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.denominator = denominator + self.numerator = numerator + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, denominator, numerator, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_level_objective_request.py b/src/datadog_api_client/v1/model/service_level_objective_request.py index 513819ec01..8f01c8689d 100644 --- a/src/datadog_api_client/v1/model/service_level_objective_request.py +++ b/src/datadog_api_client/v1/model/service_level_objective_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class ServiceLevelObjectiveRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -106,6 +125,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, thresholds, type, *args, **kwargs): # noqa: E501 + """ServiceLevelObjectiveRequest - a model defined in OpenAPI + + Args: + name (str): The name of the service level objective object. + thresholds ([SLOThreshold]): The thresholds (timeframes and associated targets) for this service level objective object. + type (SLOType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str, none_type): A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests.. [optional] # noqa: E501 + groups ([str]): A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one.. [optional] # noqa: E501 + monitor_ids ([int]): A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**.. [optional] # noqa: E501 + query (ServiceLevelObjectiveQuery): [optional] # noqa: E501 + tags ([str]): A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.thresholds = thresholds + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -201,3 +309,8 @@ def __init__(self, name, thresholds, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_map_widget_definition.py b/src/datadog_api_client/v1/model/service_map_widget_definition.py index ebb11709c0..161d922ad3 100644 --- a/src/datadog_api_client/v1/model/service_map_widget_definition.py +++ b/src/datadog_api_client/v1/model/service_map_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class ServiceMapWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,6 +124,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, filters, service, type, *args, **kwargs): # noqa: E501 + """ServiceMapWidgetDefinition - a model defined in OpenAPI + + Args: + filters ([str]): Your environment and primary tag (or * if enabled for your account). + service (str): The ID of the service you want to map. + type (ServiceMapWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + title (str): The title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.filters = filters + self.service = service + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -199,3 +306,8 @@ def __init__(self, filters, service, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_map_widget_definition_type.py b/src/datadog_api_client/v1/model/service_map_widget_definition_type.py index 7e0108de60..06de5e2c47 100644 --- a/src/datadog_api_client/v1/model/service_map_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/service_map_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ServiceMapWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ServiceMapWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ServiceMapWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the service map widget.. if omitted defaults to "servicemap", must be one of ["servicemap", ] # noqa: E501 + + Keyword Args: + value (str): Type of the service map widget.. if omitted defaults to "servicemap", must be one of ["servicemap", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "servicemap" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/service_summary_widget_definition.py b/src/datadog_api_client/v1/model/service_summary_widget_definition.py index 2b8e6b236b..a89fc82ba0 100644 --- a/src/datadog_api_client/v1/model/service_summary_widget_definition.py +++ b/src/datadog_api_client/v1/model/service_summary_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class ServiceSummaryWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -123,6 +142,104 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, env, service, span_name, type, *args, **kwargs): # noqa: E501 + """ServiceSummaryWidgetDefinition - a model defined in OpenAPI + + Args: + env (str): APM environment. + service (str): APM service. + span_name (str): APM span name. + type (ServiceSummaryWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + display_format (WidgetServiceSummaryDisplayFormat): [optional] # noqa: E501 + show_breakdown (bool): Whether to show the latency breakdown or not.. [optional] # noqa: E501 + show_distribution (bool): Whether to show the latency distribution or not.. [optional] # noqa: E501 + show_errors (bool): Whether to show the error metrics or not.. [optional] # noqa: E501 + show_hits (bool): Whether to show the hits metrics or not.. [optional] # noqa: E501 + show_latency (bool): Whether to show the latency metrics or not.. [optional] # noqa: E501 + show_resource_list (bool): Whether to show the resource list or not.. [optional] # noqa: E501 + size_format (WidgetSizeFormat): [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.env = env + self.service = service + self.span_name = span_name + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -227,3 +344,8 @@ def __init__(self, env, service, span_name, type, *args, **kwargs): # noqa: E50 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/service_summary_widget_definition_type.py b/src/datadog_api_client/v1/model/service_summary_widget_definition_type.py index 4fb25f8c98..5908b9c5a0 100644 --- a/src/datadog_api_client/v1/model/service_summary_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/service_summary_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ServiceSummaryWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ServiceSummaryWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ServiceSummaryWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the service summary widget.. if omitted defaults to "trace_service", must be one of ["trace_service", ] # noqa: E501 + + Keyword Args: + value (str): Type of the service summary widget.. if omitted defaults to "trace_service", must be one of ["trace_service", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "trace_service" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slack_integration_channel.py b/src/datadog_api_client/v1/model/slack_integration_channel.py index fdb0ca9482..aa33f77b12 100644 --- a/src/datadog_api_client/v1/model/slack_integration_channel.py +++ b/src/datadog_api_client/v1/model/slack_integration_channel.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SlackIntegrationChannel(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SlackIntegrationChannel - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + display (SlackIntegrationChannelDisplay): [optional] # noqa: E501 + name (str): Your channel name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slack_integration_channel_display.py b/src/datadog_api_client/v1/model/slack_integration_channel_display.py index 3aefd1df80..acc79e9385 100644 --- a/src/datadog_api_client/v1/model/slack_integration_channel_display.py +++ b/src/datadog_api_client/v1/model/slack_integration_channel_display.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SlackIntegrationChannelDisplay(ModelNormal): @@ -50,7 +52,23 @@ class SlackIntegrationChannelDisplay(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SlackIntegrationChannelDisplay - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + message (bool): Show the main body of the alert event.. [optional] if omitted the server will use the default value of True # noqa: E501 + notified (bool): Show the list of @-handles in the alert event.. [optional] if omitted the server will use the default value of True # noqa: E501 + snapshot (bool): Show the alert event's snapshot image.. [optional] if omitted the server will use the default value of True # noqa: E501 + tags (bool): Show the scopes on which the monitor alerted.. [optional] if omitted the server will use the default value of True # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slack_integration_channels.py b/src/datadog_api_client/v1/model/slack_integration_channels.py index a76c5f2357..3726f96d2f 100644 --- a/src/datadog_api_client/v1/model/slack_integration_channels.py +++ b/src/datadog_api_client/v1/model/slack_integration_channels.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class SlackIntegrationChannels(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SlackIntegrationChannels - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([SlackIntegrationChannel]): A list of configured Slack channels.. # noqa: E501 + + Keyword Args: + value ([SlackIntegrationChannel]): A list of configured Slack channels.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_bulk_delete.py b/src/datadog_api_client/v1/model/slo_bulk_delete.py index e3c7ba8471..82aecac728 100644 --- a/src/datadog_api_client/v1/model/slo_bulk_delete.py +++ b/src/datadog_api_client/v1/model/slo_bulk_delete.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -88,6 +90,82 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOBulkDelete - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +248,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_bulk_delete_error.py b/src/datadog_api_client/v1/model/slo_bulk_delete_error.py index d1963fbc1a..5c6ded88a7 100644 --- a/src/datadog_api_client/v1/model/slo_bulk_delete_error.py +++ b/src/datadog_api_client/v1/model/slo_bulk_delete_error.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOBulkDeleteError(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, message, timeframe, *args, **kwargs): # noqa: E501 + """SLOBulkDeleteError - a model defined in OpenAPI + + Args: + id (str): The ID of the service level objective object associated with this error. + message (str): The error message. + timeframe (SLOErrorTimeframe): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.message = message + self.timeframe = timeframe + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +282,8 @@ def __init__(self, id, message, timeframe, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_bulk_delete_response.py b/src/datadog_api_client/v1/model/slo_bulk_delete_response.py index 135cf43c2e..85fe513976 100644 --- a/src/datadog_api_client/v1/model/slo_bulk_delete_response.py +++ b/src/datadog_api_client/v1/model/slo_bulk_delete_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOBulkDeleteResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOBulkDeleteResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SLOBulkDeleteResponseData): [optional] # noqa: E501 + errors ([SLOBulkDeleteError]): Array of errors object returned.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_bulk_delete_response_data.py b/src/datadog_api_client/v1/model/slo_bulk_delete_response_data.py index bd06cb612a..7402b087fb 100644 --- a/src/datadog_api_client/v1/model/slo_bulk_delete_response_data.py +++ b/src/datadog_api_client/v1/model/slo_bulk_delete_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOBulkDeleteResponseData(ModelNormal): @@ -50,7 +52,23 @@ class SLOBulkDeleteResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOBulkDeleteResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted ([str]): An array of service level objective object IDs that indicates which objects that were completely deleted.. [optional] # noqa: E501 + updated ([str]): An array of service level objective object IDs that indicates which objects that were modified (objects for which at least one threshold was deleted, but that were not completely deleted).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction.py b/src/datadog_api_client/v1/model/slo_correction.py index ba472dfa2e..5318a8eb68 100644 --- a/src/datadog_api_client/v1/model/slo_correction.py +++ b/src/datadog_api_client/v1/model/slo_correction.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOCorrection(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrection - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (SLOCorrectionResponseAttributes): [optional] # noqa: E501 + id (str): The ID of the SLO correction. [optional] # noqa: E501 + type (SLOCorrectionType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_category.py b/src/datadog_api_client/v1/model/slo_correction_category.py index cf12d54bd5..6a756042fa 100644 --- a/src/datadog_api_client/v1/model/slo_correction_category.py +++ b/src/datadog_api_client/v1/model/slo_correction_category.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOCorrectionCategory(ModelSimple): @@ -53,7 +55,23 @@ class SLOCorrectionCategory(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOCorrectionCategory - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Category the SLO correction belongs to., must be one of ["Scheduled Maintenance", "Outside Business Hours", "Deployment", "Other", ] # noqa: E501 + + Keyword Args: + value (str): Category the SLO correction belongs to., must be one of ["Scheduled Maintenance", "Outside Business Hours", "Deployment", "Other", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_correction_create_data.py b/src/datadog_api_client/v1/model/slo_correction_create_data.py index 4a6b1d910a..33dd2bfced 100644 --- a/src/datadog_api_client/v1/model/slo_correction_create_data.py +++ b/src/datadog_api_client/v1/model/slo_correction_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SLOCorrectionCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionCreateData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (SLOCorrectionCreateRequestAttributes): [optional] # noqa: E501 + type (SLOCorrectionType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_create_request.py b/src/datadog_api_client/v1/model/slo_correction_create_request.py index cbea257245..a8e8b21e26 100644 --- a/src/datadog_api_client/v1/model/slo_correction_create_request.py +++ b/src/datadog_api_client/v1/model/slo_correction_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOCorrectionCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionCreateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SLOCorrectionCreateData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_create_request_attributes.py b/src/datadog_api_client/v1/model/slo_correction_create_request_attributes.py index 280db5d5a9..4962a44dad 100644 --- a/src/datadog_api_client/v1/model/slo_correction_create_request_attributes.py +++ b/src/datadog_api_client/v1/model/slo_correction_create_request_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOCorrectionCreateRequestAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, category, end, slo_id, start, *args, **kwargs): # noqa: E501 + """SLOCorrectionCreateRequestAttributes - a model defined in OpenAPI + + Args: + category (SLOCorrectionCategory): + end (int): Ending time of the correction in epoch seconds + slo_id (str): ID of the SLO that this correction will be applied to + start (int): Starting time of the correction in epoch seconds + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + description (str): Description of the correction being made.. [optional] # noqa: E501 + timezone (str): The timezone to display in the UI for the correction times (defaults to \"UTC\"). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.category = category + self.end = end + self.slo_id = slo_id + self.start = start + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +296,8 @@ def __init__(self, category, end, slo_id, start, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_list_response.py b/src/datadog_api_client/v1/model/slo_correction_list_response.py index 5da68f8e61..e41e4be02e 100644 --- a/src/datadog_api_client/v1/model/slo_correction_list_response.py +++ b/src/datadog_api_client/v1/model/slo_correction_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOCorrectionListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([SLOCorrection]): The list of of SLO corrections objects. [optional] # noqa: E501 + meta (ResponseMetaAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_response.py b/src/datadog_api_client/v1/model/slo_correction_response.py index f35fa4570e..448f4aa0ab 100644 --- a/src/datadog_api_client/v1/model/slo_correction_response.py +++ b/src/datadog_api_client/v1/model/slo_correction_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOCorrectionResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SLOCorrection): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_response_attributes.py b/src/datadog_api_client/v1/model/slo_correction_response_attributes.py index 952d15a284..7b68cbd429 100644 --- a/src/datadog_api_client/v1/model/slo_correction_response_attributes.py +++ b/src/datadog_api_client/v1/model/slo_correction_response_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOCorrectionResponseAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionResponseAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + category (SLOCorrectionCategory): [optional] # noqa: E501 + creator (Creator): [optional] # noqa: E501 + description (str): Description of the correction being made.. [optional] # noqa: E501 + end (int): Ending time of the correction in epoch seconds. [optional] # noqa: E501 + slo_id (str): ID of the SLO that this correction will be applied to. [optional] # noqa: E501 + start (int): Starting time of the correction in epoch seconds. [optional] # noqa: E501 + timezone (str): The timezone to display in the UI for the correction times (defaults to \"UTC\"). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +290,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_type.py b/src/datadog_api_client/v1/model/slo_correction_type.py index 34d4f08e8c..d62c8beba3 100644 --- a/src/datadog_api_client/v1/model/slo_correction_type.py +++ b/src/datadog_api_client/v1/model/slo_correction_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOCorrectionType(ModelSimple): @@ -50,7 +52,23 @@ class SLOCorrectionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOCorrectionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): SLO correction resource type.. if omitted defaults to "correction", must be one of ["correction", ] # noqa: E501 + + Keyword Args: + value (str): SLO correction resource type.. if omitted defaults to "correction", must be one of ["correction", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "correction" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_correction_update_data.py b/src/datadog_api_client/v1/model/slo_correction_update_data.py index 92bd9b8644..53cc82bf3c 100644 --- a/src/datadog_api_client/v1/model/slo_correction_update_data.py +++ b/src/datadog_api_client/v1/model/slo_correction_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SLOCorrectionUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionUpdateData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (SLOCorrectionUpdateRequestAttributes): [optional] # noqa: E501 + type (SLOCorrectionType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_update_request.py b/src/datadog_api_client/v1/model/slo_correction_update_request.py index 7b5388d8db..d127fbcbee 100644 --- a/src/datadog_api_client/v1/model/slo_correction_update_request.py +++ b/src/datadog_api_client/v1/model/slo_correction_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOCorrectionUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionUpdateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SLOCorrectionUpdateData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_correction_update_request_attributes.py b/src/datadog_api_client/v1/model/slo_correction_update_request_attributes.py index 1c67037754..9808c55480 100644 --- a/src/datadog_api_client/v1/model/slo_correction_update_request_attributes.py +++ b/src/datadog_api_client/v1/model/slo_correction_update_request_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOCorrectionUpdateRequestAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOCorrectionUpdateRequestAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + category (SLOCorrectionCategory): [optional] # noqa: E501 + description (str): Description of the correction being made.. [optional] # noqa: E501 + end (int): Ending time of the correction in epoch seconds. [optional] # noqa: E501 + start (int): Starting time of the correction in epoch seconds. [optional] # noqa: E501 + timezone (str): The timezone to display in the UI for the correction times (defaults to \"UTC\"). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_delete_response.py b/src/datadog_api_client/v1/model/slo_delete_response.py index 37b8cb76ef..a78bb3dbc9 100644 --- a/src/datadog_api_client/v1/model/slo_delete_response.py +++ b/src/datadog_api_client/v1/model/slo_delete_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLODeleteResponse(ModelNormal): @@ -50,7 +52,23 @@ class SLODeleteResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLODeleteResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([str]): An array containing the ID of the deleted service level objective object.. [optional] # noqa: E501 + errors ({str: (str,)}): An dictionary containing the ID of the SLO as key and a deletion error as value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_error_budget_remaining_data.py b/src/datadog_api_client/v1/model/slo_error_budget_remaining_data.py index b9d21ee277..5c45003b93 100644 --- a/src/datadog_api_client/v1/model/slo_error_budget_remaining_data.py +++ b/src/datadog_api_client/v1/model/slo_error_budget_remaining_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOErrorBudgetRemainingData(ModelNormal): @@ -80,6 +82,82 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOErrorBudgetRemainingData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -162,3 +240,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_error_timeframe.py b/src/datadog_api_client/v1/model/slo_error_timeframe.py index 363c4a8a5e..ff69216588 100644 --- a/src/datadog_api_client/v1/model/slo_error_timeframe.py +++ b/src/datadog_api_client/v1/model/slo_error_timeframe.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOErrorTimeframe(ModelSimple): @@ -53,7 +55,23 @@ class SLOErrorTimeframe(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOErrorTimeframe - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The timeframe of the threshold associated with this error or \"all\" if all thresholds are affected.., must be one of ["7d", "30d", "90d", "all", ] # noqa: E501 + + Keyword Args: + value (str): The timeframe of the threshold associated with this error or \"all\" if all thresholds are affected.., must be one of ["7d", "30d", "90d", "all", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_history_metrics.py b/src/datadog_api_client/v1/model/slo_history_metrics.py index fefe353fc3..c69dad4b73 100644 --- a/src/datadog_api_client/v1/model/slo_history_metrics.py +++ b/src/datadog_api_client/v1/model/slo_history_metrics.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOHistoryMetrics(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,101 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, denominator, interval, numerator, query, res_type, resp_version, times, *args, **kwargs + ): # noqa: E501 + """SLOHistoryMetrics - a model defined in OpenAPI + + Args: + denominator (SLOHistoryMetricsSeries): + interval (int): The aggregated query interval for the series data. It's implicit based on the query time window. + numerator (SLOHistoryMetricsSeries): + query (str): The combined numerator and denominator query CSV. + res_type (str): The series result type. This mimics `batch_query` response type. + resp_version (int): The series response version type. This mimics `batch_query` response type. + times ([float]): An array of query timestamps in EPOCH milliseconds + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + message (str): Optional message if there are specific query issues/warnings.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.denominator = denominator + self.interval = interval + self.numerator = numerator + self.query = query + self.res_type = res_type + self.resp_version = resp_version + self.times = times + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -200,3 +314,8 @@ def __init__( # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_metrics_series.py b/src/datadog_api_client/v1/model/slo_history_metrics_series.py index be2bc0d99d..8b0390a62d 100644 --- a/src/datadog_api_client/v1/model/slo_history_metrics_series.py +++ b/src/datadog_api_client/v1/model/slo_history_metrics_series.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOHistoryMetricsSeries(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, count, metadata, sum, values, *args, **kwargs): # noqa: E501 + """SLOHistoryMetricsSeries - a model defined in OpenAPI + + Args: + count (int): Count of submitted metrics. + metadata (SLOHistoryMetricsSeriesMetadata): + sum (float): Total sum of the query. + values ([float]): The query values for each metric. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.count = count + self.metadata = metadata + self.sum = sum + self.values = values + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +288,8 @@ def __init__(self, count, metadata, sum, values, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata.py b/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata.py index 80e9f2d97a..9439bc7b67 100644 --- a/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata.py +++ b/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOHistoryMetricsSeriesMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,6 +117,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOHistoryMetricsSeriesMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggr (str): Query aggregator function.. [optional] # noqa: E501 + expression (str): Query expression.. [optional] # noqa: E501 + metric (str): Query metric used.. [optional] # noqa: E501 + query_index (int): Query index from original combined query.. [optional] # noqa: E501 + scope (str): Query scope.. [optional] # noqa: E501 + unit ([SLOHistoryMetricsSeriesMetadataUnit], none_type): An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +287,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata_unit.py b/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata_unit.py index 1639d3b65f..645ccad239 100644 --- a/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata_unit.py +++ b/src/datadog_api_client/v1/model/slo_history_metrics_series_metadata_unit.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOHistoryMetricsSeriesMetadataUnit(ModelNormal): @@ -50,7 +52,23 @@ class SLOHistoryMetricsSeriesMetadataUnit(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -94,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOHistoryMetricsSeriesMetadataUnit - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + family (str): The family of metric unit, for example `bytes` is the family for `kibibyte`, `byte`, and `bit` units.. [optional] # noqa: E501 + id (int): The ID of the metric unit.. [optional] # noqa: E501 + name (str): The unit of the metric, for instance `byte`.. [optional] # noqa: E501 + plural (str, none_type): The plural Unit of metric, for instance `bytes`.. [optional] # noqa: E501 + scale_factor (float): The scale factor of metric unit, for instance `1.0`.. [optional] # noqa: E501 + short_name (str, none_type): A shorter and abbreviated version of the metric unit, for instance `B`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_response.py b/src/datadog_api_client/v1/model/slo_history_response.py index a502ec75e1..8779743c9c 100644 --- a/src/datadog_api_client/v1/model/slo_history_response.py +++ b/src/datadog_api_client/v1/model/slo_history_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOHistoryResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOHistoryResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SLOHistoryResponseData): [optional] # noqa: E501 + errors ([SLOHistoryResponseError]): A list of errors while querying the history data for the service level objective.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_response_data.py b/src/datadog_api_client/v1/model/slo_history_response_data.py index 6e4f29e362..eb7bb408c7 100644 --- a/src/datadog_api_client/v1/model/slo_history_response_data.py +++ b/src/datadog_api_client/v1/model/slo_history_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SLOHistoryResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -111,6 +130,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOHistoryResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + from_ts (int): The `from` timestamp in epoch seconds.. [optional] # noqa: E501 + group_by ([str]): For `metric` based SLOs where the query includes a group-by clause, this represents the list of grouping parameters. This is not included in responses for `monitor` based SLOs.. [optional] # noqa: E501 + groups ([SLOHistorySLIData]): For grouped SLOs, this represents SLI data for specific groups. This is not included in the responses for `metric` based SLOs.. [optional] # noqa: E501 + monitors ([SLOHistorySLIData]): For multi-monitor SLOs, this represents SLI data for specific monitors. This is not included in the responses for `metric` based SLOs.. [optional] # noqa: E501 + overall (SLOHistorySLIData): [optional] # noqa: E501 + series (SLOHistoryMetrics): [optional] # noqa: E501 + thresholds ({str: (SLOThreshold,)}): mapping of string timeframe to the SLO threshold.. [optional] # noqa: E501 + to_ts (int): The `to` timestamp in epoch seconds.. [optional] # noqa: E501 + type (SLOType): [optional] # noqa: E501 + type_id (SLOTypeNumeric): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +308,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_response_error.py b/src/datadog_api_client/v1/model/slo_history_response_error.py index 84c8ed56fc..6284b0e162 100644 --- a/src/datadog_api_client/v1/model/slo_history_response_error.py +++ b/src/datadog_api_client/v1/model/slo_history_response_error.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOHistoryResponseError(ModelNormal): @@ -50,7 +52,23 @@ class SLOHistoryResponseError(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOHistoryResponseError - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error (str): Human readable error.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_history_sli_data.py b/src/datadog_api_client/v1/model/slo_history_sli_data.py index 48d847ea45..bb3ed94687 100644 --- a/src/datadog_api_client/v1/model/slo_history_sli_data.py +++ b/src/datadog_api_client/v1/model/slo_history_sli_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOHistorySLIData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOHistorySLIData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + error_budget_remaining (SLOErrorBudgetRemainingData): [optional] # noqa: E501 + errors ([SLOHistoryResponseError]): A list of errors while querying the history data for the service level objective.. [optional] # noqa: E501 + group (str): For groups in a grouped SLO, this is the group name.. [optional] # noqa: E501 + history ([[float]]): For `monitor` based SLOs, this includes the aggregated history uptime time series.. [optional] # noqa: E501 + monitor_modified (int): For `monitor` based SLOs, this is the last modified timestamp in epoch seconds of the monitor.. [optional] # noqa: E501 + monitor_type (str): For `monitor` based SLOs, this describes the type of monitor.. [optional] # noqa: E501 + name (str): For groups in a grouped SLO, this is the group name. For monitors in a multi-monitor SLO, this is the monitor name.. [optional] # noqa: E501 + precision ({str: (float,)}): A mapping of threshold `timeframe` to number of accurate decimals, regardless of the from && to timestamp.. [optional] # noqa: E501 + preview (bool): For `monitor` based SLOs, when `true` this indicates that a replay is in progress to give an accurate uptime calculation.. [optional] # noqa: E501 + sli_value (float): The current SLI value of the SLO over the history window.. [optional] # noqa: E501 + span_precision (float): The amount of decimal places the SLI value is accurate to for the given from `&&` to timestamp.. [optional] # noqa: E501 + uptime (float): Use `sli_value` instead.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +310,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_list_response.py b/src/datadog_api_client/v1/model/slo_list_response.py index f3a9ec2b73..019b4c1725 100644 --- a/src/datadog_api_client/v1/model/slo_list_response.py +++ b/src/datadog_api_client/v1/model/slo_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SLOListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([ServiceLevelObjective]): An array of service level objective objects.. [optional] # noqa: E501 + errors ([str]): An array of error messages. Each endpoint documents how/whether this field is used.. [optional] # noqa: E501 + metadata (SLOListResponseMetadata): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_list_response_metadata.py b/src/datadog_api_client/v1/model/slo_list_response_metadata.py index 03171c4bd3..9a6de873ef 100644 --- a/src/datadog_api_client/v1/model/slo_list_response_metadata.py +++ b/src/datadog_api_client/v1/model/slo_list_response_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOListResponseMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOListResponseMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (SLOListResponseMetadataPage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_list_response_metadata_page.py b/src/datadog_api_client/v1/model/slo_list_response_metadata_page.py index b7777086e9..c8117db0c2 100644 --- a/src/datadog_api_client/v1/model/slo_list_response_metadata_page.py +++ b/src/datadog_api_client/v1/model/slo_list_response_metadata_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOListResponseMetadataPage(ModelNormal): @@ -50,7 +52,23 @@ class SLOListResponseMetadataPage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOListResponseMetadataPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_count (int): The total number of resources that could be retrieved ignoring the parameters and filters in the request.. [optional] # noqa: E501 + total_filtered_count (int): The total number of resources that match the parameters and filters in the request. This attribute can be used by a client to determine the total number of pages.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_response.py b/src/datadog_api_client/v1/model/slo_response.py index 62c6dadfe4..5c494c7ec8 100644 --- a/src/datadog_api_client/v1/model/slo_response.py +++ b/src/datadog_api_client/v1/model/slo_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SLOResponseData): [optional] # noqa: E501 + errors ([str]): An array of error messages. Each endpoint documents how/whether this field is used.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_response_data.py b/src/datadog_api_client/v1/model/slo_response_data.py index cd7289f47d..06e7d28d52 100644 --- a/src/datadog_api_client/v1/model/slo_response_data.py +++ b/src/datadog_api_client/v1/model/slo_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SLOResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -120,6 +139,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SLOResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + configured_alert_ids ([int]): A list of SLO monitors IDs that reference this SLO. This field is returned only when `with_configured_alert_ids` parameter is true in query.. [optional] # noqa: E501 + created_at (int): Creation timestamp (UNIX time in seconds) Always included in service level objective responses.. [optional] # noqa: E501 + creator (Creator): [optional] # noqa: E501 + description (str, none_type): A user-defined description of the service level objective. Always included in service level objective responses (but may be `null`). Optional in create/update requests.. [optional] # noqa: E501 + groups ([str]): A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective. Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one.. [optional] # noqa: E501 + id (str): A unique identifier for the service level objective object. Always included in service level objective responses.. [optional] # noqa: E501 + modified_at (int): Modification timestamp (UNIX time in seconds) Always included in service level objective responses.. [optional] # noqa: E501 + monitor_ids ([int]): A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**.. [optional] # noqa: E501 + monitor_tags ([str]): The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field).. [optional] # noqa: E501 + name (str): The name of the service level objective object.. [optional] # noqa: E501 + query (ServiceLevelObjectiveQuery): [optional] # noqa: E501 + tags ([str]): A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests.. [optional] # noqa: E501 + thresholds ([SLOThreshold]): The thresholds (timeframes and associated targets) for this service level objective object.. [optional] # noqa: E501 + type (SLOType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -216,3 +325,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_threshold.py b/src/datadog_api_client/v1/model/slo_threshold.py index 5bb6f37836..3b884079ac 100644 --- a/src/datadog_api_client/v1/model/slo_threshold.py +++ b/src/datadog_api_client/v1/model/slo_threshold.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SLOThreshold(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, target, timeframe, *args, **kwargs): # noqa: E501 + """SLOThreshold - a model defined in OpenAPI + + Args: + target (float): The target value for the service level indicator within the corresponding timeframe. + timeframe (SLOTimeframe): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + target_display (str): A string representation of the target that indicates its precision. It uses trailing zeros to show significant decimal places (e.g. `98.00`). Always included in service level objective responses. Ignored in create/update requests.. [optional] # noqa: E501 + warning (float): The warning value for the service level objective.. [optional] # noqa: E501 + warning_display (str): A string representation of the warning target (see the description of the `target_display` field for details). Included in service level objective responses if a warning target exists. Ignored in create/update requests.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.target = target + self.timeframe = timeframe + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +288,8 @@ def __init__(self, target, timeframe, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_timeframe.py b/src/datadog_api_client/v1/model/slo_timeframe.py index ede9796934..d9fdfae4c6 100644 --- a/src/datadog_api_client/v1/model/slo_timeframe.py +++ b/src/datadog_api_client/v1/model/slo_timeframe.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOTimeframe(ModelSimple): @@ -53,7 +55,23 @@ class SLOTimeframe(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOTimeframe - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The SLO time window options.., must be one of ["7d", "30d", "90d", "custom", ] # noqa: E501 + + Keyword Args: + value (str): The SLO time window options.., must be one of ["7d", "30d", "90d", "custom", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_type.py b/src/datadog_api_client/v1/model/slo_type.py index 6f124483ba..c082524ee0 100644 --- a/src/datadog_api_client/v1/model/slo_type.py +++ b/src/datadog_api_client/v1/model/slo_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOType(ModelSimple): @@ -51,7 +53,23 @@ class SLOType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the service level objective.., must be one of ["metric", "monitor", ] # noqa: E501 + + Keyword Args: + value (str): The type of the service level objective.., must be one of ["metric", "monitor", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_type_numeric.py b/src/datadog_api_client/v1/model/slo_type_numeric.py index f393109f27..7b1f7466d4 100644 --- a/src/datadog_api_client/v1/model/slo_type_numeric.py +++ b/src/datadog_api_client/v1/model/slo_type_numeric.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOTypeNumeric(ModelSimple): @@ -51,7 +53,23 @@ class SLOTypeNumeric(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOTypeNumeric - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): A numeric representation of the type of the service level objective (`0` for monitor, `1` for metric). Always included in service level objective responses. Ignored in create/update requests.., must be one of [0, 1, ] # noqa: E501 + + Keyword Args: + value (int): A numeric representation of the type of the service level objective (`0` for monitor, `1` for metric). Always included in service level objective responses. Ignored in create/update requests.., must be one of [0, 1, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/slo_widget_definition.py b/src/datadog_api_client/v1/model/slo_widget_definition.py index 838a2cdd5f..8e2771e97c 100644 --- a/src/datadog_api_client/v1/model/slo_widget_definition.py +++ b/src/datadog_api_client/v1/model/slo_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SLOWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """SLOWidgetDefinition - a model defined in OpenAPI + + Args: + type (SLOWidgetDefinitionType): + + Keyword Args: + view_type (str): Type of view displayed by the widget.. defaults to "detail" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + global_time_target (str): Defined global time target.. [optional] # noqa: E501 + show_error_budget (bool): Defined error budget.. [optional] # noqa: E501 + slo_id (str): ID of the SLO displayed.. [optional] # noqa: E501 + time_windows ([WidgetTimeWindows]): Times being monitored.. [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + view_mode (WidgetViewMode): [optional] # noqa: E501 + """ + + view_type = kwargs.get("view_type", "detail") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + self.view_type = view_type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -206,3 +316,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/slo_widget_definition_type.py b/src/datadog_api_client/v1/model/slo_widget_definition_type.py index f98c6c31f4..09d7150edf 100644 --- a/src/datadog_api_client/v1/model/slo_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/slo_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SLOWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class SLOWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SLOWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the SLO widget.. if omitted defaults to "slo", must be one of ["slo", ] # noqa: E501 + + Keyword Args: + value (str): Type of the SLO widget.. if omitted defaults to "slo", must be one of ["slo", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "slo" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_api_step.py b/src/datadog_api_client/v1/model/synthetics_api_step.py index 27965a671c..da9f309f33 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_step.py +++ b/src/datadog_api_client/v1/model/synthetics_api_step.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsAPIStep(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPIStep - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + allow_failure (bool): Determines whether or not to continue with test if this step fails.. [optional] # noqa: E501 + assertions ([SyntheticsAssertion]): Array of assertions used for the test.. [optional] if omitted the server will use the default value of [] # noqa: E501 + extracted_values ([SyntheticsParsingOptions]): Array of values to parse and save as variables from the response.. [optional] # noqa: E501 + is_critical (bool): Determines whether or not to consider the entire test as failed if this step fails. Can be used only if `allowFailure` is `true`.. [optional] # noqa: E501 + name (str): The name of the step.. [optional] # noqa: E501 + request (SyntheticsTestRequest): [optional] # noqa: E501 + subtype (SyntheticsAPIStepSubtype): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +294,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_step_subtype.py b/src/datadog_api_client/v1/model/synthetics_api_step_subtype.py index 706c384d2e..052e198761 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_step_subtype.py +++ b/src/datadog_api_client/v1/model/synthetics_api_step_subtype.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsAPIStepSubtype(ModelSimple): @@ -50,7 +52,23 @@ class SyntheticsAPIStepSubtype(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsAPIStepSubtype - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The subtype of the Synthetic multistep API test step, currently only supporting `http`.. if omitted defaults to "http", must be one of ["http", ] # noqa: E501 + + Keyword Args: + value (str): The subtype of the Synthetic multistep API test step, currently only supporting `http`.. if omitted defaults to "http", must be one of ["http", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "http" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_api_test.py b/src/datadog_api_client/v1/model/synthetics_api_test.py index 83b2438b9a..89fb01fa33 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SyntheticsAPITest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPITest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config (SyntheticsAPITestConfig): [optional] # noqa: E501 + locations ([str]): Array of locations used to run the test.. [optional] # noqa: E501 + message (str): Notification message associated with the test.. [optional] # noqa: E501 + monitor_id (int): The associated monitor ID.. [optional] # noqa: E501 + name (str): Name of the test.. [optional] # noqa: E501 + options (SyntheticsTestOptions): [optional] # noqa: E501 + public_id (str): The public ID for the test.. [optional] # noqa: E501 + status (SyntheticsTestPauseStatus): [optional] # noqa: E501 + subtype (SyntheticsTestDetailsSubType): [optional] # noqa: E501 + tags ([str]): Array of tags attached to the test.. [optional] # noqa: E501 + type (SyntheticsAPITestType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -206,3 +312,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_config.py b/src/datadog_api_client/v1/model/synthetics_api_test_config.py index f475df8a5d..987e3a1fca 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_config.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsAPITestConfig(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestConfig - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + assertions ([SyntheticsAssertion]): Array of assertions used for the test.. [optional] if omitted the server will use the default value of [] # noqa: E501 + config_variables ([SyntheticsConfigVariable]): Array of variables used for the test.. [optional] # noqa: E501 + request (SyntheticsTestRequest): [optional] # noqa: E501 + steps ([SyntheticsAPIStep]): When the test subtype is `multi`, the steps of the test.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_result_data.py b/src/datadog_api_client/v1/model/synthetics_api_test_result_data.py index 073d2d1e94..1e38307675 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_result_data.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_result_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsAPITestResultData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestResultData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cert (SyntheticsSSLCertificate): [optional] # noqa: E501 + error_code (SyntheticsErrorCode): [optional] # noqa: E501 + error_message (str): The API test error message.. [optional] # noqa: E501 + event_type (SyntheticsTestProcessStatus): [optional] # noqa: E501 + http_status_code (int): The API test HTTP status code.. [optional] # noqa: E501 + request_headers ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}): Request header object used for the API test.. [optional] # noqa: E501 + response_body (str): Response body returned for the API test.. [optional] # noqa: E501 + response_headers ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}): Response headers returned for the API test.. [optional] # noqa: E501 + response_size (int): Global size in byte of the API test response.. [optional] # noqa: E501 + timings (SyntheticsTiming): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -205,3 +310,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_result_full.py b/src/datadog_api_client/v1/model/synthetics_api_test_result_full.py index 485b507c37..5fd47e8a33 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_result_full.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_result_full.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SyntheticsAPITestResultFull(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestResultFull - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + check (SyntheticsAPITestResultFullCheck): [optional] # noqa: E501 + check_time (float): When the API test was conducted.. [optional] # noqa: E501 + check_version (int): Version of the API test used.. [optional] # noqa: E501 + probe_dc (str): Locations for which to query the API test results.. [optional] # noqa: E501 + result (SyntheticsAPITestResultData): [optional] # noqa: E501 + result_id (str): ID of the API test result.. [optional] # noqa: E501 + status (SyntheticsTestMonitorStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -190,3 +292,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_result_full_check.py b/src/datadog_api_client/v1/model/synthetics_api_test_result_full_check.py index 7b55cff7e6..594dd901c8 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_result_full_check.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_result_full_check.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsAPITestResultFullCheck(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, config, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestResultFullCheck - a model defined in OpenAPI + + Args: + config (SyntheticsTestConfig): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.config = config + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, config, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_result_short.py b/src/datadog_api_client/v1/model/synthetics_api_test_result_short.py index b79375f336..2c9fbde394 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_result_short.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_result_short.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsAPITestResultShort(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestResultShort - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + check_time (float): Last time the API test was performed.. [optional] # noqa: E501 + probe_dc (str): Location from which the API test was performed.. [optional] # noqa: E501 + result (SyntheticsAPITestResultShortResult): [optional] # noqa: E501 + result_id (str): ID of the API test result.. [optional] # noqa: E501 + status (SyntheticsTestMonitorStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_result_short_result.py b/src/datadog_api_client/v1/model/synthetics_api_test_result_short_result.py index 9f9edfa3d2..5fd9e3c295 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_result_short_result.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_result_short_result.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsAPITestResultShortResult(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAPITestResultShortResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + passed (bool): Describes if the test run has passed or failed.. [optional] # noqa: E501 + timings (SyntheticsTiming): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_api_test_type.py b/src/datadog_api_client/v1/model/synthetics_api_test_type.py index 9cf7538d01..18025a2f2a 100644 --- a/src/datadog_api_client/v1/model/synthetics_api_test_type.py +++ b/src/datadog_api_client/v1/model/synthetics_api_test_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsAPITestType(ModelSimple): @@ -50,7 +52,23 @@ class SyntheticsAPITestType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsAPITestType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Synthetic test, `api`.. if omitted defaults to "api", must be one of ["api", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Synthetic test, `api`.. if omitted defaults to "api", must be one of ["api", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "api" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_assertion.py b/src/datadog_api_client/v1/model/synthetics_assertion.py index 11624cc656..f2ddb7e74a 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -105,6 +107,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAssertion - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _property (str): The associated assertion property.. [optional] # noqa: E501 + target (SyntheticsAssertionJSONPathTargetTarget): [optional] # noqa: E501 + operator (SyntheticsAssertionJSONPathOperator): [optional] # noqa: E501 + type (SyntheticsAssertionType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -191,28 +287,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_json_path_operator.py b/src/datadog_api_client/v1/model/synthetics_assertion_json_path_operator.py index 125745a385..434e111aed 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion_json_path_operator.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion_json_path_operator.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsAssertionJSONPathOperator(ModelSimple): @@ -50,7 +52,23 @@ class SyntheticsAssertionJSONPathOperator(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsAssertionJSONPathOperator - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Assertion operator to apply.. if omitted defaults to "validatesJSONPath", must be one of ["validatesJSONPath", ] # noqa: E501 + + Keyword Args: + value (str): Assertion operator to apply.. if omitted defaults to "validatesJSONPath", must be one of ["validatesJSONPath", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "validatesJSONPath" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target.py b/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target.py index 932a286a89..170c36ec44 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsAssertionJSONPathTarget(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, operator, type, *args, **kwargs): # noqa: E501 + """SyntheticsAssertionJSONPathTarget - a model defined in OpenAPI + + Args: + operator (SyntheticsAssertionJSONPathOperator): + type (SyntheticsAssertionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _property (str): The associated assertion property.. [optional] # noqa: E501 + target (SyntheticsAssertionJSONPathTargetTarget): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.operator = operator + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -187,3 +290,8 @@ def __init__(self, operator, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target_target.py b/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target_target.py index 713494f344..19a8a55433 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target_target.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion_json_path_target_target.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsAssertionJSONPathTargetTarget(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsAssertionJSONPathTargetTarget(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsAssertionJSONPathTargetTarget - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + json_path (str): The JSON path to assert.. [optional] # noqa: E501 + operator (str): The specific operator to use on the path.. [optional] # noqa: E501 + target_value (bool, date, datetime, dict, float, int, list, str, none_type): The path target value to compare to.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_operator.py b/src/datadog_api_client/v1/model/synthetics_assertion_operator.py index 4ecd805f1b..5cda1ebe50 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion_operator.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion_operator.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsAssertionOperator(ModelSimple): @@ -62,7 +64,23 @@ class SyntheticsAssertionOperator(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -189,3 +209,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsAssertionOperator - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Assertion operator to apply.., must be one of ["contains", "doesNotContain", "is", "isNot", "lessThan", "lessThanOrEqual", "moreThan", "moreThanOrEqual", "matches", "doesNotMatch", "validates", "isInMoreThan", "isInLessThan", ] # noqa: E501 + + Keyword Args: + value (str): Assertion operator to apply.., must be one of ["contains", "doesNotContain", "is", "isNot", "lessThan", "lessThanOrEqual", "moreThan", "moreThanOrEqual", "matches", "doesNotMatch", "validates", "isInMoreThan", "isInLessThan", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_target.py b/src/datadog_api_client/v1/model/synthetics_assertion_target.py index 044e585f11..91995e1d26 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion_target.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion_target.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsAssertionTarget(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +105,7 @@ def openapi_types(): int, list, str, + none_type, ), # noqa: E501 } @@ -102,6 +122,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, operator, type, *args, **kwargs): # noqa: E501 + """SyntheticsAssertionTarget - a model defined in OpenAPI + + Args: + operator (SyntheticsAssertionOperator): + type (SyntheticsAssertionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _property (str): The associated assertion property.. [optional] # noqa: E501 + target (bool, date, datetime, dict, float, int, list, str, none_type): Value used by the operator.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.operator = operator + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -153,7 +257,7 @@ def __init__(self, operator, type, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) _property (str): The associated assertion property.. [optional] # noqa: E501 - target (bool, date, datetime, dict, float, int, list, str): Value used by the operator.. [optional] # noqa: E501 + target (bool, date, datetime, dict, float, int, list, str, none_type): Value used by the operator.. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -192,3 +296,8 @@ def __init__(self, operator, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_assertion_type.py b/src/datadog_api_client/v1/model/synthetics_assertion_type.py index 8fc45e7d53..72ee07915c 100644 --- a/src/datadog_api_client/v1/model/synthetics_assertion_type.py +++ b/src/datadog_api_client/v1/model/synthetics_assertion_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsAssertionType(ModelSimple): @@ -63,7 +65,23 @@ class SyntheticsAssertionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +105,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -190,3 +210,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsAssertionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the assertion.., must be one of ["body", "header", "statusCode", "certificate", "responseTime", "property", "recordEvery", "recordSome", "tlsVersion", "minTlsVersion", "latency", "packetLossPercentage", "packetsReceived", "networkHop", ] # noqa: E501 + + Keyword Args: + value (str): Type of the assertion.., must be one of ["body", "header", "statusCode", "certificate", "responseTime", "property", "recordEvery", "recordSome", "tlsVersion", "minTlsVersion", "latency", "packetLossPercentage", "packetsReceived", "networkHop", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_basic_auth.py b/src/datadog_api_client/v1/model/synthetics_basic_auth.py index e865b46747..f6583d9cf2 100644 --- a/src/datadog_api_client/v1/model/synthetics_basic_auth.py +++ b/src/datadog_api_client/v1/model/synthetics_basic_auth.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsBasicAuth(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsBasicAuth(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, password, username, *args, **kwargs): # noqa: E501 + """SyntheticsBasicAuth - a model defined in OpenAPI + + Args: + password (str): Password to use for the basic authentication. + username (str): Username to use for the basic authentication. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.password = password + self.username = username + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, password, username, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_error.py b/src/datadog_api_client/v1/model/synthetics_browser_error.py index cc494fbeae..a2acce696f 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_error.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_error.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsBrowserError(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, description, name, type, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserError - a model defined in OpenAPI + + Args: + description (str): Description of the error. + name (str): Name of the error. + type (SyntheticsBrowserErrorType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + status (int): Status Code of the error.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.description = description + self.name = name + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +286,8 @@ def __init__(self, description, name, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_error_type.py b/src/datadog_api_client/v1/model/synthetics_browser_error_type.py index 76148febec..c836f3421b 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_error_type.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_error_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsBrowserErrorType(ModelSimple): @@ -51,7 +53,23 @@ class SyntheticsBrowserErrorType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsBrowserErrorType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Error type returned by a browser test.., must be one of ["network", "js", ] # noqa: E501 + + Keyword Args: + value (str): Error type returned by a browser test.., must be one of ["network", "js", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test.py b/src/datadog_api_client/v1/model/synthetics_browser_test.py index e221aae957..b0b5d16d2d 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SyntheticsBrowserTest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTest - a model defined in OpenAPI + + Args: + message (str): Notification message associated with the test. Message can either be text or an empty string. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config (SyntheticsBrowserTestConfig): [optional] # noqa: E501 + locations ([str]): Array of locations used to run the test.. [optional] # noqa: E501 + monitor_id (int): The associated monitor ID.. [optional] # noqa: E501 + name (str): Name of the test.. [optional] # noqa: E501 + options (SyntheticsTestOptions): [optional] # noqa: E501 + public_id (str): The public ID of the test.. [optional] # noqa: E501 + status (SyntheticsTestPauseStatus): [optional] # noqa: E501 + steps ([SyntheticsStep]): The steps of the test.. [optional] # noqa: E501 + tags ([str]): Array of tags attached to the test.. [optional] # noqa: E501 + type (SyntheticsBrowserTestType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message = message + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -209,3 +318,8 @@ def __init__(self, message, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_config.py b/src/datadog_api_client/v1/model/synthetics_browser_test_config.py index f0b3e1c359..a10f8971cd 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_config.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SyntheticsBrowserTestConfig(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, request, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestConfig - a model defined in OpenAPI + + Args: + request (SyntheticsTestRequest): + + Keyword Args: + assertions ([SyntheticsAssertion]): Array of assertions used for the test.. defaults to [] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + set_cookie (str): Cookies to be used for the request, using the [Set-Cookie](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie) syntax.. [optional] # noqa: E501 + variables ([SyntheticsBrowserVariable]): Array of variables used for the test steps.. [optional] # noqa: E501 + """ + + assertions = kwargs.get("assertions", []) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.assertions = assertions + self.request = request + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +290,8 @@ def __init__(self, request, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_result_data.py b/src/datadog_api_client/v1/model/synthetics_browser_test_result_data.py index 0df78661c5..25fa597cb1 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_result_data.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_result_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsBrowserTestResultData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -107,6 +126,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestResultData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + browser_type (str): Type of browser device used for the browser test.. [optional] # noqa: E501 + browser_version (str): Browser version used for the browser test.. [optional] # noqa: E501 + device (SyntheticsDevice): [optional] # noqa: E501 + duration (float): Global duration in second of the browser test.. [optional] # noqa: E501 + error (str): Error returned for the browser test.. [optional] # noqa: E501 + passed (bool): Whether or not the browser test was conducted.. [optional] # noqa: E501 + received_email_count (int): The amount of email received during the browser test.. [optional] # noqa: E501 + start_url (str): Starting URL for the browser test.. [optional] # noqa: E501 + step_details ([SyntheticsStepDetail]): Array containing the different browser test steps.. [optional] # noqa: E501 + thumbnails_bucket_key (bool): Whether or not a thumbnail is associated with the browser test.. [optional] # noqa: E501 + time_to_interactive (float): Time in second to wait before the browser test starts after reaching the start URL.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -200,3 +306,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_result_full.py b/src/datadog_api_client/v1/model/synthetics_browser_test_result_full.py index 7e928986a8..3984449c16 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_result_full.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_result_full.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsBrowserTestResultFull(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestResultFull - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + check (SyntheticsBrowserTestResultFullCheck): [optional] # noqa: E501 + check_time (float): When the browser test was conducted.. [optional] # noqa: E501 + check_version (int): Version of the browser test used.. [optional] # noqa: E501 + probe_dc (str): Location from which the browser test was performed.. [optional] # noqa: E501 + result (SyntheticsBrowserTestResultData): [optional] # noqa: E501 + result_id (str): ID of the browser test result.. [optional] # noqa: E501 + status (SyntheticsTestMonitorStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +294,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_result_full_check.py b/src/datadog_api_client/v1/model/synthetics_browser_test_result_full_check.py index 3dd5bac669..66625cfed5 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_result_full_check.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_result_full_check.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsBrowserTestResultFullCheck(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, config, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestResultFullCheck - a model defined in OpenAPI + + Args: + config (SyntheticsTestConfig): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.config = config + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, config, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_result_short.py b/src/datadog_api_client/v1/model/synthetics_browser_test_result_short.py index 2f46afa25f..6ba775eb64 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_result_short.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_result_short.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SyntheticsBrowserTestResultShort(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestResultShort - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + check_time (float): Last time the browser test was performed.. [optional] # noqa: E501 + probe_dc (str): Location from which the Browser test was performed.. [optional] # noqa: E501 + result (SyntheticsBrowserTestResultShortResult): [optional] # noqa: E501 + result_id (str): ID of the browser test result.. [optional] # noqa: E501 + status (SyntheticsTestMonitorStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_result_short_result.py b/src/datadog_api_client/v1/model/synthetics_browser_test_result_short_result.py index a43200f346..b6ed5966d2 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_result_short_result.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_result_short_result.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsBrowserTestResultShortResult(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserTestResultShortResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + device (SyntheticsDevice): [optional] # noqa: E501 + duration (float): Length in second of the browser test run.. [optional] # noqa: E501 + error_count (int): Amount of errors collected for a single browser test run.. [optional] # noqa: E501 + step_count_completed (int): Amount of browser test steps completed before failing.. [optional] # noqa: E501 + step_count_total (int): Total amount of browser test steps.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_test_type.py b/src/datadog_api_client/v1/model/synthetics_browser_test_type.py index 8a4f9afcc4..bc9e8df7ac 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_test_type.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_test_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsBrowserTestType(ModelSimple): @@ -50,7 +52,23 @@ class SyntheticsBrowserTestType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsBrowserTestType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Synthetic test, `browser`.. if omitted defaults to "browser", must be one of ["browser", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Synthetic test, `browser`.. if omitted defaults to "browser", must be one of ["browser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "browser" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_browser_variable.py b/src/datadog_api_client/v1/model/synthetics_browser_variable.py index 207ad89590..34871a8993 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_variable.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_variable.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsBrowserVariable(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, type, *args, **kwargs): # noqa: E501 + """SyntheticsBrowserVariable - a model defined in OpenAPI + + Args: + name (str): Name of the variable. + type (SyntheticsBrowserVariableType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + example (str): Example for the variable.. [optional] # noqa: E501 + id (str): ID for the variable.. [optional] # noqa: E501 + pattern (str): Pattern of the variable.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +288,8 @@ def __init__(self, name, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_browser_variable_type.py b/src/datadog_api_client/v1/model/synthetics_browser_variable_type.py index 27f6929453..d2480694ff 100644 --- a/src/datadog_api_client/v1/model/synthetics_browser_variable_type.py +++ b/src/datadog_api_client/v1/model/synthetics_browser_variable_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsBrowserVariableType(ModelSimple): @@ -54,7 +56,23 @@ class SyntheticsBrowserVariableType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsBrowserVariableType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of browser test variable.., must be one of ["element", "email", "global", "javascript", "text", ] # noqa: E501 + + Keyword Args: + value (str): Type of browser test variable.., must be one of ["element", "email", "global", "javascript", "text", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_check_type.py b/src/datadog_api_client/v1/model/synthetics_check_type.py index 72e0c10658..55ffaf1052 100644 --- a/src/datadog_api_client/v1/model/synthetics_check_type.py +++ b/src/datadog_api_client/v1/model/synthetics_check_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsCheckType(ModelSimple): @@ -63,7 +65,23 @@ class SyntheticsCheckType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +105,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -190,3 +210,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsCheckType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of assertion to apply in an API test.., must be one of ["equals", "notEquals", "contains", "notContains", "startsWith", "notStartsWith", "greater", "lower", "greaterEquals", "lowerEquals", "matchRegex", "between", "isEmpty", "notIsEmpty", ] # noqa: E501 + + Keyword Args: + value (str): Type of assertion to apply in an API test.., must be one of ["equals", "notEquals", "contains", "notContains", "startsWith", "notStartsWith", "greater", "lower", "greaterEquals", "lowerEquals", "matchRegex", "between", "isEmpty", "notIsEmpty", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_ci_test.py b/src/datadog_api_client/v1/model/synthetics_ci_test.py index e0c57d5468..0b8bad0a26 100644 --- a/src/datadog_api_client/v1/model/synthetics_ci_test.py +++ b/src/datadog_api_client/v1/model/synthetics_ci_test.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SyntheticsCITest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -119,6 +138,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, public_id, *args, **kwargs): # noqa: E501 + """SyntheticsCITest - a model defined in OpenAPI + + Args: + public_id (str): The public ID of the Synthetics test to trigger. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + allow_insecure_certificates (bool): Disable certificate checks in API tests.. [optional] # noqa: E501 + basic_auth (SyntheticsBasicAuth): [optional] # noqa: E501 + body (str): Body to include in the test.. [optional] # noqa: E501 + body_type (str): Type of the data sent in a synthetics API test.. [optional] # noqa: E501 + cookies (str): Cookies for the request.. [optional] # noqa: E501 + device_ids ([SyntheticsDeviceID]): For browser test, array with the different device IDs used to run the test.. [optional] # noqa: E501 + follow_redirects (bool): For API HTTP test, whether or not the test should follow redirects.. [optional] # noqa: E501 + headers (SyntheticsTestHeaders): [optional] # noqa: E501 + locations ([str]): Array of locations used to run the test.. [optional] # noqa: E501 + metadata (SyntheticsCITestMetadata): [optional] # noqa: E501 + retry (SyntheticsTestOptionsRetry): [optional] # noqa: E501 + start_url (str): Starting URL for the browser test.. [optional] # noqa: E501 + variables ({str: (str,)}): Variables to replace in the test.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.public_id = public_id + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -218,3 +330,8 @@ def __init__(self, public_id, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ci_test_body.py b/src/datadog_api_client/v1/model/synthetics_ci_test_body.py index 84ddf28592..795219bae7 100644 --- a/src/datadog_api_client/v1/model/synthetics_ci_test_body.py +++ b/src/datadog_api_client/v1/model/synthetics_ci_test_body.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsCITestBody(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsCITestBody - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tests ([SyntheticsCITest]): Individual synthetics test.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ci_test_metadata.py b/src/datadog_api_client/v1/model/synthetics_ci_test_metadata.py index ac07c406ea..4e1d7160a0 100644 --- a/src/datadog_api_client/v1/model/synthetics_ci_test_metadata.py +++ b/src/datadog_api_client/v1/model/synthetics_ci_test_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsCITestMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsCITestMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + ci (SyntheticsCITestMetadataCi): [optional] # noqa: E501 + git (SyntheticsCITestMetadataGit): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_ci.py b/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_ci.py index 4587a081aa..43fcfa7aee 100644 --- a/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_ci.py +++ b/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_ci.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsCITestMetadataCi(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsCITestMetadataCi(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsCITestMetadataCi - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + pipeline (str): Name of the pipeline.. [optional] # noqa: E501 + provider (str): Name of the CI provider.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_git.py b/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_git.py index f328ef44b6..52b063f5aa 100644 --- a/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_git.py +++ b/src/datadog_api_client/v1/model/synthetics_ci_test_metadata_git.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsCITestMetadataGit(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsCITestMetadataGit(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsCITestMetadataGit - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + branch (str): Branch name.. [optional] # noqa: E501 + commit_sha (str): Commit SHA.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_config_variable.py b/src/datadog_api_client/v1/model/synthetics_config_variable.py index 8f6eaadafc..fc3c6cb995 100644 --- a/src/datadog_api_client/v1/model/synthetics_config_variable.py +++ b/src/datadog_api_client/v1/model/synthetics_config_variable.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsConfigVariable(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, type, *args, **kwargs): # noqa: E501 + """SyntheticsConfigVariable - a model defined in OpenAPI + + Args: + name (str): Name of the variable. + type (SyntheticsConfigVariableType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + example (str): Example for the variable.. [optional] # noqa: E501 + id (str): ID of the variable for global variables.. [optional] # noqa: E501 + pattern (str): Pattern of the variable.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +288,8 @@ def __init__(self, name, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_config_variable_type.py b/src/datadog_api_client/v1/model/synthetics_config_variable_type.py index cc94c9b6fa..0f0e2e50a1 100644 --- a/src/datadog_api_client/v1/model/synthetics_config_variable_type.py +++ b/src/datadog_api_client/v1/model/synthetics_config_variable_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsConfigVariableType(ModelSimple): @@ -51,7 +53,23 @@ class SyntheticsConfigVariableType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsConfigVariableType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the configuration variable.., must be one of ["global", "text", ] # noqa: E501 + + Keyword Args: + value (str): Type of the configuration variable.., must be one of ["global", "text", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_core_web_vitals.py b/src/datadog_api_client/v1/model/synthetics_core_web_vitals.py index 3a1f61f3e9..dc1e22d74c 100644 --- a/src/datadog_api_client/v1/model/synthetics_core_web_vitals.py +++ b/src/datadog_api_client/v1/model/synthetics_core_web_vitals.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsCoreWebVitals(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsCoreWebVitals(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsCoreWebVitals - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cls (int): Cumulative Layout Shift.. [optional] # noqa: E501 + lcp (int): Largest Contentful Paint in milliseconds.. [optional] # noqa: E501 + url (str): URL attached to the metrics.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_delete_tests_payload.py b/src/datadog_api_client/v1/model/synthetics_delete_tests_payload.py index ef5dba59cd..4af2d5a83c 100644 --- a/src/datadog_api_client/v1/model/synthetics_delete_tests_payload.py +++ b/src/datadog_api_client/v1/model/synthetics_delete_tests_payload.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsDeleteTestsPayload(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsDeleteTestsPayload(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsDeleteTestsPayload - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + public_ids ([str]): An array of Synthetic test IDs you want to delete.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_delete_tests_response.py b/src/datadog_api_client/v1/model/synthetics_delete_tests_response.py index 563c107062..01401d7dba 100644 --- a/src/datadog_api_client/v1/model/synthetics_delete_tests_response.py +++ b/src/datadog_api_client/v1/model/synthetics_delete_tests_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsDeleteTestsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsDeleteTestsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted_tests ([SyntheticsDeletedTest]): Array of objects containing a deleted Synthetic test ID with the associated deletion timestamp.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_deleted_test.py b/src/datadog_api_client/v1/model/synthetics_deleted_test.py index a35fb0981d..183ef04adb 100644 --- a/src/datadog_api_client/v1/model/synthetics_deleted_test.py +++ b/src/datadog_api_client/v1/model/synthetics_deleted_test.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsDeletedTest(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsDeletedTest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsDeletedTest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted_at (datetime): Deletion timestamp of the Synthetic test ID.. [optional] # noqa: E501 + public_id (str): The Synthetic test ID deleted.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_device.py b/src/datadog_api_client/v1/model/synthetics_device.py index 3f72c67280..053b7e3183 100644 --- a/src/datadog_api_client/v1/model/synthetics_device.py +++ b/src/datadog_api_client/v1/model/synthetics_device.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsDevice(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, height, id, name, width, *args, **kwargs): # noqa: E501 + """SyntheticsDevice - a model defined in OpenAPI + + Args: + height (int): Screen height of the device. + id (SyntheticsDeviceID): + name (str): The device name. + width (int): Screen width of the device. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_mobile (bool): Whether or not the device is a mobile.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.height = height + self.id = id + self.name = name + self.width = width + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +292,8 @@ def __init__(self, height, id, name, width, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_device_id.py b/src/datadog_api_client/v1/model/synthetics_device_id.py index 1cc358309c..a032f551f6 100644 --- a/src/datadog_api_client/v1/model/synthetics_device_id.py +++ b/src/datadog_api_client/v1/model/synthetics_device_id.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsDeviceID(ModelSimple): @@ -58,7 +60,23 @@ class SyntheticsDeviceID(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -185,3 +205,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsDeviceID - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The device ID.., must be one of ["laptop_large", "tablet", "mobile_small", "chrome.laptop_large", "chrome.tablet", "chrome.mobile_small", "firefox.laptop_large", "firefox.tablet", "firefox.mobile_small", ] # noqa: E501 + + Keyword Args: + value (str): The device ID.., must be one of ["laptop_large", "tablet", "mobile_small", "chrome.laptop_large", "chrome.tablet", "chrome.mobile_small", "firefox.laptop_large", "firefox.tablet", "firefox.mobile_small", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_error_code.py b/src/datadog_api_client/v1/model/synthetics_error_code.py index 38025a1d81..d8c00ef5a2 100644 --- a/src/datadog_api_client/v1/model/synthetics_error_code.py +++ b/src/datadog_api_client/v1/model/synthetics_error_code.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsErrorCode(ModelSimple): @@ -56,7 +58,23 @@ class SyntheticsErrorCode(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -183,3 +203,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsErrorCode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Error code that can be returned by a Synthetic test.., must be one of ["NO_ERROR", "UNKNOWN", "DNS", "SSL", "TIMEOUT", "DENIED", "INCORRECT_ASSERTION", ] # noqa: E501 + + Keyword Args: + value (str): Error code that can be returned by a Synthetic test.., must be one of ["NO_ERROR", "UNKNOWN", "DNS", "SSL", "TIMEOUT", "DENIED", "INCORRECT_ASSERTION", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_get_api_test_latest_results_response.py b/src/datadog_api_client/v1/model/synthetics_get_api_test_latest_results_response.py index 639b902eb0..7a4e2d3812 100644 --- a/src/datadog_api_client/v1/model/synthetics_get_api_test_latest_results_response.py +++ b/src/datadog_api_client/v1/model/synthetics_get_api_test_latest_results_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsGetAPITestLatestResultsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsGetAPITestLatestResultsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + last_timestamp_fetched (int): Timestamp of the latest API test run.. [optional] # noqa: E501 + results ([SyntheticsAPITestResultShort]): Result of the latest API test run.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_get_browser_test_latest_results_response.py b/src/datadog_api_client/v1/model/synthetics_get_browser_test_latest_results_response.py index 541893f761..bff612c74e 100644 --- a/src/datadog_api_client/v1/model/synthetics_get_browser_test_latest_results_response.py +++ b/src/datadog_api_client/v1/model/synthetics_get_browser_test_latest_results_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsGetBrowserTestLatestResultsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsGetBrowserTestLatestResultsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + last_timestamp_fetched (int): Timestamp of the latest browser test run.. [optional] # noqa: E501 + results ([SyntheticsBrowserTestResultShort]): Result of the latest browser test run.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_global_variable.py b/src/datadog_api_client/v1/model/synthetics_global_variable.py index cae0c4510e..bc8cf234c8 100644 --- a/src/datadog_api_client/v1/model/synthetics_global_variable.py +++ b/src/datadog_api_client/v1/model/synthetics_global_variable.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SyntheticsGlobalVariable(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, description, name, tags, value, *args, **kwargs): # noqa: E501 + """SyntheticsGlobalVariable - a model defined in OpenAPI + + Args: + description (str): Description of the global variable. + name (str): Name of the global variable. + tags ([str]): Tags of the global variable. + value (SyntheticsGlobalVariableValue): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): Unique identifier of the global variable.. [optional] # noqa: E501 + parse_test_options (SyntheticsGlobalVariableParseTestOptions): [optional] # noqa: E501 + parse_test_public_id (str): A Synthetic test ID to use as a test to generate the variable value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.description = description + self.name = name + self.tags = tags + self.value = value + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -196,3 +304,8 @@ def __init__(self, description, name, tags, value, *args, **kwargs): # noqa: E5 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options.py b/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options.py index 777f2a53fc..f9673a6180 100644 --- a/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options.py +++ b/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SyntheticsGlobalVariableParseTestOptions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, parser, type, *args, **kwargs): # noqa: E501 + """SyntheticsGlobalVariableParseTestOptions - a model defined in OpenAPI + + Args: + parser (SyntheticsVariableParser): + type (SyntheticsGlobalVariableParseTestOptionsType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + field (str): When type is `http_header`, name of the header to use to extract the value.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.parser = parser + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, parser, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options_type.py b/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options_type.py index fb89b6a2b9..3034a8b191 100644 --- a/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options_type.py +++ b/src/datadog_api_client/v1/model/synthetics_global_variable_parse_test_options_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsGlobalVariableParseTestOptionsType(ModelSimple): @@ -51,7 +53,23 @@ class SyntheticsGlobalVariableParseTestOptionsType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsGlobalVariableParseTestOptionsType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Property of the Synthetics Test Response to use for a Synthetics global variable.., must be one of ["http_body", "http_header", ] # noqa: E501 + + Keyword Args: + value (str): Property of the Synthetics Test Response to use for a Synthetics global variable.., must be one of ["http_body", "http_header", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_global_variable_parser_type.py b/src/datadog_api_client/v1/model/synthetics_global_variable_parser_type.py index 2b652a2112..a8ccfca0ea 100644 --- a/src/datadog_api_client/v1/model/synthetics_global_variable_parser_type.py +++ b/src/datadog_api_client/v1/model/synthetics_global_variable_parser_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsGlobalVariableParserType(ModelSimple): @@ -52,7 +54,23 @@ class SyntheticsGlobalVariableParserType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsGlobalVariableParserType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of parser for a Synthetics global variable from a synthetics test.., must be one of ["raw", "json_path", "regex", ] # noqa: E501 + + Keyword Args: + value (str): Type of parser for a Synthetics global variable from a synthetics test.., must be one of ["raw", "json_path", "regex", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_global_variable_value.py b/src/datadog_api_client/v1/model/synthetics_global_variable_value.py index 5e8cb67779..7dbe36d377 100644 --- a/src/datadog_api_client/v1/model/synthetics_global_variable_value.py +++ b/src/datadog_api_client/v1/model/synthetics_global_variable_value.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsGlobalVariableValue(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsGlobalVariableValue(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsGlobalVariableValue - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + secure (bool): Determines if the variable is secure.. [optional] # noqa: E501 + value (str): Value of the global variable. When reading a global variable, the value will not be present if the variable is secure.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_list_global_variables_response.py b/src/datadog_api_client/v1/model/synthetics_list_global_variables_response.py index e092de2821..7d0872234e 100644 --- a/src/datadog_api_client/v1/model/synthetics_list_global_variables_response.py +++ b/src/datadog_api_client/v1/model/synthetics_list_global_variables_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsListGlobalVariablesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsListGlobalVariablesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + variables ([SyntheticsGlobalVariable]): Array of Synthetic global variables.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_list_tests_response.py b/src/datadog_api_client/v1/model/synthetics_list_tests_response.py index fb1d7b6f55..5fbc6908b8 100644 --- a/src/datadog_api_client/v1/model/synthetics_list_tests_response.py +++ b/src/datadog_api_client/v1/model/synthetics_list_tests_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsListTestsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsListTestsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tests ([SyntheticsTestDetails]): Array of Synthetic tests configuration.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_location.py b/src/datadog_api_client/v1/model/synthetics_location.py index da36f74d80..fd3339b2ce 100644 --- a/src/datadog_api_client/v1/model/synthetics_location.py +++ b/src/datadog_api_client/v1/model/synthetics_location.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsLocation(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsLocation(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsLocation - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): Unique identifier of the location.. [optional] # noqa: E501 + name (str): Name of the location.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_locations.py b/src/datadog_api_client/v1/model/synthetics_locations.py index 261eb5632e..3895e5fc7e 100644 --- a/src/datadog_api_client/v1/model/synthetics_locations.py +++ b/src/datadog_api_client/v1/model/synthetics_locations.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsLocations(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsLocations - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + locations ([SyntheticsLocation]): List of Synthetics locations.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_parsing_options.py b/src/datadog_api_client/v1/model/synthetics_parsing_options.py index bcf2d8fcbf..f381c16643 100644 --- a/src/datadog_api_client/v1/model/synthetics_parsing_options.py +++ b/src/datadog_api_client/v1/model/synthetics_parsing_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SyntheticsParsingOptions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsParsingOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + field (str): When type is `http_header`, name of the header to use to extract the value.. [optional] # noqa: E501 + name (str): Name of the variable to extract.. [optional] # noqa: E501 + parser (SyntheticsVariableParser): [optional] # noqa: E501 + type (SyntheticsGlobalVariableParseTestOptionsType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_playing_tab.py b/src/datadog_api_client/v1/model/synthetics_playing_tab.py index 45945bf53f..341f91a9f7 100644 --- a/src/datadog_api_client/v1/model/synthetics_playing_tab.py +++ b/src/datadog_api_client/v1/model/synthetics_playing_tab.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsPlayingTab(ModelSimple): @@ -54,7 +56,23 @@ class SyntheticsPlayingTab(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsPlayingTab - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): Navigate between different tabs for your browser test.., must be one of [-1, 0, 1, 2, 3, ] # noqa: E501 + + Keyword Args: + value (int): Navigate between different tabs for your browser test.., must be one of [-1, 0, 1, 2, 3, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_private_location.py b/src/datadog_api_client/v1/model/synthetics_private_location.py index 5163f1ff26..35e4e45a4a 100644 --- a/src/datadog_api_client/v1/model/synthetics_private_location.py +++ b/src/datadog_api_client/v1/model/synthetics_private_location.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsPrivateLocation(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, description, name, tags, *args, **kwargs): # noqa: E501 + """SyntheticsPrivateLocation - a model defined in OpenAPI + + Args: + description (str): Description of the private location. + name (str): Name of the private location. + tags ([str]): Array of tags attached to the private location. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): Unique identifier of the private location.. [optional] # noqa: E501 + secrets (SyntheticsPrivateLocationSecrets): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.description = description + self.name = name + self.tags = tags + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +290,8 @@ def __init__(self, description, name, tags, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_private_location_creation_response.py b/src/datadog_api_client/v1/model/synthetics_private_location_creation_response.py index 247ebad03d..00ebd22b20 100644 --- a/src/datadog_api_client/v1/model/synthetics_private_location_creation_response.py +++ b/src/datadog_api_client/v1/model/synthetics_private_location_creation_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsPrivateLocationCreationResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsPrivateLocationCreationResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Configuration skeleton for the private location. See installation instructions of the private location on how to use this configuration.. [optional] # noqa: E501 + private_location (SyntheticsPrivateLocation): [optional] # noqa: E501 + result_encryption (SyntheticsPrivateLocationCreationResponseResultEncryption): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +278,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_private_location_creation_response_result_encryption.py b/src/datadog_api_client/v1/model/synthetics_private_location_creation_response_result_encryption.py index 50cd1e0989..7091140700 100644 --- a/src/datadog_api_client/v1/model/synthetics_private_location_creation_response_result_encryption.py +++ b/src/datadog_api_client/v1/model/synthetics_private_location_creation_response_result_encryption.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsPrivateLocationCreationResponseResultEncryption(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsPrivateLocationCreationResponseResultEncryption(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsPrivateLocationCreationResponseResultEncryption - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): Fingerprint for the encryption key.. [optional] # noqa: E501 + key (str): Public key for result encryption.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_private_location_secrets.py b/src/datadog_api_client/v1/model/synthetics_private_location_secrets.py index c05d93105d..ab17d0bc5d 100644 --- a/src/datadog_api_client/v1/model/synthetics_private_location_secrets.py +++ b/src/datadog_api_client/v1/model/synthetics_private_location_secrets.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsPrivateLocationSecrets(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsPrivateLocationSecrets - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + authentication (SyntheticsPrivateLocationSecretsAuthentication): [optional] # noqa: E501 + config_decryption (SyntheticsPrivateLocationSecretsConfigDecryption): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_private_location_secrets_authentication.py b/src/datadog_api_client/v1/model/synthetics_private_location_secrets_authentication.py index 8a3035d4b2..f8a23b4e69 100644 --- a/src/datadog_api_client/v1/model/synthetics_private_location_secrets_authentication.py +++ b/src/datadog_api_client/v1/model/synthetics_private_location_secrets_authentication.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsPrivateLocationSecretsAuthentication(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsPrivateLocationSecretsAuthentication(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsPrivateLocationSecretsAuthentication - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): Access key for the private location.. [optional] # noqa: E501 + key (str): Secret access key for the private location.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_private_location_secrets_config_decryption.py b/src/datadog_api_client/v1/model/synthetics_private_location_secrets_config_decryption.py index 816bd87774..6d04c0dd0e 100644 --- a/src/datadog_api_client/v1/model/synthetics_private_location_secrets_config_decryption.py +++ b/src/datadog_api_client/v1/model/synthetics_private_location_secrets_config_decryption.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsPrivateLocationSecretsConfigDecryption(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsPrivateLocationSecretsConfigDecryption(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsPrivateLocationSecretsConfigDecryption - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + key (str): Private key for the private location.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ssl_certificate.py b/src/datadog_api_client/v1/model/synthetics_ssl_certificate.py index 0d1187a527..ec66de036f 100644 --- a/src/datadog_api_client/v1/model/synthetics_ssl_certificate.py +++ b/src/datadog_api_client/v1/model/synthetics_ssl_certificate.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsSSLCertificate(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsSSLCertificate - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cipher (str): Cipher used for the connection.. [optional] # noqa: E501 + exponent (float): Exponent associated to the certificate.. [optional] # noqa: E501 + ext_key_usage ([str]): Array of extensions and details used for the certificate.. [optional] # noqa: E501 + fingerprint (str): MD5 digest of the DER-encoded Certificate information.. [optional] # noqa: E501 + fingerprint256 (str): SHA-1 digest of the DER-encoded Certificate information.. [optional] # noqa: E501 + issuer (SyntheticsSSLCertificateIssuer): [optional] # noqa: E501 + modulus (str): Modulus associated to the SSL certificate private key.. [optional] # noqa: E501 + protocol (str): TLS protocol used for the test.. [optional] # noqa: E501 + serial_number (str): Serial Number assigned by Symantec to the SSL certificate.. [optional] # noqa: E501 + subject (SyntheticsSSLCertificateSubject): [optional] # noqa: E501 + valid_from (datetime): Date from which the SSL certificate is valid.. [optional] # noqa: E501 + valid_to (datetime): Date until which the SSL certificate is valid.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +310,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ssl_certificate_issuer.py b/src/datadog_api_client/v1/model/synthetics_ssl_certificate_issuer.py index b29edff51a..bea2e9f482 100644 --- a/src/datadog_api_client/v1/model/synthetics_ssl_certificate_issuer.py +++ b/src/datadog_api_client/v1/model/synthetics_ssl_certificate_issuer.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsSSLCertificateIssuer(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsSSLCertificateIssuer(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsSSLCertificateIssuer - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + c (str): Country Name that issued the certificate.. [optional] # noqa: E501 + cn (str): Common Name that issued certificate.. [optional] # noqa: E501 + l (str): Locality that issued the certificate.. [optional] # noqa: E501 + o (str): Organization that issued the certificate.. [optional] # noqa: E501 + ou (str): Organizational Unit that issued the certificate.. [optional] # noqa: E501 + st (str): State Or Province Name that issued the certificate.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_ssl_certificate_subject.py b/src/datadog_api_client/v1/model/synthetics_ssl_certificate_subject.py index 1532214048..547bf16190 100644 --- a/src/datadog_api_client/v1/model/synthetics_ssl_certificate_subject.py +++ b/src/datadog_api_client/v1/model/synthetics_ssl_certificate_subject.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsSSLCertificateSubject(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsSSLCertificateSubject(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsSSLCertificateSubject - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + c (str): Country Name associated with the certificate.. [optional] # noqa: E501 + cn (str): Common Name that associated with the certificate.. [optional] # noqa: E501 + l (str): Locality associated with the certificate.. [optional] # noqa: E501 + o (str): Organization associated with the certificate.. [optional] # noqa: E501 + ou (str): Organizational Unit associated with the certificate.. [optional] # noqa: E501 + st (str): State Or Province Name associated with the certificate.. [optional] # noqa: E501 + alt_name (str): Subject Alternative Name associated with the certificate.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_step.py b/src/datadog_api_client/v1/model/synthetics_step.py index db71fd08fa..43208d4e41 100644 --- a/src/datadog_api_client/v1/model/synthetics_step.py +++ b/src/datadog_api_client/v1/model/synthetics_step.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsStep(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsStep - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + allow_failure (bool): A boolean set to allow this step to fail.. [optional] # noqa: E501 + name (str): The name of the step.. [optional] # noqa: E501 + params ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The parameters of the step.. [optional] # noqa: E501 + timeout (int): The time before declaring a step failed.. [optional] # noqa: E501 + type (SyntheticsStepType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_step_detail.py b/src/datadog_api_client/v1/model/synthetics_step_detail.py index e147d164b9..13b3f414c0 100644 --- a/src/datadog_api_client/v1/model/synthetics_step_detail.py +++ b/src/datadog_api_client/v1/model/synthetics_step_detail.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class SyntheticsStepDetail(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -127,6 +146,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsStepDetail - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + browser_errors ([SyntheticsBrowserError]): Array of errors collected for a browser test.. [optional] # noqa: E501 + check_type (SyntheticsCheckType): [optional] # noqa: E501 + description (str): Description of the test.. [optional] # noqa: E501 + duration (float): Total duration in millisecond of the test.. [optional] # noqa: E501 + error (str): Error returned by the test.. [optional] # noqa: E501 + playing_tab (SyntheticsPlayingTab): [optional] # noqa: E501 + screenshot_bucket_key (bool): Whether or not screenshots where collected by the test.. [optional] # noqa: E501 + skipped (bool): Whether or not to skip this step.. [optional] # noqa: E501 + snapshot_bucket_key (bool): Whether or not snapshots where collected by the test.. [optional] # noqa: E501 + step_id (int): The step ID.. [optional] # noqa: E501 + sub_test_step_details ([SyntheticsStepDetail]): If this steps include a sub-test. [Subtests documentation](https://docs.datadoghq.com/synthetics/browser_tests/advanced_options/#subtests).. [optional] # noqa: E501 + time_to_interactive (float): Time before starting the step.. [optional] # noqa: E501 + type (SyntheticsStepType): [optional] # noqa: E501 + url (str): URL to perform the step against.. [optional] # noqa: E501 + value ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Value for the step.. [optional] # noqa: E501 + vitals_metrics ([SyntheticsCoreWebVitals]): Array of Core Web Vitals metrics for the step.. [optional] # noqa: E501 + warnings ([SyntheticsStepDetailWarning]): Warning collected that didn't failed the step.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -226,3 +338,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_step_detail_warning.py b/src/datadog_api_client/v1/model/synthetics_step_detail_warning.py index e017c42dad..c297d57bac 100644 --- a/src/datadog_api_client/v1/model/synthetics_step_detail_warning.py +++ b/src/datadog_api_client/v1/model/synthetics_step_detail_warning.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsStepDetailWarning(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, message, type, *args, **kwargs): # noqa: E501 + """SyntheticsStepDetailWarning - a model defined in OpenAPI + + Args: + message (str): Message for the warning. + type (SyntheticsWarningType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.message = message + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, message, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_step_type.py b/src/datadog_api_client/v1/model/synthetics_step_type.py index 56ebca4739..a3250d7ebc 100644 --- a/src/datadog_api_client/v1/model/synthetics_step_type.py +++ b/src/datadog_api_client/v1/model/synthetics_step_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsStepType(ModelSimple): @@ -74,7 +76,23 @@ class SyntheticsStepType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,6 +116,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -201,3 +221,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsStepType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Step type used in your Synthetic test.., must be one of ["assertCurrentUrl", "assertElementAttribute", "assertElementContent", "assertElementPresent", "assertEmail", "assertFileDownload", "assertFromJavascript", "assertPageContains", "assertPageLacks", "click", "extractFromJavascript", "extractVariable", "goToEmailLink", "goToUrl", "goToUrlAndMeasureTti", "hover", "playSubTest", "pressKey", "refresh", "runApiTest", "scroll", "selectOption", "typeText", "uploadFiles", "wait", ] # noqa: E501 + + Keyword Args: + value (str): Step type used in your Synthetic test.., must be one of ["assertCurrentUrl", "assertElementAttribute", "assertElementContent", "assertElementPresent", "assertEmail", "assertFileDownload", "assertFromJavascript", "assertPageContains", "assertPageLacks", "click", "extractFromJavascript", "extractVariable", "goToEmailLink", "goToUrl", "goToUrlAndMeasureTti", "hover", "playSubTest", "pressKey", "refresh", "runApiTest", "scroll", "selectOption", "typeText", "uploadFiles", "wait", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_test_config.py b/src/datadog_api_client/v1/model/synthetics_test_config.py index 1b5a6561a5..b15632a929 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_config.py +++ b/src/datadog_api_client/v1/model/synthetics_test_config.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SyntheticsTestConfig(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestConfig - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + assertions ([SyntheticsAssertion]): Array of assertions used for the test.. [optional] if omitted the server will use the default value of [] # noqa: E501 + config_variables ([SyntheticsConfigVariable]): API tests only - array of variables used for the test.. [optional] # noqa: E501 + request (SyntheticsTestRequest): [optional] # noqa: E501 + variables ([SyntheticsBrowserVariable]): Browser tests only - array of variables used for the test steps.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_details.py b/src/datadog_api_client/v1/model/synthetics_test_details.py index 1b00fdf0cd..65290c87cd 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_details.py +++ b/src/datadog_api_client/v1/model/synthetics_test_details.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class SyntheticsTestDetails(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -117,6 +136,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestDetails - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + config (SyntheticsTestConfig): [optional] # noqa: E501 + locations ([str]): Array of locations used to run the test.. [optional] # noqa: E501 + message (str): Notification message associated with the test.. [optional] # noqa: E501 + monitor_id (int): The associated monitor ID.. [optional] # noqa: E501 + name (str): Name of the test.. [optional] # noqa: E501 + options (SyntheticsTestOptions): [optional] # noqa: E501 + public_id (str): The test public ID.. [optional] # noqa: E501 + status (SyntheticsTestPauseStatus): [optional] # noqa: E501 + steps ([SyntheticsStep]): For browser test, the steps of the test.. [optional] # noqa: E501 + subtype (SyntheticsTestDetailsSubType): [optional] # noqa: E501 + tags ([str]): Array of tags attached to the test.. [optional] # noqa: E501 + type (SyntheticsTestDetailsType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -211,3 +318,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_details_sub_type.py b/src/datadog_api_client/v1/model/synthetics_test_details_sub_type.py index 88cec79a9b..851a2cf50b 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_details_sub_type.py +++ b/src/datadog_api_client/v1/model/synthetics_test_details_sub_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestDetailsSubType(ModelSimple): @@ -55,7 +57,23 @@ class SyntheticsTestDetailsSubType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -79,6 +97,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -182,3 +202,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsTestDetailsSubType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The subtype of the Synthetic API test, `http`, `ssl`, `tcp`, `dns`, `icmp` or `multi`.., must be one of ["http", "ssl", "tcp", "dns", "multi", "icmp", ] # noqa: E501 + + Keyword Args: + value (str): The subtype of the Synthetic API test, `http`, `ssl`, `tcp`, `dns`, `icmp` or `multi`.., must be one of ["http", "ssl", "tcp", "dns", "multi", "icmp", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_test_details_type.py b/src/datadog_api_client/v1/model/synthetics_test_details_type.py index 528ad1ba18..55c0388ff5 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_details_type.py +++ b/src/datadog_api_client/v1/model/synthetics_test_details_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestDetailsType(ModelSimple): @@ -51,7 +53,23 @@ class SyntheticsTestDetailsType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsTestDetailsType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Synthetic test, either `api` or `browser`.., must be one of ["api", "browser", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Synthetic test, either `api` or `browser`.., must be one of ["api", "browser", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_test_headers.py b/src/datadog_api_client/v1/model/synthetics_test_headers.py index 46fb829954..5d5d507605 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_headers.py +++ b/src/datadog_api_client/v1/model/synthetics_test_headers.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestHeaders(ModelNormal): @@ -80,6 +82,82 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestHeaders - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -162,3 +240,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_monitor_status.py b/src/datadog_api_client/v1/model/synthetics_test_monitor_status.py index 1892f61373..b500cb2c4e 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_monitor_status.py +++ b/src/datadog_api_client/v1/model/synthetics_test_monitor_status.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestMonitorStatus(ModelSimple): @@ -52,7 +54,23 @@ class SyntheticsTestMonitorStatus(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsTestMonitorStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): The status of your Synthetic monitor. * `O` for not triggered * `1` for triggered * `2` for no data., must be one of [0, 1, 2, ] # noqa: E501 + + Keyword Args: + value (int): The status of your Synthetic monitor. * `O` for not triggered * `1` for triggered * `2` for no data., must be one of [0, 1, 2, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_test_options.py b/src/datadog_api_client/v1/model/synthetics_test_options.py index de90d0b09b..c4fbc1856c 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_options.py +++ b/src/datadog_api_client/v1/model/synthetics_test_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -69,7 +71,24 @@ class SyntheticsTestOptions(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -122,6 +141,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + accept_self_signed (bool): For SSL test, whether or not the test should allow self signed certificates.. [optional] # noqa: E501 + allow_insecure (bool): Allows loading insecure content for an HTTP request.. [optional] # noqa: E501 + device_ids ([SyntheticsDeviceID]): For browser test, array with the different device IDs used to run the test.. [optional] # noqa: E501 + disable_cors (bool): Whether or not to disable CORS mechanism.. [optional] # noqa: E501 + follow_redirects (bool): For API HTTP test, whether or not the test should follow redirects.. [optional] # noqa: E501 + min_failure_duration (int): Minimum amount of time in failure required to trigger an alert.. [optional] # noqa: E501 + min_location_failed (int): Minimum number of locations in failure required to trigger an alert.. [optional] # noqa: E501 + monitor_name (str): The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.. [optional] # noqa: E501 + monitor_options (SyntheticsTestOptionsMonitorOptions): [optional] # noqa: E501 + monitor_priority (int): Integer from 1 (high) to 5 (low) indicating alert severity.. [optional] # noqa: E501 + no_screenshot (bool): Prevents saving screenshots of the steps.. [optional] # noqa: E501 + retry (SyntheticsTestOptionsRetry): [optional] # noqa: E501 + tick_every (int): The frequency at which to run the Synthetic test (in seconds).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -217,3 +325,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_options_monitor_options.py b/src/datadog_api_client/v1/model/synthetics_test_options_monitor_options.py index e638b1d2e7..e3b8d97940 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_options_monitor_options.py +++ b/src/datadog_api_client/v1/model/synthetics_test_options_monitor_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestOptionsMonitorOptions(ModelNormal): @@ -55,7 +57,23 @@ class SyntheticsTestOptionsMonitorOptions(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -83,6 +101,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestOptionsMonitorOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + renotify_interval (int): Time interval before renotifying if the test is still failing (in minutes).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -166,3 +261,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_options_retry.py b/src/datadog_api_client/v1/model/synthetics_test_options_retry.py index bd0eb58f5e..e57d040514 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_options_retry.py +++ b/src/datadog_api_client/v1/model/synthetics_test_options_retry.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestOptionsRetry(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsTestOptionsRetry(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestOptionsRetry - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + count (int): Number of times a test needs to be retried before marking a location as failed. Defaults to 0.. [optional] # noqa: E501 + interval (float): Time interval between retries (in milliseconds). Defaults to 300ms.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_pause_status.py b/src/datadog_api_client/v1/model/synthetics_test_pause_status.py index c8726ac8ad..7f5eb85a21 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_pause_status.py +++ b/src/datadog_api_client/v1/model/synthetics_test_pause_status.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestPauseStatus(ModelSimple): @@ -51,7 +53,23 @@ class SyntheticsTestPauseStatus(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsTestPauseStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Define whether you want to start (`live`) or pause (`paused`) a Synthetic test.., must be one of ["live", "paused", ] # noqa: E501 + + Keyword Args: + value (str): Define whether you want to start (`live`) or pause (`paused`) a Synthetic test.., must be one of ["live", "paused", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_test_process_status.py b/src/datadog_api_client/v1/model/synthetics_test_process_status.py index 682995f0a6..172d4e2818 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_process_status.py +++ b/src/datadog_api_client/v1/model/synthetics_test_process_status.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestProcessStatus(ModelSimple): @@ -54,7 +56,23 @@ class SyntheticsTestProcessStatus(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsTestProcessStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Status of a Synthetic test.., must be one of ["not_scheduled", "scheduled", "started", "finished", "finished_with_error", ] # noqa: E501 + + Keyword Args: + value (str): Status of a Synthetic test.., must be one of ["not_scheduled", "scheduled", "started", "finished", "finished_with_error", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/synthetics_test_request.py b/src/datadog_api_client/v1/model/synthetics_test_request.py index 714f4d3cf1..dfb3042bf9 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_request.py +++ b/src/datadog_api_client/v1/model/synthetics_test_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -71,7 +73,24 @@ class SyntheticsTestRequest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -130,6 +149,98 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + allow_insecure (bool): Allows loading insecure content for an HTTP request in a multistep test step.. [optional] # noqa: E501 + basic_auth (SyntheticsBasicAuth): [optional] # noqa: E501 + body (str): Body to include in the test.. [optional] # noqa: E501 + certificate (SyntheticsTestRequestCertificate): [optional] # noqa: E501 + dns_server (str): DNS server to use for DNS tests.. [optional] # noqa: E501 + dns_server_port (int): DNS server port to use for DNS tests.. [optional] # noqa: E501 + headers (SyntheticsTestHeaders): [optional] # noqa: E501 + host (str): Host name to perform the test with.. [optional] # noqa: E501 + method (HTTPMethod): [optional] # noqa: E501 + no_saving_response_body (bool): Determines whether or not to save the response body.. [optional] # noqa: E501 + number_of_packets (int): Number of pings to use per test.. [optional] # noqa: E501 + port (int): Port to use when performing the test.. [optional] # noqa: E501 + query ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): Query to use for the test.. [optional] # noqa: E501 + should_track_hops (bool): Turns on a traceroute probe to discover all gateways along the path to the host destination.. [optional] # noqa: E501 + timeout (float): Timeout in seconds for the test.. [optional] # noqa: E501 + url (str): URL to perform the test with.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -228,3 +339,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_request_certificate.py b/src/datadog_api_client/v1/model/synthetics_test_request_certificate.py index c25827be48..9e22a310c5 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_request_certificate.py +++ b/src/datadog_api_client/v1/model/synthetics_test_request_certificate.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsTestRequestCertificate(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestRequestCertificate - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cert (SyntheticsTestRequestCertificateItem): [optional] # noqa: E501 + key (SyntheticsTestRequestCertificateItem): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_test_request_certificate_item.py b/src/datadog_api_client/v1/model/synthetics_test_request_certificate_item.py index 021fe023ba..d07eeda401 100644 --- a/src/datadog_api_client/v1/model/synthetics_test_request_certificate_item.py +++ b/src/datadog_api_client/v1/model/synthetics_test_request_certificate_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTestRequestCertificateItem(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsTestRequestCertificateItem(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTestRequestCertificateItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + content (str): Content of the certificate or key.. [optional] # noqa: E501 + filename (str): File name for the certificate or key.. [optional] # noqa: E501 + updated_at (str): Date of update of the certificate or key, ISO format.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_timing.py b/src/datadog_api_client/v1/model/synthetics_timing.py index af77f7a0d5..ff8e50bd00 100644 --- a/src/datadog_api_client/v1/model/synthetics_timing.py +++ b/src/datadog_api_client/v1/model/synthetics_timing.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTiming(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsTiming(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -94,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTiming - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dns (float): The duration in millisecond of the DNS lookup.. [optional] # noqa: E501 + download (float): The time in millisecond to download the response.. [optional] # noqa: E501 + first_byte (float): The time in millisecond to first byte.. [optional] # noqa: E501 + handshake (float): The duration in millisecond of the TLS handshake.. [optional] # noqa: E501 + redirect (float): The time in millisecond spent during redirections.. [optional] # noqa: E501 + ssl (float): The duration in millisecond of the TLS handshake.. [optional] # noqa: E501 + tcp (float): Time in millisecond to establish the TCP connection.. [optional] # noqa: E501 + total (float): The overall time in millisecond the request took to be processed.. [optional] # noqa: E501 + wait (float): Time spent in millisecond waiting for a response.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +288,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_location.py b/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_location.py index 99dbf48adf..2d5d0fdf27 100644 --- a/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_location.py +++ b/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_location.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsTriggerCITestLocation(ModelNormal): @@ -50,7 +52,23 @@ class SyntheticsTriggerCITestLocation(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTriggerCITestLocation - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): Unique identifier of the location.. [optional] # noqa: E501 + name (str): Name of the location.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_run_result.py b/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_run_result.py index b43634da9b..1c798b5c32 100644 --- a/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_run_result.py +++ b/src/datadog_api_client/v1/model/synthetics_trigger_ci_test_run_result.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsTriggerCITestRunResult(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTriggerCITestRunResult - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + device (SyntheticsDeviceID): [optional] # noqa: E501 + location (int): The location ID of the test run.. [optional] # noqa: E501 + public_id (str): The public ID of the Synthetics test.. [optional] # noqa: E501 + result_id (str): ID of the result.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py b/src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py index 4f66fa8563..09fcd97df7 100644 --- a/src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py +++ b/src/datadog_api_client/v1/model/synthetics_trigger_ci_tests_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SyntheticsTriggerCITestsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsTriggerCITestsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + locations ([SyntheticsTriggerCITestLocation]): List of Synthetics locations.. [optional] # noqa: E501 + results ([SyntheticsTriggerCITestRunResult]): Information about the tests runs.. [optional] # noqa: E501 + triggered_check_ids ([str]): The public IDs of the Synthetics test triggered.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_update_test_pause_status_payload.py b/src/datadog_api_client/v1/model/synthetics_update_test_pause_status_payload.py index 80d3685e70..b40339218e 100644 --- a/src/datadog_api_client/v1/model/synthetics_update_test_pause_status_payload.py +++ b/src/datadog_api_client/v1/model/synthetics_update_test_pause_status_payload.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsUpdateTestPauseStatusPayload(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SyntheticsUpdateTestPauseStatusPayload - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + new_status (SyntheticsTestPauseStatus): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_variable_parser.py b/src/datadog_api_client/v1/model/synthetics_variable_parser.py index 061ee176c8..3a7b0a7866 100644 --- a/src/datadog_api_client/v1/model/synthetics_variable_parser.py +++ b/src/datadog_api_client/v1/model/synthetics_variable_parser.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SyntheticsVariableParser(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """SyntheticsVariableParser - a model defined in OpenAPI + + Args: + type (SyntheticsGlobalVariableParserType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + value (str): Regex or JSON path used for the parser. Not used with type `raw`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +274,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/synthetics_warning_type.py b/src/datadog_api_client/v1/model/synthetics_warning_type.py index 623172e395..d44d234b78 100644 --- a/src/datadog_api_client/v1/model/synthetics_warning_type.py +++ b/src/datadog_api_client/v1/model/synthetics_warning_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class SyntheticsWarningType(ModelSimple): @@ -50,7 +52,23 @@ class SyntheticsWarningType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SyntheticsWarningType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): User locator used.. if omitted defaults to "user_locator", must be one of ["user_locator", ] # noqa: E501 + + Keyword Args: + value (str): User locator used.. if omitted defaults to "user_locator", must be one of ["user_locator", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "user_locator" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/table_widget_cell_display_mode.py b/src/datadog_api_client/v1/model/table_widget_cell_display_mode.py index 7ac322e014..202bf58ac6 100644 --- a/src/datadog_api_client/v1/model/table_widget_cell_display_mode.py +++ b/src/datadog_api_client/v1/model/table_widget_cell_display_mode.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TableWidgetCellDisplayMode(ModelSimple): @@ -51,7 +53,23 @@ class TableWidgetCellDisplayMode(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TableWidgetCellDisplayMode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Define a display mode for the table cell.., must be one of ["number", "bar", ] # noqa: E501 + + Keyword Args: + value (str): Define a display mode for the table cell.., must be one of ["number", "bar", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/table_widget_definition.py b/src/datadog_api_client/v1/model/table_widget_definition.py index 331a06a79c..af82cd5c1e 100644 --- a/src/datadog_api_client/v1/model/table_widget_definition.py +++ b/src/datadog_api_client/v1/model/table_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class TableWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """TableWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([TableWidgetRequest]): Widget definition. + type (TableWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + has_search_bar (TableWidgetHasSearchBar): [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +310,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/table_widget_definition_type.py b/src/datadog_api_client/v1/model/table_widget_definition_type.py index 32a73581bf..bf3998417c 100644 --- a/src/datadog_api_client/v1/model/table_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/table_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TableWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class TableWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TableWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the table widget.. if omitted defaults to "query_table", must be one of ["query_table", ] # noqa: E501 + + Keyword Args: + value (str): Type of the table widget.. if omitted defaults to "query_table", must be one of ["query_table", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "query_table" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/table_widget_has_search_bar.py b/src/datadog_api_client/v1/model/table_widget_has_search_bar.py index 810a6ca87d..82c522e82e 100644 --- a/src/datadog_api_client/v1/model/table_widget_has_search_bar.py +++ b/src/datadog_api_client/v1/model/table_widget_has_search_bar.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TableWidgetHasSearchBar(ModelSimple): @@ -52,7 +54,23 @@ class TableWidgetHasSearchBar(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TableWidgetHasSearchBar - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Controls the display of the search bar.., must be one of ["always", "never", "auto", ] # noqa: E501 + + Keyword Args: + value (str): Controls the display of the search bar.., must be one of ["always", "never", "auto", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/table_widget_request.py b/src/datadog_api_client/v1/model/table_widget_request.py index de7a808d48..2c4ef6b813 100644 --- a/src/datadog_api_client/v1/model/table_widget_request.py +++ b/src/datadog_api_client/v1/model/table_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -74,7 +76,24 @@ class TableWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -139,6 +158,101 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TableWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregator (WidgetAggregator): [optional] # noqa: E501 + alias (str): The column name (defaults to the metric name).. [optional] # noqa: E501 + apm_query (LogQueryDefinition): [optional] # noqa: E501 + apm_stats_query (ApmStatsQueryDefinition): [optional] # noqa: E501 + cell_display_mode ([TableWidgetCellDisplayMode]): A list of display modes for each table cell.. [optional] # noqa: E501 + conditional_formats ([WidgetConditionalFormat]): List of conditional formats.. [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + formulas ([WidgetFormula]): List of formulas that operate on queries. **This feature is currently in beta.**. [optional] # noqa: E501 + limit (int): For metric queries, the number of lines to show in the table. Only one request should have this property.. [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + order (WidgetSort): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Query definition.. [optional] # noqa: E501 + queries ([FormulaAndFunctionQueryDefinition]): List of queries that can be returned directly or used in formulas. **This feature is currently in beta.**. [optional] # noqa: E501 + response_format (FormulaAndFunctionResponseFormat): [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -240,3 +354,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/tag_to_hosts.py b/src/datadog_api_client/v1/model/tag_to_hosts.py index 1901554c1d..d15f752fba 100644 --- a/src/datadog_api_client/v1/model/tag_to_hosts.py +++ b/src/datadog_api_client/v1/model/tag_to_hosts.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TagToHosts(ModelNormal): @@ -50,7 +52,23 @@ class TagToHosts(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TagToHosts - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tags ({str: ([str],)}): A list of tags to apply to the host.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/target_format_type.py b/src/datadog_api_client/v1/model/target_format_type.py index 8a985e7619..f296664af9 100644 --- a/src/datadog_api_client/v1/model/target_format_type.py +++ b/src/datadog_api_client/v1/model/target_format_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TargetFormatType(ModelSimple): @@ -53,7 +55,23 @@ class TargetFormatType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TargetFormatType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): If the `target_type` of the remapper is `attribute`, try to cast the value to a new specific type. If the cast is not possible, the original type is kept. `string`, `integer`, or `double` are the possible types. If the `target_type` is `tag`, this parameter may not be specified.., must be one of ["auto", "string", "integer", "double", ] # noqa: E501 + + Keyword Args: + value (str): If the `target_type` of the remapper is `attribute`, try to cast the value to a new specific type. If the cast is not possible, the original type is kept. `string`, `integer`, or `double` are the possible types. If the `target_type` is `tag`, this parameter may not be specified.., must be one of ["auto", "string", "integer", "double", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/timeseries_widget_definition.py b/src/datadog_api_client/v1/model/timeseries_widget_definition.py index 67db35517f..36d2c83d85 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_definition.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -78,7 +80,24 @@ class TimeseriesWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -135,6 +154,101 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """TimeseriesWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([TimeseriesWidgetRequest]): List of timeseries widget requests. + type (TimeseriesWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + events ([WidgetEvent]): List of widget events.. [optional] # noqa: E501 + legend_columns ([TimeseriesWidgetLegendColumn]): Columns displayed in the legend.. [optional] # noqa: E501 + legend_layout (TimeseriesWidgetLegendLayout): [optional] # noqa: E501 + legend_size (str): Available legend sizes for a widget. Should be one of \"0\", \"2\", \"4\", \"8\", \"16\", or \"auto\".. [optional] # noqa: E501 + markers ([WidgetMarker]): List of markers.. [optional] # noqa: E501 + right_yaxis (WidgetAxis): [optional] # noqa: E501 + show_legend (bool): (screenboard only) Show the legend for this widget.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + yaxis (WidgetAxis): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -236,3 +350,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/timeseries_widget_definition_type.py b/src/datadog_api_client/v1/model/timeseries_widget_definition_type.py index 4b75485ac7..b832b71acb 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TimeseriesWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class TimeseriesWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TimeseriesWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the timeseries widget.. if omitted defaults to "timeseries", must be one of ["timeseries", ] # noqa: E501 + + Keyword Args: + value (str): Type of the timeseries widget.. if omitted defaults to "timeseries", must be one of ["timeseries", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "timeseries" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/timeseries_widget_expression_alias.py b/src/datadog_api_client/v1/model/timeseries_widget_expression_alias.py index 467a2f8208..740b5e4929 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_expression_alias.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_expression_alias.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TimeseriesWidgetExpressionAlias(ModelNormal): @@ -50,7 +52,23 @@ class TimeseriesWidgetExpressionAlias(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, expression, *args, **kwargs): # noqa: E501 + """TimeseriesWidgetExpressionAlias - a model defined in OpenAPI + + Args: + expression (str): Expression name. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alias_name (str): Expression alias.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.expression = expression + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +266,8 @@ def __init__(self, expression, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/timeseries_widget_legend_column.py b/src/datadog_api_client/v1/model/timeseries_widget_legend_column.py index 4e51565ae3..59a9d91424 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_legend_column.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_legend_column.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TimeseriesWidgetLegendColumn(ModelSimple): @@ -54,7 +56,23 @@ class TimeseriesWidgetLegendColumn(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TimeseriesWidgetLegendColumn - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Legend column.., must be one of ["value", "avg", "sum", "min", "max", ] # noqa: E501 + + Keyword Args: + value (str): Legend column.., must be one of ["value", "avg", "sum", "min", "max", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/timeseries_widget_legend_layout.py b/src/datadog_api_client/v1/model/timeseries_widget_legend_layout.py index 2e6c589069..ed18e49e8f 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_legend_layout.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_legend_layout.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TimeseriesWidgetLegendLayout(ModelSimple): @@ -52,7 +54,23 @@ class TimeseriesWidgetLegendLayout(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TimeseriesWidgetLegendLayout - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Layout of the legend.., must be one of ["auto", "horizontal", "vertical", ] # noqa: E501 + + Keyword Args: + value (str): Layout of the legend.., must be one of ["auto", "horizontal", "vertical", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/timeseries_widget_request.py b/src/datadog_api_client/v1/model/timeseries_widget_request.py index 9c7be076b8..9f5d9fa076 100644 --- a/src/datadog_api_client/v1/model/timeseries_widget_request.py +++ b/src/datadog_api_client/v1/model/timeseries_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -70,7 +72,24 @@ class TimeseriesWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -131,6 +150,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TimeseriesWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_query (LogQueryDefinition): [optional] # noqa: E501 + audit_query (LogQueryDefinition): [optional] # noqa: E501 + display_type (WidgetDisplayType): [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + formulas ([WidgetFormula]): List of formulas that operate on queries. **This feature is currently in beta.**. [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + metadata ([TimeseriesWidgetExpressionAlias]): Used to define expression aliases.. [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + on_right_yaxis (bool): Whether or not to display a second y-axis on the right.. [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Widget query.. [optional] # noqa: E501 + queries ([FormulaAndFunctionQueryDefinition]): List of queries that can be returned directly or used in formulas. **This feature is currently in beta.**. [optional] # noqa: E501 + response_format (FormulaAndFunctionResponseFormat): [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + style (WidgetRequestStyle): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -230,3 +342,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/toplist_widget_definition.py b/src/datadog_api_client/v1/model/toplist_widget_definition.py index 3e6a200e6d..b57a3d5f30 100644 --- a/src/datadog_api_client/v1/model/toplist_widget_definition.py +++ b/src/datadog_api_client/v1/model/toplist_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class ToplistWidgetDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,6 +124,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, requests, type, *args, **kwargs): # noqa: E501 + """ToplistWidgetDefinition - a model defined in OpenAPI + + Args: + requests ([ToplistWidgetRequest]): List of top list widget requests. + type (ToplistWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of your widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.requests = requests + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -198,3 +304,8 @@ def __init__(self, requests, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/toplist_widget_definition_type.py b/src/datadog_api_client/v1/model/toplist_widget_definition_type.py index 90e2b51cf0..2b26dce0f7 100644 --- a/src/datadog_api_client/v1/model/toplist_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/toplist_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class ToplistWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class ToplistWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ToplistWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the top list widget.. if omitted defaults to "toplist", must be one of ["toplist", ] # noqa: E501 + + Keyword Args: + value (str): Type of the top list widget.. if omitted defaults to "toplist", must be one of ["toplist", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "toplist" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/toplist_widget_request.py b/src/datadog_api_client/v1/model/toplist_widget_request.py index a79c0460ec..e8a6d236bb 100644 --- a/src/datadog_api_client/v1/model/toplist_widget_request.py +++ b/src/datadog_api_client/v1/model/toplist_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -72,7 +74,24 @@ class ToplistWidgetRequest(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -129,6 +148,97 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ToplistWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_query (LogQueryDefinition): [optional] # noqa: E501 + audit_query (LogQueryDefinition): [optional] # noqa: E501 + conditional_formats ([WidgetConditionalFormat]): List of conditional formats.. [optional] # noqa: E501 + event_query (LogQueryDefinition): [optional] # noqa: E501 + formulas ([WidgetFormula]): List of formulas that operate on queries. **This feature is currently in beta.**. [optional] # noqa: E501 + log_query (LogQueryDefinition): [optional] # noqa: E501 + network_query (LogQueryDefinition): [optional] # noqa: E501 + process_query (ProcessQueryDefinition): [optional] # noqa: E501 + profile_metrics_query (LogQueryDefinition): [optional] # noqa: E501 + q (str): Widget query.. [optional] # noqa: E501 + queries ([FormulaAndFunctionQueryDefinition]): List of queries that can be returned directly or used in formulas. **This feature is currently in beta.**. [optional] # noqa: E501 + response_format (FormulaAndFunctionResponseFormat): [optional] # noqa: E501 + rum_query (LogQueryDefinition): [optional] # noqa: E501 + security_query (LogQueryDefinition): [optional] # noqa: E501 + style (WidgetRequestStyle): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -226,3 +336,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/tree_map_color_by.py b/src/datadog_api_client/v1/model/tree_map_color_by.py index daa137003f..3428e342ce 100644 --- a/src/datadog_api_client/v1/model/tree_map_color_by.py +++ b/src/datadog_api_client/v1/model/tree_map_color_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TreeMapColorBy(ModelSimple): @@ -50,7 +52,23 @@ class TreeMapColorBy(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TreeMapColorBy - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The attribute used to determine color in the widget.. if omitted defaults to "user", must be one of ["user", ] # noqa: E501 + + Keyword Args: + value (str): The attribute used to determine color in the widget.. if omitted defaults to "user", must be one of ["user", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "user" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/tree_map_group_by.py b/src/datadog_api_client/v1/model/tree_map_group_by.py index 5d720f6bd1..dc570098bd 100644 --- a/src/datadog_api_client/v1/model/tree_map_group_by.py +++ b/src/datadog_api_client/v1/model/tree_map_group_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TreeMapGroupBy(ModelSimple): @@ -52,7 +54,23 @@ class TreeMapGroupBy(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TreeMapGroupBy - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The attribute used to group elements in the widget.., must be one of ["user", "family", "process", ] # noqa: E501 + + Keyword Args: + value (str): The attribute used to group elements in the widget.., must be one of ["user", "family", "process", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/tree_map_size_by.py b/src/datadog_api_client/v1/model/tree_map_size_by.py index aa1026fd7c..deabe18a27 100644 --- a/src/datadog_api_client/v1/model/tree_map_size_by.py +++ b/src/datadog_api_client/v1/model/tree_map_size_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TreeMapSizeBy(ModelSimple): @@ -51,7 +53,23 @@ class TreeMapSizeBy(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TreeMapSizeBy - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The attribute used to determine size in the widget.., must be one of ["pct_cpu", "pct_mem", ] # noqa: E501 + + Keyword Args: + value (str): The attribute used to determine size in the widget.., must be one of ["pct_cpu", "pct_mem", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/tree_map_widget_definition.py b/src/datadog_api_client/v1/model/tree_map_widget_definition.py index 05b150c5f9..6c74f0577f 100644 --- a/src/datadog_api_client/v1/model/tree_map_widget_definition.py +++ b/src/datadog_api_client/v1/model/tree_map_widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -69,7 +71,24 @@ class TreeMapWidgetDefinition(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -108,6 +127,95 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, color_by, group_by, requests, size_by, type, *args, **kwargs): # noqa: E501 + """TreeMapWidgetDefinition - a model defined in OpenAPI + + Args: + color_by (TreeMapColorBy): + group_by (TreeMapGroupBy): + requests ([TreeMapWidgetRequest]): List of top list widget requests. + size_by (TreeMapSizeBy): + type (TreeMapWidgetDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + title (str): Title of your widget.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.color_by = color_by + self.group_by = group_by + self.requests = requests + self.size_by = size_by + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -203,3 +311,8 @@ def __init__(self, color_by, group_by, requests, size_by, type, *args, **kwargs) # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/tree_map_widget_definition_type.py b/src/datadog_api_client/v1/model/tree_map_widget_definition_type.py index 318e536f4b..18c87e0194 100644 --- a/src/datadog_api_client/v1/model/tree_map_widget_definition_type.py +++ b/src/datadog_api_client/v1/model/tree_map_widget_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TreeMapWidgetDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class TreeMapWidgetDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """TreeMapWidgetDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the treemap widget.. if omitted defaults to "treemap", must be one of ["treemap", ] # noqa: E501 + + Keyword Args: + value (str): Type of the treemap widget.. if omitted defaults to "treemap", must be one of ["treemap", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "treemap" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/tree_map_widget_request.py b/src/datadog_api_client/v1/model/tree_map_widget_request.py index d380a0ddfc..58a7da4dec 100644 --- a/src/datadog_api_client/v1/model/tree_map_widget_request.py +++ b/src/datadog_api_client/v1/model/tree_map_widget_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class TreeMapWidgetRequest(ModelNormal): @@ -50,7 +52,23 @@ class TreeMapWidgetRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """TreeMapWidgetRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + q (str): The widget metrics query.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_analyzed_logs_hour.py b/src/datadog_api_client/v1/model/usage_analyzed_logs_hour.py index 04eabc7321..26d23557f1 100644 --- a/src/datadog_api_client/v1/model/usage_analyzed_logs_hour.py +++ b/src/datadog_api_client/v1/model/usage_analyzed_logs_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAnalyzedLogsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageAnalyzedLogsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAnalyzedLogsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + analyzed_logs (int): Contains the number of analyzed logs.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_analyzed_logs_response.py b/src/datadog_api_client/v1/model/usage_analyzed_logs_response.py index ff8b1b4561..0b79d9c0ae 100644 --- a/src/datadog_api_client/v1/model/usage_analyzed_logs_response.py +++ b/src/datadog_api_client/v1/model/usage_analyzed_logs_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageAnalyzedLogsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAnalyzedLogsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageAnalyzedLogsHour]): Get hourly usage for analyzed logs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_aggregates.py b/src/datadog_api_client/v1/model/usage_attribution_aggregates.py index e3194a4b0c..69b021eb39 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_aggregates.py +++ b/src/datadog_api_client/v1/model/usage_attribution_aggregates.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -52,7 +54,24 @@ class UsageAttributionAggregates(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -163,9 +184,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageAttributionAggregates - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([UsageAttributionAggregatesBody]): An array of available aggregates.. # noqa: E501 + + Keyword Args: + value ([UsageAttributionAggregatesBody]): An array of available aggregates.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -191,3 +295,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_attribution_aggregates_body.py b/src/datadog_api_client/v1/model/usage_attribution_aggregates_body.py index 1dc04fbdb6..e922222e0d 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_aggregates_body.py +++ b/src/datadog_api_client/v1/model/usage_attribution_aggregates_body.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAttributionAggregatesBody(ModelNormal): @@ -50,7 +52,23 @@ class UsageAttributionAggregatesBody(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionAggregatesBody - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agg_type (str): The aggregate type.. [optional] # noqa: E501 + field (str): The field.. [optional] # noqa: E501 + value (float): The value for a given field.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_body.py b/src/datadog_api_client/v1/model/usage_attribution_body.py index 0a5f11ab40..0360e2cbf7 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_body.py +++ b/src/datadog_api_client/v1/model/usage_attribution_body.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageAttributionBody(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionBody - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + month (datetime): Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM].. [optional] # noqa: E501 + org_name (str): The name of the organization.. [optional] # noqa: E501 + public_id (str): The organization public ID.. [optional] # noqa: E501 + tag_config_source (str): The source of the usage attribution tag configuration and the selected tags in the format `:--`.. [optional] # noqa: E501 + tags (UsageAttributionTagNames): [optional] # noqa: E501 + updated_at (str): Shows the the most recent hour in the current months for all organizations for which all usages were calculated.. [optional] # noqa: E501 + values (UsageAttributionValues): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +290,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_metadata.py b/src/datadog_api_client/v1/model/usage_attribution_metadata.py index c7da064c2e..35e5272d13 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_metadata.py +++ b/src/datadog_api_client/v1/model/usage_attribution_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageAttributionMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregates (UsageAttributionAggregates): [optional] # noqa: E501 + pagination (UsageAttributionPagination): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_pagination.py b/src/datadog_api_client/v1/model/usage_attribution_pagination.py index e4589ea5c2..94b1f85c6a 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_pagination.py +++ b/src/datadog_api_client/v1/model/usage_attribution_pagination.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAttributionPagination(ModelNormal): @@ -50,7 +52,23 @@ class UsageAttributionPagination(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionPagination - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + limit (int): Maximum amount of records to be returned.. [optional] # noqa: E501 + next_record_id (str): The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of this next_record_id.. [optional] # noqa: E501 + total_number_of_records (int): Total number of records. (deprecated after May 1st, 2021). [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_response.py b/src/datadog_api_client/v1/model/usage_attribution_response.py index e109fd365e..07c3941f9f 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_response.py +++ b/src/datadog_api_client/v1/model/usage_attribution_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageAttributionResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + metadata (UsageAttributionMetadata): [optional] # noqa: E501 + usage ([UsageAttributionBody]): Get Usage Summary by tag(s).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_sort.py b/src/datadog_api_client/v1/model/usage_attribution_sort.py index 7047138ed5..0260feb14a 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_sort.py +++ b/src/datadog_api_client/v1/model/usage_attribution_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAttributionSort(ModelSimple): @@ -71,7 +73,23 @@ class UsageAttributionSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +113,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -194,3 +214,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageAttributionSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The field to sort by.. if omitted defaults to "custom_timeseries_usage", must be one of ["api_percentage", "snmp_usage", "apm_host_usage", "api_usage", "container_usage", "custom_timeseries_percentage", "container_percentage", "apm_host_percentage", "npm_host_percentage", "browser_percentage", "browser_usage", "infra_host_percentage", "snmp_percentage", "npm_host_usage", "infra_host_usage", "custom_timeseries_usage", "lambda_functions_usage", "lambda_functions_percentage", "lambda_invocations_usage", "lambda_invocations_percentage", "lambda_usage", "lambda_percentage", ] # noqa: E501 + + Keyword Args: + value (str): The field to sort by.. if omitted defaults to "custom_timeseries_usage", must be one of ["api_percentage", "snmp_usage", "apm_host_usage", "api_usage", "container_usage", "custom_timeseries_percentage", "container_percentage", "apm_host_percentage", "npm_host_percentage", "browser_percentage", "browser_usage", "infra_host_percentage", "snmp_percentage", "npm_host_usage", "infra_host_usage", "custom_timeseries_usage", "lambda_functions_usage", "lambda_functions_percentage", "lambda_invocations_usage", "lambda_invocations_percentage", "lambda_usage", "lambda_percentage", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "custom_timeseries_usage" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_attribution_supported_metrics.py b/src/datadog_api_client/v1/model/usage_attribution_supported_metrics.py index 01adfc2d66..ef0f4af383 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_supported_metrics.py +++ b/src/datadog_api_client/v1/model/usage_attribution_supported_metrics.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAttributionSupportedMetrics(ModelSimple): @@ -78,7 +80,23 @@ class UsageAttributionSupportedMetrics(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -102,6 +120,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -205,3 +225,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageAttributionSupportedMetrics - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Supported fields for usage attribution requests (valid requests contain one or more metrics, or `*` for all).., must be one of ["custom_timeseries_usage", "container_usage", "snmp_percentage", "apm_host_usage", "browser_usage", "npm_host_percentage", "infra_host_usage", "custom_timeseries_percentage", "container_percentage", "lambda_usage", "api_usage", "apm_host_percentage", "infra_host_percentage", "snmp_usage", "browser_percentage", "api_percentage", "lambda_percentage", "npm_host_usage", "lambda_functions_usage", "lambda_functions_percentage", "lambda_invocations_usage", "lambda_invocations_percentage", "fargate_usage", "fargate_percentage", "profiled_host_usage", "profiled_host_percentage", "profiled_container_usage", "profiled_container_percentage", "*", ] # noqa: E501 + + Keyword Args: + value (str): Supported fields for usage attribution requests (valid requests contain one or more metrics, or `*` for all).., must be one of ["custom_timeseries_usage", "container_usage", "snmp_percentage", "apm_host_usage", "browser_usage", "npm_host_percentage", "infra_host_usage", "custom_timeseries_percentage", "container_percentage", "lambda_usage", "api_usage", "apm_host_percentage", "infra_host_percentage", "snmp_usage", "browser_percentage", "api_percentage", "lambda_percentage", "npm_host_usage", "lambda_functions_usage", "lambda_functions_percentage", "lambda_invocations_usage", "lambda_invocations_percentage", "fargate_usage", "fargate_percentage", "profiled_host_usage", "profiled_host_percentage", "profiled_container_usage", "profiled_container_percentage", "*", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_attribution_tag_names.py b/src/datadog_api_client/v1/model/usage_attribution_tag_names.py index ccc1d9ba19..2793403baf 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_tag_names.py +++ b/src/datadog_api_client/v1/model/usage_attribution_tag_names.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAttributionTagNames(ModelNormal): @@ -80,6 +82,82 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionTagNames - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -162,3 +240,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_attribution_values.py b/src/datadog_api_client/v1/model/usage_attribution_values.py index 4773a68074..760fd10d23 100644 --- a/src/datadog_api_client/v1/model/usage_attribution_values.py +++ b/src/datadog_api_client/v1/model/usage_attribution_values.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAttributionValues(ModelNormal): @@ -50,7 +52,23 @@ class UsageAttributionValues(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -144,6 +162,116 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAttributionValues - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + api_percentage (float): The percentage of synthetic API test usage by tag(s).. [optional] # noqa: E501 + api_usage (float): The synthetic API test usage by tag(s).. [optional] # noqa: E501 + apm_host_percentage (float): The percentage of APM host usage by tag(s).. [optional] # noqa: E501 + apm_host_usage (float): The APM host usage by tag(s).. [optional] # noqa: E501 + browser_percentage (float): The percentage of synthetic browser test usage by tag(s).. [optional] # noqa: E501 + browser_usage (float): The synthetic browser test usage by tag(s).. [optional] # noqa: E501 + container_percentage (float): The percentage of container usage by tag(s).. [optional] # noqa: E501 + container_usage (float): The container usage by tag(s).. [optional] # noqa: E501 + cspm_container_percentage (float): The percentage of Cloud Security Posture Management container usage by tag(s). [optional] # noqa: E501 + cspm_container_usage (float): The Cloud Security Posture Management container usage by tag(s). [optional] # noqa: E501 + cspm_host_percentage (float): The percentage of Cloud Security Posture Management host usage by tag(s). [optional] # noqa: E501 + cspm_host_usage (float): The Cloud Security Posture Management host usage by tag(s). [optional] # noqa: E501 + custom_timeseries_percentage (float): The percentage of custom metrics usage by tag(s).. [optional] # noqa: E501 + custom_timeseries_usage (float): The custom metrics usage by tag(s).. [optional] # noqa: E501 + cws_container_percentage (float): The percentage of Cloud Workload Security container usage by tag(s). [optional] # noqa: E501 + cws_container_usage (float): The Cloud Workload Security container usage by tag(s). [optional] # noqa: E501 + cws_host_percentage (float): The percentage of Cloud Workload Security host usage by tag(s). [optional] # noqa: E501 + cws_host_usage (float): The Cloud Workload Security host usage by tag(s). [optional] # noqa: E501 + infra_host_percentage (float): The percentage of infrastructure host usage by tag(s).. [optional] # noqa: E501 + infra_host_usage (float): The infrastructure host usage by tag(s).. [optional] # noqa: E501 + lambda_functions_percentage (float): The percentage of Lambda function usage by tag(s).. [optional] # noqa: E501 + lambda_functions_usage (float): The Lambda function usage by tag(s).. [optional] # noqa: E501 + lambda_invocations_percentage (float): The percentage of Lambda invocation usage by tag(s).. [optional] # noqa: E501 + lambda_invocations_usage (float): The Lambda invocation usage by tag(s).. [optional] # noqa: E501 + lambda_percentage (float): The percentage of Lambda function usage by tag(s). **Note** this field is deprecated. Use lambda_functions_percentage instead.. [optional] # noqa: E501 + lambda_usage (float): The Lambda function usage by tag(s). **Note** this field is deprecated. Use lambda_functions_usage instead.. [optional] # noqa: E501 + npm_host_percentage (float): The percentage of network host usage by tag(s).. [optional] # noqa: E501 + npm_host_usage (float): The network host usage by tag(s).. [optional] # noqa: E501 + profiled_containers_percentage (float): The percentage of profiled containers usage by tag(s).. [optional] # noqa: E501 + profiled_containers_usage (float): The profiled container usage by tag(s).. [optional] # noqa: E501 + profiled_hosts_percentage (float): The percentage of profiled hosts usage by tag(s).. [optional] # noqa: E501 + profiled_hosts_usage (float): The profiled host usage by tag(s).. [optional] # noqa: E501 + snmp_percentage (float): The percentage of network device usage by tag(s).. [optional] # noqa: E501 + snmp_usage (float): The network device usage by tag(s).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -260,3 +388,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_audit_logs_hour.py b/src/datadog_api_client/v1/model/usage_audit_logs_hour.py index b254aa0df6..5b5c4c1195 100644 --- a/src/datadog_api_client/v1/model/usage_audit_logs_hour.py +++ b/src/datadog_api_client/v1/model/usage_audit_logs_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageAuditLogsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageAuditLogsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAuditLogsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + lines_indexed (int): The total number of audit logs lines indexed during a given hour.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_audit_logs_response.py b/src/datadog_api_client/v1/model/usage_audit_logs_response.py index 75030822ab..aa6229c385 100644 --- a/src/datadog_api_client/v1/model/usage_audit_logs_response.py +++ b/src/datadog_api_client/v1/model/usage_audit_logs_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageAuditLogsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageAuditLogsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageAuditLogsHour]): Get hourly usage for audit logs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_billable_summary_body.py b/src/datadog_api_client/v1/model/usage_billable_summary_body.py index 8ecd00bd01..5e3106d844 100644 --- a/src/datadog_api_client/v1/model/usage_billable_summary_body.py +++ b/src/datadog_api_client/v1/model/usage_billable_summary_body.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageBillableSummaryBody(ModelNormal): @@ -50,7 +52,23 @@ class UsageBillableSummaryBody(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageBillableSummaryBody - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + account_billable_usage (int): The total account usage.. [optional] # noqa: E501 + elapsed_usage_hours (int): Elapsed usage hours for some billable product.. [optional] # noqa: E501 + first_billable_usage_hour (datetime): The first billable hour for the org.. [optional] # noqa: E501 + last_billable_usage_hour (datetime): The last billable hour for the org.. [optional] # noqa: E501 + org_billable_usage (int): The number of units used within the billable timeframe.. [optional] # noqa: E501 + percentage_in_account (float): The percentage of account usage the org represents.. [optional] # noqa: E501 + usage_unit (str): Units pertaining to the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_billable_summary_hour.py b/src/datadog_api_client/v1/model/usage_billable_summary_hour.py index 493a42a7f6..197ee64846 100644 --- a/src/datadog_api_client/v1/model/usage_billable_summary_hour.py +++ b/src/datadog_api_client/v1/model/usage_billable_summary_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageBillableSummaryHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageBillableSummaryHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + billing_plan (str): The billing plan.. [optional] # noqa: E501 + end_date (datetime): Shows the last date of usage.. [optional] # noqa: E501 + num_orgs (int): The number of organizations.. [optional] # noqa: E501 + org_name (str): The organization name.. [optional] # noqa: E501 + public_id (str): The organization public ID.. [optional] # noqa: E501 + ratio_in_month (int): Shows usage aggregation for a billing period.. [optional] # noqa: E501 + start_date (datetime): Shows the first date of usage.. [optional] # noqa: E501 + usage (UsageBillableSummaryKeys): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +292,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_billable_summary_keys.py b/src/datadog_api_client/v1/model/usage_billable_summary_keys.py index c05c280e54..d93e6536fa 100644 --- a/src/datadog_api_client/v1/model/usage_billable_summary_keys.py +++ b/src/datadog_api_client/v1/model/usage_billable_summary_keys.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageBillableSummaryKeys(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -147,6 +166,114 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageBillableSummaryKeys - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + apm_host_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + apm_host_top99p (UsageBillableSummaryBody): [optional] # noqa: E501 + apm_trace_search_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + fargate_container_average (UsageBillableSummaryBody): [optional] # noqa: E501 + infra_container_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + infra_host_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + infra_host_top99p (UsageBillableSummaryBody): [optional] # noqa: E501 + iot_top99p (UsageBillableSummaryBody): [optional] # noqa: E501 + lambda_function_average (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_15day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_180day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_30day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_3day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_45day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_60day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_7day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_90day_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_custom_retention_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_indexed_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + logs_ingested_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + network_device_top99p (UsageBillableSummaryBody): [optional] # noqa: E501 + npm_flow_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + npm_host_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + npm_host_top99p (UsageBillableSummaryBody): [optional] # noqa: E501 + prof_container_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + prof_host_top99p (UsageBillableSummaryBody): [optional] # noqa: E501 + rum_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + serverless_invocation_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + siem_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + synthetics_api_tests_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + synthetics_browser_checks_sum (UsageBillableSummaryBody): [optional] # noqa: E501 + timeseries_average (UsageBillableSummaryBody): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -261,3 +388,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_billable_summary_response.py b/src/datadog_api_client/v1/model/usage_billable_summary_response.py index 0f61ea9954..e6ca4a3e56 100644 --- a/src/datadog_api_client/v1/model/usage_billable_summary_response.py +++ b/src/datadog_api_client/v1/model/usage_billable_summary_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageBillableSummaryResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageBillableSummaryResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageBillableSummaryHour]): An array of objects regarding usage of billable summary.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_hour.py b/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_hour.py index 6793f55340..20b2192fc9 100644 --- a/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_hour.py +++ b/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageCloudSecurityPostureManagementHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageCloudSecurityPostureManagementHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCloudSecurityPostureManagementHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + container_count (int): The total number of Cloud Security Posture Management containers during a given hour.. [optional] # noqa: E501 + host_count (int): The total number of Cloud Security Posture Management hosts during a given hour.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_response.py b/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_response.py index c488245396..a1e06e6788 100644 --- a/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_response.py +++ b/src/datadog_api_client/v1/model/usage_cloud_security_posture_management_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageCloudSecurityPostureManagementResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCloudSecurityPostureManagementResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageCloudSecurityPostureManagementHour]): Get hourly usage for Cloud Security Posture Management.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +266,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_custom_reports_attributes.py b/src/datadog_api_client/v1/model/usage_custom_reports_attributes.py index 3300d7b250..dbbcdc8899 100644 --- a/src/datadog_api_client/v1/model/usage_custom_reports_attributes.py +++ b/src/datadog_api_client/v1/model/usage_custom_reports_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageCustomReportsAttributes(ModelNormal): @@ -50,7 +52,23 @@ class UsageCustomReportsAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCustomReportsAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + computed_on (str): The date the specified custom report was computed.. [optional] # noqa: E501 + end_date (str): The ending date of custom report.. [optional] # noqa: E501 + size (int): size. [optional] # noqa: E501 + start_date (str): The starting date of custom report.. [optional] # noqa: E501 + tags ([str]): A list of tags to apply to custom reports.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_custom_reports_data.py b/src/datadog_api_client/v1/model/usage_custom_reports_data.py index 929c947ae8..c5345407a4 100644 --- a/src/datadog_api_client/v1/model/usage_custom_reports_data.py +++ b/src/datadog_api_client/v1/model/usage_custom_reports_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageCustomReportsData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCustomReportsData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UsageCustomReportsAttributes): [optional] # noqa: E501 + id (str): The date for specified custom reports.. [optional] # noqa: E501 + type (UsageReportsType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_custom_reports_meta.py b/src/datadog_api_client/v1/model/usage_custom_reports_meta.py index 0aec321fab..f36ec0df35 100644 --- a/src/datadog_api_client/v1/model/usage_custom_reports_meta.py +++ b/src/datadog_api_client/v1/model/usage_custom_reports_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageCustomReportsMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCustomReportsMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (UsageCustomReportsPage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_custom_reports_page.py b/src/datadog_api_client/v1/model/usage_custom_reports_page.py index 51e7c8111b..205b1b1c05 100644 --- a/src/datadog_api_client/v1/model/usage_custom_reports_page.py +++ b/src/datadog_api_client/v1/model/usage_custom_reports_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageCustomReportsPage(ModelNormal): @@ -50,7 +52,23 @@ class UsageCustomReportsPage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCustomReportsPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_count (int): Total page count.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_custom_reports_response.py b/src/datadog_api_client/v1/model/usage_custom_reports_response.py index 8094852002..89ce2d7244 100644 --- a/src/datadog_api_client/v1/model/usage_custom_reports_response.py +++ b/src/datadog_api_client/v1/model/usage_custom_reports_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageCustomReportsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCustomReportsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([UsageCustomReportsData]): An array of available custom reports.. [optional] # noqa: E501 + meta (UsageCustomReportsMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_cws_hour.py b/src/datadog_api_client/v1/model/usage_cws_hour.py index b43493882b..7b0fa29efd 100644 --- a/src/datadog_api_client/v1/model/usage_cws_hour.py +++ b/src/datadog_api_client/v1/model/usage_cws_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageCWSHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageCWSHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCWSHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cws_container_count (int): The total number of Cloud Workload Security container hours from the start of the given hour’s month until the given hour.. [optional] # noqa: E501 + cws_host_count (int): The total number of Cloud Workload Security host hours from the start of the given hour’s month until the given hour.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_cws_response.py b/src/datadog_api_client/v1/model/usage_cws_response.py index 316d29dbb8..4df3febd4c 100644 --- a/src/datadog_api_client/v1/model/usage_cws_response.py +++ b/src/datadog_api_client/v1/model/usage_cws_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageCWSResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageCWSResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageCWSHour]): Get hourly usage for Cloud Workload Security.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_fargate_hour.py b/src/datadog_api_client/v1/model/usage_fargate_hour.py index c5280f1c10..63943c4096 100644 --- a/src/datadog_api_client/v1/model/usage_fargate_hour.py +++ b/src/datadog_api_client/v1/model/usage_fargate_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageFargateHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageFargateHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageFargateHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + tasks_count (int): The number of Fargate tasks run.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_fargate_response.py b/src/datadog_api_client/v1/model/usage_fargate_response.py index 12542f7789..561f6738dc 100644 --- a/src/datadog_api_client/v1/model/usage_fargate_response.py +++ b/src/datadog_api_client/v1/model/usage_fargate_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageFargateResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageFargateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageFargateHour]): Array with the number of hourly Fargate tasks recorded for a given organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_host_hour.py b/src/datadog_api_client/v1/model/usage_host_hour.py index 3f573c6b16..d57692bc17 100644 --- a/src/datadog_api_client/v1/model/usage_host_hour.py +++ b/src/datadog_api_client/v1/model/usage_host_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageHostHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageHostHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -104,6 +122,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageHostHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_host_count (int): Contains the total number of infrastructure hosts reporting during a given hour that were running the Datadog Agent.. [optional] # noqa: E501 + alibaba_host_count (int): Contains the total number of hosts that reported via Alibaba integration (and were NOT running the Datadog Agent).. [optional] # noqa: E501 + apm_azure_app_service_host_count (int): Contains the total number of Azure App Services hosts using APM.. [optional] # noqa: E501 + apm_host_count (int): Shows the total number of hosts using APM during the hour, these are counted as billable (except during trial periods).. [optional] # noqa: E501 + aws_host_count (int): Contains the total number of hosts that reported via the AWS integration (and were NOT running the Datadog Agent).. [optional] # noqa: E501 + azure_host_count (int): Contains the total number of hosts that reported via Azure integration (and were NOT running the Datadog Agent).. [optional] # noqa: E501 + container_count (int): Shows the total number of containers reported by the Docker integration during the hour.. [optional] # noqa: E501 + gcp_host_count (int): Contains the total number of hosts that reported via the Google Cloud integration (and were NOT running the Datadog Agent).. [optional] # noqa: E501 + heroku_host_count (int): Contains the total number of Heroku dynos reported by the Datadog Agent.. [optional] # noqa: E501 + host_count (int): Contains the total number of billable infrastructure hosts reporting during a given hour. This is the sum of `agent_host_count`, `aws_host_count`, and `gcp_host_count`.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + infra_azure_app_service (int): Contains the total number of hosts that reported via the Azure App Services integration (and were NOT running the Datadog Agent).. [optional] # noqa: E501 + opentelemetry_host_count (int): Contains the total number of hosts reported by Datadog exporter for the OpenTelemetry Collector.. [optional] # noqa: E501 + vsphere_host_count (int): Contains the total number of hosts that reported via vSphere integration (and were NOT running the Datadog Agent).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -200,3 +308,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_hosts_response.py b/src/datadog_api_client/v1/model/usage_hosts_response.py index 997695fd72..93e44d9240 100644 --- a/src/datadog_api_client/v1/model/usage_hosts_response.py +++ b/src/datadog_api_client/v1/model/usage_hosts_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageHostsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageHostsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageHostHour]): An array of objects related to host usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_incident_management_hour.py b/src/datadog_api_client/v1/model/usage_incident_management_hour.py index f91341e41a..fe105d2b04 100644 --- a/src/datadog_api_client/v1/model/usage_incident_management_hour.py +++ b/src/datadog_api_client/v1/model/usage_incident_management_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageIncidentManagementHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageIncidentManagementHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIncidentManagementHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + monthly_active_users (int): Contains the total number monthly active users from the start of the given hour's month until the given hour.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_incident_management_response.py b/src/datadog_api_client/v1/model/usage_incident_management_response.py index 07ade4b5ea..57576037b5 100644 --- a/src/datadog_api_client/v1/model/usage_incident_management_response.py +++ b/src/datadog_api_client/v1/model/usage_incident_management_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageIncidentManagementResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIncidentManagementResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageIncidentManagementHour]): Get hourly usage for incident management.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_indexed_spans_hour.py b/src/datadog_api_client/v1/model/usage_indexed_spans_hour.py index d2ba17c4b0..0d4a027d0d 100644 --- a/src/datadog_api_client/v1/model/usage_indexed_spans_hour.py +++ b/src/datadog_api_client/v1/model/usage_indexed_spans_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageIndexedSpansHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageIndexedSpansHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIndexedSpansHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + indexed_events_count (int): Contains the number of spans indexed.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_indexed_spans_response.py b/src/datadog_api_client/v1/model/usage_indexed_spans_response.py index a25b5f4cb3..7494a4acd5 100644 --- a/src/datadog_api_client/v1/model/usage_indexed_spans_response.py +++ b/src/datadog_api_client/v1/model/usage_indexed_spans_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageIndexedSpansResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIndexedSpansResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageIndexedSpansHour]): Array with the number of hourly traces indexed for a given organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_ingested_spans_hour.py b/src/datadog_api_client/v1/model/usage_ingested_spans_hour.py index b475b973df..2b991216ec 100644 --- a/src/datadog_api_client/v1/model/usage_ingested_spans_hour.py +++ b/src/datadog_api_client/v1/model/usage_ingested_spans_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageIngestedSpansHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageIngestedSpansHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIngestedSpansHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + ingested_events_bytes (int): Contains the total number of bytes ingested during a given hour.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_ingested_spans_response.py b/src/datadog_api_client/v1/model/usage_ingested_spans_response.py index 865e60d462..c855e10709 100644 --- a/src/datadog_api_client/v1/model/usage_ingested_spans_response.py +++ b/src/datadog_api_client/v1/model/usage_ingested_spans_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageIngestedSpansResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIngestedSpansResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageIngestedSpansHour]): Get hourly usage for ingested spans.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_io_t_hour.py b/src/datadog_api_client/v1/model/usage_io_t_hour.py index a15b8d355d..fa593c686e 100644 --- a/src/datadog_api_client/v1/model/usage_io_t_hour.py +++ b/src/datadog_api_client/v1/model/usage_io_t_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageIoTHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageIoTHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIoTHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + iot_device_count (int): The total number of IoT devices during a given hour.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_io_t_response.py b/src/datadog_api_client/v1/model/usage_io_t_response.py index cfcf73b5c5..301e986170 100644 --- a/src/datadog_api_client/v1/model/usage_io_t_response.py +++ b/src/datadog_api_client/v1/model/usage_io_t_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageIoTResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageIoTResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageIoTHour]): Get hourly usage for IoT.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_lambda_hour.py b/src/datadog_api_client/v1/model/usage_lambda_hour.py index f2dead2171..14f4d388ac 100644 --- a/src/datadog_api_client/v1/model/usage_lambda_hour.py +++ b/src/datadog_api_client/v1/model/usage_lambda_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageLambdaHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageLambdaHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLambdaHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + func_count (int): Contains the number of different functions for each region and AWS account.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + invocations_sum (int): Contains the sum of invocations of all functions.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_lambda_response.py b/src/datadog_api_client/v1/model/usage_lambda_response.py index 68fa56006d..6de2cee582 100644 --- a/src/datadog_api_client/v1/model/usage_lambda_response.py +++ b/src/datadog_api_client/v1/model/usage_lambda_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageLambdaResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLambdaResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageLambdaHour]): Get hourly usage for Lambda.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_logs_by_index_hour.py b/src/datadog_api_client/v1/model/usage_logs_by_index_hour.py index e5239f1527..ac12647726 100644 --- a/src/datadog_api_client/v1/model/usage_logs_by_index_hour.py +++ b/src/datadog_api_client/v1/model/usage_logs_by_index_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageLogsByIndexHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageLogsByIndexHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLogsByIndexHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + event_count (int): The total number of indexed logs for the queried hour.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + index_id (str): The index ID for this usage.. [optional] # noqa: E501 + index_name (str): The user specified name for this index ID.. [optional] # noqa: E501 + retention (int): The retention period (in days) for this index ID.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_logs_by_index_response.py b/src/datadog_api_client/v1/model/usage_logs_by_index_response.py index 76927ae3c0..ea6a08f677 100644 --- a/src/datadog_api_client/v1/model/usage_logs_by_index_response.py +++ b/src/datadog_api_client/v1/model/usage_logs_by_index_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageLogsByIndexResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLogsByIndexResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageLogsByIndexHour]): An array of objects regarding hourly usage of logs by index response.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_logs_by_retention_hour.py b/src/datadog_api_client/v1/model/usage_logs_by_retention_hour.py index 20c9d760bf..b7ea9fe86a 100644 --- a/src/datadog_api_client/v1/model/usage_logs_by_retention_hour.py +++ b/src/datadog_api_client/v1/model/usage_logs_by_retention_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageLogsByRetentionHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageLogsByRetentionHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLogsByRetentionHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + indexed_events_count (int): Total logs indexed with this retention period during a given hour.. [optional] # noqa: E501 + live_indexed_events_count (int): Live logs indexed with this retention period during a given hour.. [optional] # noqa: E501 + rehydrated_indexed_events_count (int): Rehydrated logs indexed with this retention period during a given hour.. [optional] # noqa: E501 + retention (str): The retention period in days or \"custom\" for all custom retention usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_logs_by_retention_response.py b/src/datadog_api_client/v1/model/usage_logs_by_retention_response.py index ad5711ca26..9a024de69a 100644 --- a/src/datadog_api_client/v1/model/usage_logs_by_retention_response.py +++ b/src/datadog_api_client/v1/model/usage_logs_by_retention_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageLogsByRetentionResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLogsByRetentionResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageLogsByRetentionHour]): Get hourly usage for indexed logs by retention period.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_logs_hour.py b/src/datadog_api_client/v1/model/usage_logs_hour.py index 65476de7ec..1b0d637b63 100644 --- a/src/datadog_api_client/v1/model/usage_logs_hour.py +++ b/src/datadog_api_client/v1/model/usage_logs_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageLogsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageLogsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLogsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + billable_ingested_bytes (int): Contains the number of billable log bytes ingested.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + indexed_events_count (int): Contains the number of log events indexed.. [optional] # noqa: E501 + ingested_events_bytes (int): Contains the number of log bytes ingested.. [optional] # noqa: E501 + logs_live_indexed_count (int): Contains the number of live log events indexed (data available as of December 1, 2020).. [optional] # noqa: E501 + logs_live_ingested_bytes (int): Contains the number of live log bytes ingested (data available as of December 1, 2020).. [optional] # noqa: E501 + logs_rehydrated_indexed_count (int): Contains the number of rehydrated log events indexed (data available as of December 1, 2020).. [optional] # noqa: E501 + logs_rehydrated_ingested_bytes (int): Contains the number of rehydrated log bytes ingested (data available as of December 1, 2020).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_logs_response.py b/src/datadog_api_client/v1/model/usage_logs_response.py index 5b0976ee3c..853b249a25 100644 --- a/src/datadog_api_client/v1/model/usage_logs_response.py +++ b/src/datadog_api_client/v1/model/usage_logs_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageLogsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageLogsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageLogsHour]): An array of objects regarding hourly usage of logs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_metric_category.py b/src/datadog_api_client/v1/model/usage_metric_category.py index f542662195..27b750b4d3 100644 --- a/src/datadog_api_client/v1/model/usage_metric_category.py +++ b/src/datadog_api_client/v1/model/usage_metric_category.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageMetricCategory(ModelSimple): @@ -51,7 +53,23 @@ class UsageMetricCategory(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageMetricCategory - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Contains the metric category.., must be one of ["standard", "custom", ] # noqa: E501 + + Keyword Args: + value (str): Contains the metric category.., must be one of ["standard", "custom", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_network_flows_hour.py b/src/datadog_api_client/v1/model/usage_network_flows_hour.py index 47eab2ef67..a161977fe7 100644 --- a/src/datadog_api_client/v1/model/usage_network_flows_hour.py +++ b/src/datadog_api_client/v1/model/usage_network_flows_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageNetworkFlowsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageNetworkFlowsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageNetworkFlowsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + indexed_event_count (int): Contains the number of netflow events indexed.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_network_flows_response.py b/src/datadog_api_client/v1/model/usage_network_flows_response.py index 311300d363..ec214ee1bd 100644 --- a/src/datadog_api_client/v1/model/usage_network_flows_response.py +++ b/src/datadog_api_client/v1/model/usage_network_flows_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageNetworkFlowsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageNetworkFlowsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageNetworkFlowsHour]): Get hourly usage for Network Flows.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_network_hosts_hour.py b/src/datadog_api_client/v1/model/usage_network_hosts_hour.py index a9b5d5d18c..2312021a38 100644 --- a/src/datadog_api_client/v1/model/usage_network_hosts_hour.py +++ b/src/datadog_api_client/v1/model/usage_network_hosts_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageNetworkHostsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageNetworkHostsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageNetworkHostsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + host_count (int): Contains the number of active NPM hosts.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_network_hosts_response.py b/src/datadog_api_client/v1/model/usage_network_hosts_response.py index 174ad9f92b..ce54703436 100644 --- a/src/datadog_api_client/v1/model/usage_network_hosts_response.py +++ b/src/datadog_api_client/v1/model/usage_network_hosts_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageNetworkHostsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageNetworkHostsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageNetworkHostsHour]): Get hourly usage for NPM hosts.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_profiling_hour.py b/src/datadog_api_client/v1/model/usage_profiling_hour.py index b48e208ed1..535bbf1560 100644 --- a/src/datadog_api_client/v1/model/usage_profiling_hour.py +++ b/src/datadog_api_client/v1/model/usage_profiling_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageProfilingHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageProfilingHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageProfilingHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + avg_container_agent_count (int): Get average number of container agents for that hour.. [optional] # noqa: E501 + host_count (int): Contains the total number of profiled hosts reporting during a given hour.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_profiling_response.py b/src/datadog_api_client/v1/model/usage_profiling_response.py index 90abbfb280..5794f2c219 100644 --- a/src/datadog_api_client/v1/model/usage_profiling_response.py +++ b/src/datadog_api_client/v1/model/usage_profiling_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageProfilingResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageProfilingResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageProfilingHour]): Get hourly usage for profiled hosts.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_reports_type.py b/src/datadog_api_client/v1/model/usage_reports_type.py index d09714518c..d488f2b401 100644 --- a/src/datadog_api_client/v1/model/usage_reports_type.py +++ b/src/datadog_api_client/v1/model/usage_reports_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageReportsType(ModelSimple): @@ -50,7 +52,23 @@ class UsageReportsType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageReportsType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of reports.. if omitted defaults to "reports", must be one of ["reports", ] # noqa: E501 + + Keyword Args: + value (str): The type of reports.. if omitted defaults to "reports", must be one of ["reports", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "reports" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_rum_sessions_hour.py b/src/datadog_api_client/v1/model/usage_rum_sessions_hour.py index 7c1f609bde..eb735b2482 100644 --- a/src/datadog_api_client/v1/model/usage_rum_sessions_hour.py +++ b/src/datadog_api_client/v1/model/usage_rum_sessions_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageRumSessionsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageRumSessionsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageRumSessionsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + session_count (int): Contains the number of RUM Sessions.. [optional] # noqa: E501 + session_count_android (int): Contains the number of mobile RUM Sessions on Android (data available beginning December 1, 2020).. [optional] # noqa: E501 + session_count_ios (int): Contains the number of mobile RUM Sessions on iOS (data available beginning December 1, 2020).. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_rum_sessions_response.py b/src/datadog_api_client/v1/model/usage_rum_sessions_response.py index 36f7e28fb2..707c03cddd 100644 --- a/src/datadog_api_client/v1/model/usage_rum_sessions_response.py +++ b/src/datadog_api_client/v1/model/usage_rum_sessions_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageRumSessionsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageRumSessionsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageRumSessionsHour]): Get hourly usage for RUM Sessions.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_snmp_hour.py b/src/datadog_api_client/v1/model/usage_snmp_hour.py index 5559ca043d..1eb5de1c25 100644 --- a/src/datadog_api_client/v1/model/usage_snmp_hour.py +++ b/src/datadog_api_client/v1/model/usage_snmp_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSNMPHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageSNMPHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSNMPHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + snmp_devices (int): Contains the number of SNMP devices.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_snmp_response.py b/src/datadog_api_client/v1/model/usage_snmp_response.py index 5f24e43803..1837aeba9a 100644 --- a/src/datadog_api_client/v1/model/usage_snmp_response.py +++ b/src/datadog_api_client/v1/model/usage_snmp_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageSNMPResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSNMPResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageSNMPHour]): Get hourly usage for SNMP devices.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_sort.py b/src/datadog_api_client/v1/model/usage_sort.py index d1ac819772..2d67a64ebd 100644 --- a/src/datadog_api_client/v1/model/usage_sort.py +++ b/src/datadog_api_client/v1/model/usage_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSort(ModelSimple): @@ -53,7 +55,23 @@ class UsageSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -176,3 +196,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The field to sort by.. if omitted defaults to "start_date", must be one of ["computed_on", "size", "start_date", "end_date", ] # noqa: E501 + + Keyword Args: + value (str): The field to sort by.. if omitted defaults to "start_date", must be one of ["computed_on", "size", "start_date", "end_date", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "start_date" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_sort_direction.py b/src/datadog_api_client/v1/model/usage_sort_direction.py index 5a91cd0666..240a02226c 100644 --- a/src/datadog_api_client/v1/model/usage_sort_direction.py +++ b/src/datadog_api_client/v1/model/usage_sort_direction.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSortDirection(ModelSimple): @@ -51,7 +53,23 @@ class UsageSortDirection(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsageSortDirection - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The direction to sort by.. if omitted defaults to "desc", must be one of ["desc", "asc", ] # noqa: E501 + + Keyword Args: + value (str): The direction to sort by.. if omitted defaults to "desc", must be one of ["desc", "asc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "desc" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/usage_specified_custom_reports_attributes.py b/src/datadog_api_client/v1/model/usage_specified_custom_reports_attributes.py index 884f303acb..b1c8e4a0e1 100644 --- a/src/datadog_api_client/v1/model/usage_specified_custom_reports_attributes.py +++ b/src/datadog_api_client/v1/model/usage_specified_custom_reports_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSpecifiedCustomReportsAttributes(ModelNormal): @@ -50,7 +52,23 @@ class UsageSpecifiedCustomReportsAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSpecifiedCustomReportsAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + computed_on (str): The date the specified custom report was computed.. [optional] # noqa: E501 + end_date (str): The ending date of specified custom report.. [optional] # noqa: E501 + location (str): A downloadable file for the specified custom reporting file.. [optional] # noqa: E501 + size (int): size. [optional] # noqa: E501 + start_date (str): The starting date of specified custom report.. [optional] # noqa: E501 + tags ([str]): A list of tags to apply to specified custom reports.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_specified_custom_reports_data.py b/src/datadog_api_client/v1/model/usage_specified_custom_reports_data.py index 8a0ad32b5d..399b157cd6 100644 --- a/src/datadog_api_client/v1/model/usage_specified_custom_reports_data.py +++ b/src/datadog_api_client/v1/model/usage_specified_custom_reports_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class UsageSpecifiedCustomReportsData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSpecifiedCustomReportsData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UsageSpecifiedCustomReportsAttributes): [optional] # noqa: E501 + id (str): The date for specified custom reports.. [optional] # noqa: E501 + type (UsageReportsType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_specified_custom_reports_meta.py b/src/datadog_api_client/v1/model/usage_specified_custom_reports_meta.py index afa92f9089..5090c63558 100644 --- a/src/datadog_api_client/v1/model/usage_specified_custom_reports_meta.py +++ b/src/datadog_api_client/v1/model/usage_specified_custom_reports_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageSpecifiedCustomReportsMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSpecifiedCustomReportsMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (UsageSpecifiedCustomReportsPage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_specified_custom_reports_page.py b/src/datadog_api_client/v1/model/usage_specified_custom_reports_page.py index 3eac743428..5ac79a265a 100644 --- a/src/datadog_api_client/v1/model/usage_specified_custom_reports_page.py +++ b/src/datadog_api_client/v1/model/usage_specified_custom_reports_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSpecifiedCustomReportsPage(ModelNormal): @@ -50,7 +52,23 @@ class UsageSpecifiedCustomReportsPage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSpecifiedCustomReportsPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_count (int): Total page count.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_specified_custom_reports_response.py b/src/datadog_api_client/v1/model/usage_specified_custom_reports_response.py index 3697de53e6..a94be19bd5 100644 --- a/src/datadog_api_client/v1/model/usage_specified_custom_reports_response.py +++ b/src/datadog_api_client/v1/model/usage_specified_custom_reports_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageSpecifiedCustomReportsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSpecifiedCustomReportsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (UsageSpecifiedCustomReportsData): [optional] # noqa: E501 + meta (UsageSpecifiedCustomReportsMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_summary_date.py b/src/datadog_api_client/v1/model/usage_summary_date.py index 480d410e32..26c0631b95 100644 --- a/src/datadog_api_client/v1/model/usage_summary_date.py +++ b/src/datadog_api_client/v1/model/usage_summary_date.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageSummaryDate(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -169,6 +188,125 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSummaryDate - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_host_top99p (int): Shows the 99th percentile of all agent hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + apm_azure_app_service_host_top99p (int): Shows the 99th percentile of all Azure app services using APM over all hours in the current date all organizations.. [optional] # noqa: E501 + apm_host_top99p (int): Shows the 99th percentile of all distinct APM hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + audit_logs_lines_indexed_sum (int): Shows the sum of audit logs lines indexed over all hours in the current date for all organizations.. [optional] # noqa: E501 + aws_host_top99p (int): Shows the 99th percentile of all AWS hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + aws_lambda_func_count (int): Shows the average of the number of functions that executed 1 or more times each hour in the current date for all organizations.. [optional] # noqa: E501 + aws_lambda_invocations_sum (int): Shows the sum of all AWS Lambda invocations over all hours in the current date for all organizations.. [optional] # noqa: E501 + azure_app_service_top99p (int): Shows the 99th percentile of all Azure app services over all hours in the current date for all organizations.. [optional] # noqa: E501 + billable_ingested_bytes_sum (int): Shows the sum of all log bytes ingested over all hours in the current date for all organizations.. [optional] # noqa: E501 + container_avg (int): Shows the average of all distinct containers over all hours in the current date for all organizations.. [optional] # noqa: E501 + container_hwm (int): Shows the high-water mark of all distinct containers over all hours in the current date for all organizations.. [optional] # noqa: E501 + cspm_container_avg (int): Shows the average number of Cloud Security Posture Management containers over all hours in the current date for all organizations.. [optional] # noqa: E501 + cspm_container_hwm (int): Shows the high-water mark of Cloud Security Posture Management containers over all hours in the current date for all organizations.. [optional] # noqa: E501 + cspm_host_top99p (int): Shows the 99th percentile of all Cloud Security Posture Management hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + custom_ts_avg (int): Shows the average number of distinct custom metrics over all hours in the current date for all organizations.. [optional] # noqa: E501 + cws_container_count_avg (int): Shows the average of all distinct Cloud Workload Security containers over all hours in the current date for all organizations.. [optional] # noqa: E501 + cws_host_top99p (int): Shows the 99th percentile of all Cloud Workload Security hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + date (datetime): The date for the usage.. [optional] # noqa: E501 + fargate_tasks_count_avg (int): Shows the high-watermark of all Fargate tasks over all hours in the current date for all organizations.. [optional] # noqa: E501 + fargate_tasks_count_hwm (int): Shows the average of all Fargate tasks over all hours in the current date for all organizations.. [optional] # noqa: E501 + gcp_host_top99p (int): Shows the 99th percentile of all GCP hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + heroku_host_top99p (int): Shows the 99th percentile of all Heroku dynos over all hours in the current date for all organizations.. [optional] # noqa: E501 + incident_management_monthly_active_users_hwm (int): Shows the high-water mark of incident management monthly active users over all hours in the current date for all organizations.. [optional] # noqa: E501 + indexed_events_count_sum (int): Shows the sum of all log events indexed over all hours in the current date for all organizations.. [optional] # noqa: E501 + infra_host_top99p (int): Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + ingested_events_bytes_sum (int): Shows the sum of all log bytes ingested over all hours in the current date for all organizations.. [optional] # noqa: E501 + iot_device_sum (int): Shows the sum of all IoT devices over all hours in the current date for all organizations.. [optional] # noqa: E501 + iot_device_top99p (int): Shows the 99th percentile of all IoT devices over all hours in the current date all organizations.. [optional] # noqa: E501 + mobile_rum_session_count_android_sum (int): Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for all organizations.. [optional] # noqa: E501 + mobile_rum_session_count_ios_sum (int): Shows the sum of all mobile RUM Sessions on iOS over all hours in the current date for all organizations.. [optional] # noqa: E501 + mobile_rum_session_count_sum (int): Shows the sum of all mobile RUM Sessions over all hours in the current date for all organizations. [optional] # noqa: E501 + netflow_indexed_events_count_sum (int): Shows the sum of all Network flows indexed over all hours in the current date for all organizations.. [optional] # noqa: E501 + npm_host_top99p (int): Shows the 99th percentile of all distinct Networks hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + opentelemetry_host_top99p (int): Shows the 99th percentile of all hosts reported by the Datadog exporter for the OpenTelemetry Collector over all hours in the current date for all organizations.. [optional] # noqa: E501 + orgs ([UsageSummaryDateOrg]): Organizations associated with a user.. [optional] # noqa: E501 + profiling_host_top99p (int): Shows the 99th percentile of all profiled hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + rum_session_count_sum (int): Shows the sum of all browser RUM Sessions over all hours in the current date for all organizations. [optional] # noqa: E501 + rum_total_session_count_sum (int): Shows the sum of RUM Sessions (browser and mobile) over all hours in the current date for all organizations.. [optional] # noqa: E501 + synthetics_browser_check_calls_count_sum (int): Shows the sum of all Synthetic browser tests over all hours in the current date for all organizations.. [optional] # noqa: E501 + synthetics_check_calls_count_sum (int): Shows the sum of all Synthetic API tests over all hours in the current date for all organizations.. [optional] # noqa: E501 + trace_search_indexed_events_count_sum (int): Shows the sum of all Indexed Spans indexed over all hours in the current date for all organizations.. [optional] # noqa: E501 + twol_ingested_events_bytes_sum (int): Shows the sum of all tracing without limits bytes ingested over all hours in the current date for all organizations.. [optional] # noqa: E501 + vsphere_host_top99p (int): Shows the 99th percentile of all vSphere hosts over all hours in the current date for all organizations.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -294,3 +432,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_summary_date_org.py b/src/datadog_api_client/v1/model/usage_summary_date_org.py index 2f51715ef9..08c10fd41a 100644 --- a/src/datadog_api_client/v1/model/usage_summary_date_org.py +++ b/src/datadog_api_client/v1/model/usage_summary_date_org.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSummaryDateOrg(ModelNormal): @@ -50,7 +52,23 @@ class UsageSummaryDateOrg(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -164,6 +182,126 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSummaryDateOrg - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_host_top99p (int): Shows the 99th percentile of all agent hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + apm_azure_app_service_host_top99p (int): Shows the 99th percentile of all Azure app services using APM over all hours in the current date for the given org.. [optional] # noqa: E501 + apm_host_top99p (int): Shows the 99th percentile of all distinct APM hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + audit_logs_lines_indexed_sum (int): Shows the sum of all audit logs lines indexed over all hours in the current date for the given org.. [optional] # noqa: E501 + aws_host_top99p (int): Shows the 99th percentile of all AWS hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + aws_lambda_func_count (int): Shows the sum of all AWS Lambda invocations over all hours in the current date for the given org.. [optional] # noqa: E501 + aws_lambda_invocations_sum (int): Shows the sum of all AWS Lambda invocations over all hours in the current date for the given org.. [optional] # noqa: E501 + azure_app_service_top99p (int): Shows the 99th percentile of all Azure app services over all hours in the current date for the given org.. [optional] # noqa: E501 + billable_ingested_bytes_sum (int): Shows the sum of all log bytes ingested over all hours in the current date for the given org.. [optional] # noqa: E501 + container_avg (int): Shows the average of all distinct containers over all hours in the current date for the given org.. [optional] # noqa: E501 + container_hwm (int): Shows the high-water mark of all distinct containers over all hours in the current date for the given org.. [optional] # noqa: E501 + cspm_container_avg (int): Shows the average number of Cloud Security Posture Management containers over all hours in the current date for the given org.. [optional] # noqa: E501 + cspm_container_hwm (int): Shows the high-water mark of Cloud Security Posture Management containers over all hours in the current date for the given org.. [optional] # noqa: E501 + cspm_host_top99p (int): Shows the 99th percentile of all Cloud Security Posture Management hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + custom_ts_avg (int): Shows the average number of distinct custom metrics over all hours in the current date for the given org.. [optional] # noqa: E501 + cws_container_count_avg (int): Shows the average of all distinct Cloud Workload Security containers over all hours in the current date for the given org.. [optional] # noqa: E501 + cws_host_top99p (int): Shows the 99th percentile of all Cloud Workload Security hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + fargate_tasks_count_avg (int): The average task count for Fargate.. [optional] # noqa: E501 + fargate_tasks_count_hwm (int): Shows the high-water mark of all Fargate tasks over all hours in the current date for the given org.. [optional] # noqa: E501 + gcp_host_top99p (int): Shows the 99th percentile of all GCP hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + heroku_host_top99p (int): Shows the 99th percentile of all Heroku dynos over all hours in the current date for the given org.. [optional] # noqa: E501 + id (str): The organization id.. [optional] # noqa: E501 + incident_management_monthly_active_users_hwm (int): Shows the high-water mark of incident management monthly active users over all hours in the current date for the given org.. [optional] # noqa: E501 + indexed_events_count_sum (int): Shows the sum of all log events indexed over all hours in the current date for the given org.. [optional] # noqa: E501 + infra_host_top99p (int): Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + ingested_events_bytes_sum (int): Shows the sum of all log bytes ingested over all hours in the current date for the given org.. [optional] # noqa: E501 + iot_device_agg_sum (int): Shows the sum of all IoT devices over all hours in the current date for the given org.. [optional] # noqa: E501 + iot_device_top99p_sum (int): Shows the 99th percentile of all IoT devices over all hours in the current date for the given org.. [optional] # noqa: E501 + mobile_rum_session_count_android_sum (int): Shows the sum of all mobile RUM Sessions on Android over all hours in the current date for the given org.. [optional] # noqa: E501 + mobile_rum_session_count_ios_sum (int): Shows the sum of all mobile RUM Sessions on iOS over all hours in the current date for the given org.. [optional] # noqa: E501 + mobile_rum_session_count_sum (int): Shows the sum of all mobile RUM Sessions over all hours in the current date for the given org.. [optional] # noqa: E501 + name (str): The organization name.. [optional] # noqa: E501 + netflow_indexed_events_count_sum (int): Shows the sum of all Network flows indexed over all hours in the current date for the given org.. [optional] # noqa: E501 + npm_host_top99p (int): Shows the 99th percentile of all distinct Networks hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + opentelemetry_host_top99p (int): Shows the 99th percentile of all hosts reported by the Datadog exporter for the OpenTelemetry Collector over all hours in the current date for the given org.. [optional] # noqa: E501 + profiling_host_top99p (int): Shows the 99th percentile of all profiled hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + public_id (str): The organization public id.. [optional] # noqa: E501 + rum_session_count_sum (int): Shows the sum of all browser RUM Sessions over all hours in the current date for the given org.. [optional] # noqa: E501 + rum_total_session_count_sum (int): Shows the sum of RUM Sessions (browser and mobile) over all hours in the current date for the given org.. [optional] # noqa: E501 + synthetics_browser_check_calls_count_sum (int): Shows the sum of all Synthetic browser tests over all hours in the current date for the given org.. [optional] # noqa: E501 + synthetics_check_calls_count_sum (int): Shows the sum of all Synthetic API tests over all hours in the current date for the given org.. [optional] # noqa: E501 + trace_search_indexed_events_count_sum (int): Shows the sum of all Indexed Spans indexed over all hours in the current date for the given org.. [optional] # noqa: E501 + twol_ingested_events_bytes_sum (int): Shows the sum of all tracing without limits bytes ingested over all hours in the current date for the given org.. [optional] # noqa: E501 + vsphere_host_top99p (int): Shows the 99th percentile of all vSphere hosts over all hours in the current date for the given org.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -290,3 +428,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_summary_response.py b/src/datadog_api_client/v1/model/usage_summary_response.py index 720c3ab3dc..9cdc48f549 100644 --- a/src/datadog_api_client/v1/model/usage_summary_response.py +++ b/src/datadog_api_client/v1/model/usage_summary_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageSummaryResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -189,6 +208,134 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSummaryResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_host_top99p_sum (int): Shows the 99th percentile of all agent hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + apm_azure_app_service_host_top99p_sum (int): Shows the 99th percentile of all Azure app services using APM over all hours in the current months all organizations.. [optional] # noqa: E501 + apm_host_top99p_sum (int): Shows the 99th percentile of all distinct APM hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + audit_logs_lines_indexed_agg_sum (int): Shows the sum of all audit logs lines indexed over all hours in the current months for all organizations.. [optional] # noqa: E501 + aws_host_top99p_sum (int): Shows the 99th percentile of all AWS hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + aws_lambda_func_count (int): Shows the average of the number of functions that executed 1 or more times each hour in the current months for all organizations.. [optional] # noqa: E501 + aws_lambda_invocations_sum (int): Shows the sum of all AWS Lambda invocations over all hours in the current months for all organizations.. [optional] # noqa: E501 + azure_app_service_top99p_sum (int): Shows the 99th percentile of all Azure app services over all hours in the current months for all organizations.. [optional] # noqa: E501 + azure_host_top99p_sum (int): Shows the 99th percentile of all Azure hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + billable_ingested_bytes_agg_sum (int): Shows the sum of all log bytes ingested over all hours in the current months for all organizations.. [optional] # noqa: E501 + container_avg_sum (int): Shows the average of all distinct containers over all hours in the current months for all organizations.. [optional] # noqa: E501 + container_hwm_sum (int): Shows the sum of the high-water marks of all distinct containers over all hours in the current months for all organizations.. [optional] # noqa: E501 + cspm_container_avg_sum (int): Shows the average number of Cloud Security Posture Management containers over all hours in the current months for all organizations.. [optional] # noqa: E501 + cspm_container_hwm_sum (int): Shows the sum of the the high-water marks of Cloud Security Posture Management containers over all hours in the current months for all organizations.. [optional] # noqa: E501 + cspm_host_top99p_sum (int): Shows the 99th percentile of all Cloud Security Posture Management hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + custom_ts_sum (int): Shows the average number of distinct custom metrics over all hours in the current months for all organizations.. [optional] # noqa: E501 + cws_containers_avg_sum (int): Shows the average of all distinct Cloud Workload Security containers over all hours in the current months for all organizations.. [optional] # noqa: E501 + cws_host_top99p_sum (int): Shows the 99th percentile of all Cloud Workload Security hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + end_date (datetime): Shows the last date of usage in the current months for all organizations.. [optional] # noqa: E501 + fargate_tasks_count_avg_sum (int): Shows the average of all Fargate tasks over all hours in the current months for all organizations.. [optional] # noqa: E501 + fargate_tasks_count_hwm_sum (int): Shows the sum of the high-water marks of all Fargate tasks over all hours in the current months for all organizations.. [optional] # noqa: E501 + gcp_host_top99p_sum (int): Shows the 99th percentile of all GCP hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + heroku_host_top99p_sum (int): Shows the 99th percentile of all Heroku dynos over all hours in the current months for all organizations.. [optional] # noqa: E501 + incident_management_monthly_active_users_hwm_sum (int): Shows sum of the the high-water marks of incident management monthly active users in the current months for all organizations.. [optional] # noqa: E501 + indexed_events_count_agg_sum (int): Shows the sum of all log events indexed over all hours in the current months for all organizations.. [optional] # noqa: E501 + infra_host_top99p_sum (int): Shows the 99th percentile of all distinct infrastructure hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + ingested_events_bytes_agg_sum (int): Shows the sum of all log bytes ingested over all hours in the current months for all organizations.. [optional] # noqa: E501 + iot_device_agg_sum (int): Shows the sum of all IoT devices over all hours in the current months for all organizations.. [optional] # noqa: E501 + iot_device_top99p_sum (int): Shows the 99th percentile of all IoT devices over all hours in the current months of all organizations.. [optional] # noqa: E501 + last_updated (datetime): Shows the the most recent hour in the current months for all organizations for which all usages were calculated.. [optional] # noqa: E501 + live_indexed_events_agg_sum (int): Shows the sum of all live logs indexed over all hours in the current months for all organizations (data available as of December 1, 2020).. [optional] # noqa: E501 + live_ingested_bytes_agg_sum (int): Shows the sum of all live logs bytes ingested over all hours in the current months for all organizations (data available as of December 1, 2020).. [optional] # noqa: E501 + logs_by_retention (LogsByRetention): [optional] # noqa: E501 + mobile_rum_session_count_agg_sum (int): Shows the sum of all mobile RUM Sessions over all hours in the current months for all organizations.. [optional] # noqa: E501 + mobile_rum_session_count_android_agg_sum (int): Shows the sum of all mobile RUM Sessions on Android over all hours in the current months for all organizations.. [optional] # noqa: E501 + mobile_rum_session_count_ios_agg_sum (int): Shows the sum of all mobile RUM Sessions on iOS over all hours in the current months for all organizations.. [optional] # noqa: E501 + netflow_indexed_events_count_agg_sum (int): Shows the sum of all Network flows indexed over all hours in the current months for all organizations.. [optional] # noqa: E501 + npm_host_top99p_sum (int): Shows the 99th percentile of all distinct Networks hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + opentelemetry_host_top99p_sum (int): Shows the 99th percentile of all hosts reported by the Datadog exporter for the OpenTelemetry Collector over all hours in the current months for all organizations.. [optional] # noqa: E501 + profiling_container_agent_count_avg (int): Shows the average number of profiled containers over all hours in the current months for all organizations.. [optional] # noqa: E501 + profiling_host_count_top99p_sum (int): Shows the 99th percentile of all profiled hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + rehydrated_indexed_events_agg_sum (int): Shows the sum of all rehydrated logs indexed over all hours in the current months for all organizations (data available as of December 1, 2020).. [optional] # noqa: E501 + rehydrated_ingested_bytes_agg_sum (int): Shows the sum of all rehydrated logs bytes ingested over all hours in the current months for all organizations (data available as of December 1, 2020).. [optional] # noqa: E501 + rum_session_count_agg_sum (int): Shows the sum of all browser RUM Sessions over all hours in the current months for all organizations.. [optional] # noqa: E501 + rum_total_session_count_agg_sum (int): Shows the sum of RUM Sessions (browser and mobile) over all hours in the current months for all organizations.. [optional] # noqa: E501 + start_date (datetime): Shows the first date of usage in the current months for all organizations.. [optional] # noqa: E501 + synthetics_browser_check_calls_count_agg_sum (int): Shows the sum of all Synthetic browser tests over all hours in the current months for all organizations.. [optional] # noqa: E501 + synthetics_check_calls_count_agg_sum (int): Shows the sum of all Synthetic API tests over all hours in the current months for all organizations.. [optional] # noqa: E501 + trace_search_indexed_events_count_agg_sum (int): Shows the sum of all Indexed Spans indexed over all hours in the current months for all organizations.. [optional] # noqa: E501 + twol_ingested_events_bytes_agg_sum (int): Shows the sum of all tracing without limits bytes ingested over all hours in the current months for all organizations.. [optional] # noqa: E501 + usage ([UsageSummaryDate]): An array of objects regarding hourly usage.. [optional] # noqa: E501 + vsphere_host_top99p_sum (int): Shows the 99th percentile of all vSphere hosts over all hours in the current months for all organizations.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -323,3 +470,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_synthetics_api_hour.py b/src/datadog_api_client/v1/model/usage_synthetics_api_hour.py index 66676158b4..5b63f48081 100644 --- a/src/datadog_api_client/v1/model/usage_synthetics_api_hour.py +++ b/src/datadog_api_client/v1/model/usage_synthetics_api_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSyntheticsAPIHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageSyntheticsAPIHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSyntheticsAPIHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + check_calls_count (int): Contains the number of Synthetics API tests run.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_synthetics_api_response.py b/src/datadog_api_client/v1/model/usage_synthetics_api_response.py index 79a313c81b..a64cb32977 100644 --- a/src/datadog_api_client/v1/model/usage_synthetics_api_response.py +++ b/src/datadog_api_client/v1/model/usage_synthetics_api_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageSyntheticsAPIResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSyntheticsAPIResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageSyntheticsAPIHour]): Get hourly usage for Synthetics API tests.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_synthetics_browser_hour.py b/src/datadog_api_client/v1/model/usage_synthetics_browser_hour.py index 6cdfd3dadc..fc6a1da64b 100644 --- a/src/datadog_api_client/v1/model/usage_synthetics_browser_hour.py +++ b/src/datadog_api_client/v1/model/usage_synthetics_browser_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSyntheticsBrowserHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageSyntheticsBrowserHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSyntheticsBrowserHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + browser_check_calls_count (int): Contains the number of Synthetics Browser tests run.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_synthetics_browser_response.py b/src/datadog_api_client/v1/model/usage_synthetics_browser_response.py index 5c6282f2da..25de5d0cbe 100644 --- a/src/datadog_api_client/v1/model/usage_synthetics_browser_response.py +++ b/src/datadog_api_client/v1/model/usage_synthetics_browser_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageSyntheticsBrowserResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSyntheticsBrowserResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageSyntheticsBrowserHour]): Get hourly usage for Synthetics Browser tests.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_synthetics_hour.py b/src/datadog_api_client/v1/model/usage_synthetics_hour.py index 4d6173b578..3e58870235 100644 --- a/src/datadog_api_client/v1/model/usage_synthetics_hour.py +++ b/src/datadog_api_client/v1/model/usage_synthetics_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageSyntheticsHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageSyntheticsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSyntheticsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + check_calls_count (int): Contains the number of Synthetics API tests run.. [optional] # noqa: E501 + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_synthetics_response.py b/src/datadog_api_client/v1/model/usage_synthetics_response.py index 285ded605f..d90f39640a 100644 --- a/src/datadog_api_client/v1/model/usage_synthetics_response.py +++ b/src/datadog_api_client/v1/model/usage_synthetics_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageSyntheticsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageSyntheticsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageSyntheticsHour]): Array with the number of hourly Synthetics test run for a given organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_timeseries_hour.py b/src/datadog_api_client/v1/model/usage_timeseries_hour.py index 91c680eabf..3c22e46e70 100644 --- a/src/datadog_api_client/v1/model/usage_timeseries_hour.py +++ b/src/datadog_api_client/v1/model/usage_timeseries_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UsageTimeseriesHour(ModelNormal): @@ -50,7 +52,23 @@ class UsageTimeseriesHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageTimeseriesHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + hour (datetime): The hour for the usage.. [optional] # noqa: E501 + num_custom_input_timeseries (int): Contains the number of custom metrics that are inputs for aggregations (metric configured is custom).. [optional] # noqa: E501 + num_custom_output_timeseries (int): Contains the number of custom metrics that are outputs for aggregations (metric configured is custom).. [optional] # noqa: E501 + num_custom_timeseries (int): Contains the number of non-aggregation custom metrics.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_timeseries_response.py b/src/datadog_api_client/v1/model/usage_timeseries_response.py index cb42ce640b..c5c44b0bd9 100644 --- a/src/datadog_api_client/v1/model/usage_timeseries_response.py +++ b/src/datadog_api_client/v1/model/usage_timeseries_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageTimeseriesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageTimeseriesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + usage ([UsageTimeseriesHour]): An array of objects regarding hourly usage of timeseries.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_top_avg_metrics_hour.py b/src/datadog_api_client/v1/model/usage_top_avg_metrics_hour.py index c325bc4587..bba0db5c67 100644 --- a/src/datadog_api_client/v1/model/usage_top_avg_metrics_hour.py +++ b/src/datadog_api_client/v1/model/usage_top_avg_metrics_hour.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageTopAvgMetricsHour(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageTopAvgMetricsHour - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + avg_metric_hour (int): Average number of timeseries per hour in which the metric occurs.. [optional] # noqa: E501 + max_metric_hour (int): Maximum number of timeseries per hour in which the metric occurs.. [optional] # noqa: E501 + metric_category (UsageMetricCategory): [optional] # noqa: E501 + metric_name (str): Contains the custom metric name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_top_avg_metrics_metadata.py b/src/datadog_api_client/v1/model/usage_top_avg_metrics_metadata.py index e99a739b55..2187f11e59 100644 --- a/src/datadog_api_client/v1/model/usage_top_avg_metrics_metadata.py +++ b/src/datadog_api_client/v1/model/usage_top_avg_metrics_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UsageTopAvgMetricsMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageTopAvgMetricsMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + day (datetime): The day value from the user request that contains the returned usage data. (If day was used the request). [optional] # noqa: E501 + month (datetime): The month value from the user request that contains the returned usage data. (If month was used the request). [optional] # noqa: E501 + pagination (UsageAttributionPagination): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/usage_top_avg_metrics_response.py b/src/datadog_api_client/v1/model/usage_top_avg_metrics_response.py index 33c89070a3..4f5b950016 100644 --- a/src/datadog_api_client/v1/model/usage_top_avg_metrics_response.py +++ b/src/datadog_api_client/v1/model/usage_top_avg_metrics_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UsageTopAvgMetricsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsageTopAvgMetricsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + metadata (UsageTopAvgMetricsMetadata): [optional] # noqa: E501 + usage ([UsageTopAvgMetricsHour]): Number of hourly recorded custom metrics for a given organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/user.py b/src/datadog_api_client/v1/model/user.py index da5922cb90..4c99519792 100644 --- a/src/datadog_api_client/v1/model/user.py +++ b/src/datadog_api_client/v1/model/user.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class User(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + access_role (AccessRole): [optional] # noqa: E501 + disabled (bool): The new disabled status of the user.. [optional] # noqa: E501 + email (str): The new email of the user.. [optional] # noqa: E501 + handle (str): The user handle, must be a valid email.. [optional] # noqa: E501 + icon (str): Gravatar icon associated to the user.. [optional] # noqa: E501 + name (str): The name of the user.. [optional] # noqa: E501 + verified (bool): Whether or not the user logged in Datadog at least once.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +288,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/user_disable_response.py b/src/datadog_api_client/v1/model/user_disable_response.py index 0bdafef6d9..9c604145ed 100644 --- a/src/datadog_api_client/v1/model/user_disable_response.py +++ b/src/datadog_api_client/v1/model/user_disable_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class UserDisableResponse(ModelNormal): @@ -50,7 +52,23 @@ class UserDisableResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserDisableResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + message (str): Information pertaining to a user disabled for a given organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/user_list_response.py b/src/datadog_api_client/v1/model/user_list_response.py index cd39220a75..1c91fe2076 100644 --- a/src/datadog_api_client/v1/model/user_list_response.py +++ b/src/datadog_api_client/v1/model/user_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + users ([User]): Array of users.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/user_response.py b/src/datadog_api_client/v1/model/user_response.py index 4707f48e91..63f7e86ec2 100644 --- a/src/datadog_api_client/v1/model/user_response.py +++ b/src/datadog_api_client/v1/model/user_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + user (User): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget.py b/src/datadog_api_client/v1/model/widget.py index 07802feff5..861d18df5e 100644 --- a/src/datadog_api_client/v1/model/widget.py +++ b/src/datadog_api_client/v1/model/widget.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class Widget(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, definition, *args, **kwargs): # noqa: E501 + """Widget - a model defined in OpenAPI + + Args: + definition (WidgetDefinition): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (int): ID of the widget.. [optional] # noqa: E501 + layout (WidgetLayout): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.definition = definition + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, definition, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_aggregator.py b/src/datadog_api_client/v1/model/widget_aggregator.py index e799ceaca3..f8739a2a0d 100644 --- a/src/datadog_api_client/v1/model/widget_aggregator.py +++ b/src/datadog_api_client/v1/model/widget_aggregator.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetAggregator(ModelSimple): @@ -54,7 +56,23 @@ class WidgetAggregator(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetAggregator - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Aggregator used for the request.., must be one of ["avg", "last", "max", "min", "sum", ] # noqa: E501 + + Keyword Args: + value (str): Aggregator used for the request.., must be one of ["avg", "last", "max", "min", "sum", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_axis.py b/src/datadog_api_client/v1/model/widget_axis.py index fa30de5274..a289c29ca2 100644 --- a/src/datadog_api_client/v1/model/widget_axis.py +++ b/src/datadog_api_client/v1/model/widget_axis.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetAxis(ModelNormal): @@ -50,7 +52,23 @@ class WidgetAxis(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,6 +104,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetAxis - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_zero (bool): True includes zero.. [optional] # noqa: E501 + label (str): The label of the axis to display on the graph.. [optional] # noqa: E501 + max (str): Specifies the maximum value to show on the y-axis. It takes a number, or auto for default behavior.. [optional] if omitted the server will use the default value of "auto" # noqa: E501 + min (str): Specifies minimum value to show on the y-axis. It takes a number, or auto for default behavior.. [optional] if omitted the server will use the default value of "auto" # noqa: E501 + scale (str): Specifies the scale type. Possible values are `linear`, `log`, `sqrt`, `pow##` (e.g. `pow2`, `pow0.5` etc.).. [optional] if omitted the server will use the default value of "linear" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_change_type.py b/src/datadog_api_client/v1/model/widget_change_type.py index b5e6fa6693..8c400d0dbe 100644 --- a/src/datadog_api_client/v1/model/widget_change_type.py +++ b/src/datadog_api_client/v1/model/widget_change_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetChangeType(ModelSimple): @@ -51,7 +53,23 @@ class WidgetChangeType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetChangeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Show the absolute or the relative change.., must be one of ["absolute", "relative", ] # noqa: E501 + + Keyword Args: + value (str): Show the absolute or the relative change.., must be one of ["absolute", "relative", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_color_preference.py b/src/datadog_api_client/v1/model/widget_color_preference.py index 2d62b3de5a..24caadf0af 100644 --- a/src/datadog_api_client/v1/model/widget_color_preference.py +++ b/src/datadog_api_client/v1/model/widget_color_preference.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetColorPreference(ModelSimple): @@ -51,7 +53,23 @@ class WidgetColorPreference(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetColorPreference - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Which color to use on the widget.., must be one of ["background", "text", ] # noqa: E501 + + Keyword Args: + value (str): Which color to use on the widget.., must be one of ["background", "text", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_comparator.py b/src/datadog_api_client/v1/model/widget_comparator.py index bd92a8ce7e..2df2f7cd51 100644 --- a/src/datadog_api_client/v1/model/widget_comparator.py +++ b/src/datadog_api_client/v1/model/widget_comparator.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetComparator(ModelSimple): @@ -53,7 +55,23 @@ class WidgetComparator(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetComparator - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Comparator to apply.., must be one of [">", ">=", "<", "<=", ] # noqa: E501 + + Keyword Args: + value (str): Comparator to apply.., must be one of [">", ">=", "<", "<=", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_compare_to.py b/src/datadog_api_client/v1/model/widget_compare_to.py index 2f635f5e69..2093f42ed6 100644 --- a/src/datadog_api_client/v1/model/widget_compare_to.py +++ b/src/datadog_api_client/v1/model/widget_compare_to.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetCompareTo(ModelSimple): @@ -53,7 +55,23 @@ class WidgetCompareTo(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetCompareTo - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Timeframe used for the change comparison.., must be one of ["hour_before", "day_before", "week_before", "month_before", ] # noqa: E501 + + Keyword Args: + value (str): Timeframe used for the change comparison.., must be one of ["hour_before", "day_before", "week_before", "month_before", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_conditional_format.py b/src/datadog_api_client/v1/model/widget_conditional_format.py index 5623492617..41bd2e2a8b 100644 --- a/src/datadog_api_client/v1/model/widget_conditional_format.py +++ b/src/datadog_api_client/v1/model/widget_conditional_format.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class WidgetConditionalFormat(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -103,6 +122,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, comparator, palette, value, *args, **kwargs): # noqa: E501 + """WidgetConditionalFormat - a model defined in OpenAPI + + Args: + comparator (WidgetComparator): + palette (WidgetPalette): + value (float): Value for the comparator. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + custom_bg_color (str): Color palette to apply to the background, same values available as palette.. [optional] # noqa: E501 + custom_fg_color (str): Color palette to apply to the foreground, same values available as palette.. [optional] # noqa: E501 + hide_value (bool): True hides values.. [optional] # noqa: E501 + image_url (str): Displays an image as the background.. [optional] # noqa: E501 + metric (str): Metric from the request to correlate this conditional format with.. [optional] # noqa: E501 + timeframe (str): Defines the displayed timeframe.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.comparator = comparator + self.palette = palette + self.value = value + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -199,3 +308,8 @@ def __init__(self, comparator, palette, value, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_custom_link.py b/src/datadog_api_client/v1/model/widget_custom_link.py index 03129ae8f0..b96dbccb58 100644 --- a/src/datadog_api_client/v1/model/widget_custom_link.py +++ b/src/datadog_api_client/v1/model/widget_custom_link.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetCustomLink(ModelNormal): @@ -50,7 +52,23 @@ class WidgetCustomLink(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetCustomLink - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_hidden (bool): The flag for toggling context menu link visibility.. [optional] # noqa: E501 + label (str): The label for the custom link URL. Keep the label short and descriptive. Use metrics and tags as variables.. [optional] # noqa: E501 + link (str): The URL of the custom link. URL must include `http` or `https`. A relative URL must start with `/`.. [optional] # noqa: E501 + override_label (str): The label ID that refers to a context menu link. Can be `logs`, `hosts`, `traces`, `profiles`, `processes`, `containers`, or `rum`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_definition.py b/src/datadog_api_client/v1/model/widget_definition.py index ede3fac85a..8fdffbbbbf 100644 --- a/src/datadog_api_client/v1/model/widget_definition.py +++ b/src/datadog_api_client/v1/model/widget_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -225,6 +227,190 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetDefinition - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + time (WidgetTime): [optional] # noqa: E501 + title (str): Title of the widget.. [optional] # noqa: E501 + title_align (WidgetTextAlign): [optional] # noqa: E501 + title_size (str): Size of the title.. [optional] # noqa: E501 + precision (int): Number of decimals to show. If not defined, the widget uses the raw value.. [optional] # noqa: E501 + text_align (WidgetTextAlign): [optional] # noqa: E501 + unit (str): Unit to display with the value.. [optional] # noqa: E501 + custom_links ([WidgetCustomLink]): List of custom links.. [optional] # noqa: E501 + group ([str]): List of tag prefixes to group by.. [optional] # noqa: E501 + tags ([str]): List of tags used to filter the groups reporting a cluster check.. [optional] # noqa: E501 + legend_size (str): Available legend sizes for a widget. Should be one of \"0\", \"2\", \"4\", \"8\", \"16\", or \"auto\".. [optional] # noqa: E501 + markers ([WidgetMarker]): List of markers.. [optional] # noqa: E501 + show_legend (bool): Whether or not to display the legend on this widget.. [optional] # noqa: E501 + xaxis (WidgetAxis): [optional] # noqa: E501 + yaxis (WidgetAxis): [optional] # noqa: E501 + event_size (WidgetEventSize): [optional] # noqa: E501 + tags_execution (str): The execution method for multi-value filters. Can be either and or or.. [optional] # noqa: E501 + color (str): Color of the text.. [optional] # noqa: E501 + font_size (str): Size of the text.. [optional] # noqa: E501 + background_color (str): Background color of the note.. [optional] # noqa: E501 + banner_img (str): URL of image to display as a banner for the group.. [optional] # noqa: E501 + show_title (bool): Whether to show the title or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + events ([WidgetEvent]): List of widget events.. [optional] # noqa: E501 + no_group_hosts (bool): Whether to show the hosts that don’t fit in a group.. [optional] # noqa: E501 + no_metric_hosts (bool): Whether to show the hosts with no metrics.. [optional] # noqa: E501 + node_type (WidgetNodeType): [optional] # noqa: E501 + notes (str): Notes on the title.. [optional] # noqa: E501 + scope ([str]): List of tags used to filter the map.. [optional] # noqa: E501 + has_background (bool): Whether to display a background or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + has_border (bool): Whether to display a border or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + horizontal_align (WidgetHorizontalAlign): [optional] # noqa: E501 + margin (WidgetMargin): [optional] # noqa: E501 + sizing (WidgetImageSizing): [optional] # noqa: E501 + url_dark_theme (str): URL of the image in dark mode.. [optional] # noqa: E501 + vertical_align (WidgetVerticalAlign): [optional] # noqa: E501 + columns ([str]): Which columns to display on the widget.. [optional] # noqa: E501 + indexes ([str]): An array of index names to query in the stream. Use [] to query all indexes at once.. [optional] # noqa: E501 + logset (str): ID of the log set to use.. [optional] # noqa: E501 + message_display (WidgetMessageDisplay): [optional] # noqa: E501 + show_date_column (bool): Whether to show the date column or not. [optional] # noqa: E501 + show_message_column (bool): Whether to show the message column or not. [optional] # noqa: E501 + sort (WidgetMonitorSummarySort): [optional] # noqa: E501 + color_preference (WidgetColorPreference): [optional] # noqa: E501 + count (int): The number of monitors to display.. [optional] # noqa: E501 + display_format (WidgetServiceSummaryDisplayFormat): [optional] # noqa: E501 + hide_zero_counts (bool): Whether to show counts of 0 or not.. [optional] # noqa: E501 + show_last_triggered (bool): Whether to show the time that has elapsed since the monitor/group triggered.. [optional] # noqa: E501 + start (int): The start of the list. Typically 0.. [optional] # noqa: E501 + summary_type (WidgetSummaryType): [optional] # noqa: E501 + has_padding (bool): Whether to add padding or not.. [optional] if omitted the server will use the default value of True # noqa: E501 + show_tick (bool): Whether to show a tick or not.. [optional] # noqa: E501 + tick_edge (WidgetTickEdge): [optional] # noqa: E501 + tick_pos (str): Where to position the tick on an edge.. [optional] # noqa: E501 + autoscale (bool): Whether to use auto-scaling or not.. [optional] # noqa: E501 + custom_unit (str): Display a unit of your choice on the widget.. [optional] # noqa: E501 + color_by_groups ([str]): List of groups used for colors.. [optional] # noqa: E501 + global_time_target (str): Defined global time target.. [optional] # noqa: E501 + show_error_budget (bool): Defined error budget.. [optional] # noqa: E501 + slo_id (str): ID of the SLO displayed.. [optional] # noqa: E501 + time_windows ([WidgetTimeWindows]): Times being monitored.. [optional] # noqa: E501 + view_mode (WidgetViewMode): [optional] # noqa: E501 + show_breakdown (bool): Whether to show the latency breakdown or not.. [optional] # noqa: E501 + show_distribution (bool): Whether to show the latency distribution or not.. [optional] # noqa: E501 + show_errors (bool): Whether to show the error metrics or not.. [optional] # noqa: E501 + show_hits (bool): Whether to show the hits metrics or not.. [optional] # noqa: E501 + show_latency (bool): Whether to show the latency metrics or not.. [optional] # noqa: E501 + show_resource_list (bool): Whether to show the resource list or not.. [optional] # noqa: E501 + size_format (WidgetSizeFormat): [optional] # noqa: E501 + has_search_bar (TableWidgetHasSearchBar): [optional] # noqa: E501 + legend_columns ([TimeseriesWidgetLegendColumn]): Columns displayed in the legend.. [optional] # noqa: E501 + legend_layout (TimeseriesWidgetLegendLayout): [optional] # noqa: E501 + right_yaxis (WidgetAxis): [optional] # noqa: E501 + alert_id (str): ID of the alert to use in the widget.. [optional] # noqa: E501 + type (ListStreamWidgetDefinitionType): [optional] # noqa: E501 + viz_type (WidgetVizType): [optional] # noqa: E501 + requests ([ListStreamWidgetRequest]): Request payload used to query items.. [optional] # noqa: E501 + check (str): Name of the check to use in the widget.. [optional] # noqa: E501 + group_by (TreeMapGroupBy): [optional] # noqa: E501 + grouping (WidgetGrouping): [optional] # noqa: E501 + query (str): Query to filter the monitors with.. [optional] # noqa: E501 + text (str): Text to display.. [optional] # noqa: E501 + style (HostMapWidgetDefinitionStyle): [optional] # noqa: E501 + view (GeomapWidgetDefinitionView): [optional] # noqa: E501 + layout_type (WidgetLayoutType): [optional] # noqa: E501 + widgets ([Widget]): List of widget groups.. [optional] # noqa: E501 + url (str): URL of the image.. [optional] # noqa: E501 + content (str): Content of the note.. [optional] # noqa: E501 + view_type (str): Type of view displayed by the widget.. [optional] if omitted the server will use the default value of "detail" # noqa: E501 + filters ([str]): Your environment and primary tag (or * if enabled for your account).. [optional] # noqa: E501 + service (str): APM service.. [optional] # noqa: E501 + env (str): APM environment.. [optional] # noqa: E501 + span_name (str): APM span name.. [optional] # noqa: E501 + color_by (TreeMapColorBy): [optional] # noqa: E501 + size_by (TreeMapSizeBy): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -401,28 +587,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v1/model/widget_display_type.py b/src/datadog_api_client/v1/model/widget_display_type.py index 3e95b34337..dbc57e2f86 100644 --- a/src/datadog_api_client/v1/model/widget_display_type.py +++ b/src/datadog_api_client/v1/model/widget_display_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetDisplayType(ModelSimple): @@ -52,7 +54,23 @@ class WidgetDisplayType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetDisplayType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of display to use for the request.., must be one of ["area", "bars", "line", ] # noqa: E501 + + Keyword Args: + value (str): Type of display to use for the request.., must be one of ["area", "bars", "line", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_event.py b/src/datadog_api_client/v1/model/widget_event.py index 044f12aac3..c1a88d3a1f 100644 --- a/src/datadog_api_client/v1/model/widget_event.py +++ b/src/datadog_api_client/v1/model/widget_event.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetEvent(ModelNormal): @@ -50,7 +52,23 @@ class WidgetEvent(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, q, *args, **kwargs): # noqa: E501 + """WidgetEvent - a model defined in OpenAPI + + Args: + q (str): Query definition. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tags_execution (str): The execution method for multi-value filters.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.q = q + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +266,8 @@ def __init__(self, q, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_event_size.py b/src/datadog_api_client/v1/model/widget_event_size.py index 432ccabc10..51c1393f26 100644 --- a/src/datadog_api_client/v1/model/widget_event_size.py +++ b/src/datadog_api_client/v1/model/widget_event_size.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetEventSize(ModelSimple): @@ -51,7 +53,23 @@ class WidgetEventSize(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetEventSize - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Size to use to display an event.., must be one of ["s", "l", ] # noqa: E501 + + Keyword Args: + value (str): Size to use to display an event.., must be one of ["s", "l", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_field_sort.py b/src/datadog_api_client/v1/model/widget_field_sort.py index 0306f181ec..e4c4e93771 100644 --- a/src/datadog_api_client/v1/model/widget_field_sort.py +++ b/src/datadog_api_client/v1/model/widget_field_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class WidgetFieldSort(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, column, order, *args, **kwargs): # noqa: E501 + """WidgetFieldSort - a model defined in OpenAPI + + Args: + column (str): Facet path for the column + order (WidgetSort): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.column = column + self.order = order + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, column, order, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_formula.py b/src/datadog_api_client/v1/model/widget_formula.py index 40f5c90305..77470f9b1c 100644 --- a/src/datadog_api_client/v1/model/widget_formula.py +++ b/src/datadog_api_client/v1/model/widget_formula.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class WidgetFormula(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, formula, *args, **kwargs): # noqa: E501 + """WidgetFormula - a model defined in OpenAPI + + Args: + formula (str): String expression built from queries, formulas, and functions. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + alias (str): Expression alias.. [optional] # noqa: E501 + cell_display_mode (TableWidgetCellDisplayMode): [optional] # noqa: E501 + conditional_formats ([WidgetConditionalFormat]): List of conditional formats.. [optional] # noqa: E501 + limit (WidgetFormulaLimit): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.formula = formula + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -187,3 +290,8 @@ def __init__(self, formula, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_formula_limit.py b/src/datadog_api_client/v1/model/widget_formula_limit.py index 8ff496dc06..1f7b6c186d 100644 --- a/src/datadog_api_client/v1/model/widget_formula_limit.py +++ b/src/datadog_api_client/v1/model/widget_formula_limit.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class WidgetFormulaLimit(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetFormulaLimit - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + count (int): Number of results to return.. [optional] # noqa: E501 + order (QuerySortOrder): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_grouping.py b/src/datadog_api_client/v1/model/widget_grouping.py index d1e4b62798..c382a4269e 100644 --- a/src/datadog_api_client/v1/model/widget_grouping.py +++ b/src/datadog_api_client/v1/model/widget_grouping.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetGrouping(ModelSimple): @@ -51,7 +53,23 @@ class WidgetGrouping(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetGrouping - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The kind of grouping to use.., must be one of ["check", "cluster", ] # noqa: E501 + + Keyword Args: + value (str): The kind of grouping to use.., must be one of ["check", "cluster", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_horizontal_align.py b/src/datadog_api_client/v1/model/widget_horizontal_align.py index 7173a462e8..ba7f730fd6 100644 --- a/src/datadog_api_client/v1/model/widget_horizontal_align.py +++ b/src/datadog_api_client/v1/model/widget_horizontal_align.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetHorizontalAlign(ModelSimple): @@ -52,7 +54,23 @@ class WidgetHorizontalAlign(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetHorizontalAlign - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Horizontal alignment.., must be one of ["center", "left", "right", ] # noqa: E501 + + Keyword Args: + value (str): Horizontal alignment.., must be one of ["center", "left", "right", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_image_sizing.py b/src/datadog_api_client/v1/model/widget_image_sizing.py index a3e521b54d..4f67895e35 100644 --- a/src/datadog_api_client/v1/model/widget_image_sizing.py +++ b/src/datadog_api_client/v1/model/widget_image_sizing.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetImageSizing(ModelSimple): @@ -57,7 +59,23 @@ class WidgetImageSizing(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -81,6 +99,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -184,3 +204,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetImageSizing - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): How to size the image on the widget. The values are based on the image `object-fit` CSS properties. **Note**: `zoom`, `fit` and `center` values are deprecated.., must be one of ["fill", "contain", "cover", "none", "scale-down", "zoom", "fit", "center", ] # noqa: E501 + + Keyword Args: + value (str): How to size the image on the widget. The values are based on the image `object-fit` CSS properties. **Note**: `zoom`, `fit` and `center` values are deprecated.., must be one of ["fill", "contain", "cover", "none", "scale-down", "zoom", "fit", "center", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_layout.py b/src/datadog_api_client/v1/model/widget_layout.py index d03a70e793..ab61148800 100644 --- a/src/datadog_api_client/v1/model/widget_layout.py +++ b/src/datadog_api_client/v1/model/widget_layout.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetLayout(ModelNormal): @@ -63,7 +65,23 @@ class WidgetLayout(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +117,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, height, width, x, y, *args, **kwargs): # noqa: E501 + """WidgetLayout - a model defined in OpenAPI + + Args: + height (int): The height of the widget. Should be a non-negative integer. + width (int): The width of the widget. Should be a non-negative integer. + x (int): The position of the widget on the x (horizontal) axis. Should be a non-negative integer. + y (int): The position of the widget on the y (vertical) axis. Should be a non-negative integer. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + is_column_break (bool): Whether the widget should be the first one on the second column in high density or not. **Note**: Only for the **new dashboard layout** and only one widget in the dashboard should have this property set to `true`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.height = height + self.width = width + self.x = x + self.y = y + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +297,8 @@ def __init__(self, height, width, x, y, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_layout_type.py b/src/datadog_api_client/v1/model/widget_layout_type.py index 43aa326c27..47a938aac5 100644 --- a/src/datadog_api_client/v1/model/widget_layout_type.py +++ b/src/datadog_api_client/v1/model/widget_layout_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetLayoutType(ModelSimple): @@ -50,7 +52,23 @@ class WidgetLayoutType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetLayoutType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Layout type of the group.. if omitted defaults to "ordered", must be one of ["ordered", ] # noqa: E501 + + Keyword Args: + value (str): Layout type of the group.. if omitted defaults to "ordered", must be one of ["ordered", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "ordered" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_line_type.py b/src/datadog_api_client/v1/model/widget_line_type.py index 0725b6e6ab..3962ecbc79 100644 --- a/src/datadog_api_client/v1/model/widget_line_type.py +++ b/src/datadog_api_client/v1/model/widget_line_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetLineType(ModelSimple): @@ -52,7 +54,23 @@ class WidgetLineType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetLineType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of lines displayed.., must be one of ["dashed", "dotted", "solid", ] # noqa: E501 + + Keyword Args: + value (str): Type of lines displayed.., must be one of ["dashed", "dotted", "solid", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_line_width.py b/src/datadog_api_client/v1/model/widget_line_width.py index 8716877ea8..590dcb8999 100644 --- a/src/datadog_api_client/v1/model/widget_line_width.py +++ b/src/datadog_api_client/v1/model/widget_line_width.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetLineWidth(ModelSimple): @@ -52,7 +54,23 @@ class WidgetLineWidth(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetLineWidth - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Width of line displayed.., must be one of ["normal", "thick", "thin", ] # noqa: E501 + + Keyword Args: + value (str): Width of line displayed.., must be one of ["normal", "thick", "thin", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_live_span.py b/src/datadog_api_client/v1/model/widget_live_span.py index a729c0f638..93b9b6b339 100644 --- a/src/datadog_api_client/v1/model/widget_live_span.py +++ b/src/datadog_api_client/v1/model/widget_live_span.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetLiveSpan(ModelSimple): @@ -64,7 +66,23 @@ class WidgetLiveSpan(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -191,3 +211,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetLiveSpan - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The available timeframes depend on the widget you are using.., must be one of ["1m", "5m", "10m", "15m", "30m", "1h", "4h", "1d", "2d", "1w", "1mo", "3mo", "6mo", "1y", "alert", ] # noqa: E501 + + Keyword Args: + value (str): The available timeframes depend on the widget you are using.., must be one of ["1m", "5m", "10m", "15m", "30m", "1h", "4h", "1d", "2d", "1w", "1mo", "3mo", "6mo", "1y", "alert", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_margin.py b/src/datadog_api_client/v1/model/widget_margin.py index a6f22206d0..a5f135d727 100644 --- a/src/datadog_api_client/v1/model/widget_margin.py +++ b/src/datadog_api_client/v1/model/widget_margin.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetMargin(ModelSimple): @@ -54,7 +56,23 @@ class WidgetMargin(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetMargin - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Size of the margins around the image. **Note**: `small` and `large` values are deprecated.., must be one of ["sm", "md", "lg", "small", "large", ] # noqa: E501 + + Keyword Args: + value (str): Size of the margins around the image. **Note**: `small` and `large` values are deprecated.., must be one of ["sm", "md", "lg", "small", "large", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_marker.py b/src/datadog_api_client/v1/model/widget_marker.py index c4eb04f0d7..71db75aa47 100644 --- a/src/datadog_api_client/v1/model/widget_marker.py +++ b/src/datadog_api_client/v1/model/widget_marker.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetMarker(ModelNormal): @@ -50,7 +52,23 @@ class WidgetMarker(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, value, *args, **kwargs): # noqa: E501 + """WidgetMarker - a model defined in OpenAPI + + Args: + value (str): Value to apply. Can be a single value y = 15 or a range of values 0 < y < 10. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + display_type (str): Combination of: - A severity error, warning, ok, or info - A line type: dashed, solid, or bold In this case of a Distribution widget, this can be set to be `x_axis_percentile`. . [optional] # noqa: E501 + label (str): Label to display over the marker.. [optional] # noqa: E501 + time (str): Timestamp for the widget.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.value = value + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +274,8 @@ def __init__(self, value, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_message_display.py b/src/datadog_api_client/v1/model/widget_message_display.py index 76f19637d5..1dc74badd8 100644 --- a/src/datadog_api_client/v1/model/widget_message_display.py +++ b/src/datadog_api_client/v1/model/widget_message_display.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetMessageDisplay(ModelSimple): @@ -52,7 +54,23 @@ class WidgetMessageDisplay(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetMessageDisplay - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Amount of log lines to display., must be one of ["inline", "expanded-md", "expanded-lg", ] # noqa: E501 + + Keyword Args: + value (str): Amount of log lines to display., must be one of ["inline", "expanded-md", "expanded-lg", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_monitor_summary_display_format.py b/src/datadog_api_client/v1/model/widget_monitor_summary_display_format.py index 950b21c74c..9476260da2 100644 --- a/src/datadog_api_client/v1/model/widget_monitor_summary_display_format.py +++ b/src/datadog_api_client/v1/model/widget_monitor_summary_display_format.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetMonitorSummaryDisplayFormat(ModelSimple): @@ -52,7 +54,23 @@ class WidgetMonitorSummaryDisplayFormat(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetMonitorSummaryDisplayFormat - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): What to display on the widget.., must be one of ["counts", "countsAndList", "list", ] # noqa: E501 + + Keyword Args: + value (str): What to display on the widget.., must be one of ["counts", "countsAndList", "list", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_monitor_summary_sort.py b/src/datadog_api_client/v1/model/widget_monitor_summary_sort.py index 759029a905..f3f7f147fe 100644 --- a/src/datadog_api_client/v1/model/widget_monitor_summary_sort.py +++ b/src/datadog_api_client/v1/model/widget_monitor_summary_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetMonitorSummarySort(ModelSimple): @@ -64,7 +66,23 @@ class WidgetMonitorSummarySort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,6 +106,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -191,3 +211,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetMonitorSummarySort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Widget sorting methods.., must be one of ["name", "group", "status", "tags", "triggered", "group,asc", "group,desc", "name,asc", "name,desc", "status,asc", "status,desc", "tags,asc", "tags,desc", "triggered,asc", "triggered,desc", ] # noqa: E501 + + Keyword Args: + value (str): Widget sorting methods.., must be one of ["name", "group", "status", "tags", "triggered", "group,asc", "group,desc", "name,asc", "name,desc", "status,asc", "status,desc", "tags,asc", "tags,desc", "triggered,asc", "triggered,desc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_node_type.py b/src/datadog_api_client/v1/model/widget_node_type.py index ce05e0db80..bbadeea3d6 100644 --- a/src/datadog_api_client/v1/model/widget_node_type.py +++ b/src/datadog_api_client/v1/model/widget_node_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetNodeType(ModelSimple): @@ -51,7 +53,23 @@ class WidgetNodeType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetNodeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Which type of node to use in the map.., must be one of ["host", "container", ] # noqa: E501 + + Keyword Args: + value (str): Which type of node to use in the map.., must be one of ["host", "container", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_order_by.py b/src/datadog_api_client/v1/model/widget_order_by.py index 49e4d2896d..07339a02ca 100644 --- a/src/datadog_api_client/v1/model/widget_order_by.py +++ b/src/datadog_api_client/v1/model/widget_order_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetOrderBy(ModelSimple): @@ -53,7 +55,23 @@ class WidgetOrderBy(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetOrderBy - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): What to order by.., must be one of ["change", "name", "present", "past", ] # noqa: E501 + + Keyword Args: + value (str): What to order by.., must be one of ["change", "name", "present", "past", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_palette.py b/src/datadog_api_client/v1/model/widget_palette.py index fbeac46414..58dd53e609 100644 --- a/src/datadog_api_client/v1/model/widget_palette.py +++ b/src/datadog_api_client/v1/model/widget_palette.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetPalette(ModelSimple): @@ -68,7 +70,23 @@ class WidgetPalette(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,6 +110,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -195,3 +215,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetPalette - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Color palette to apply.., must be one of ["blue", "custom_bg", "custom_image", "custom_text", "gray_on_white", "grey", "green", "orange", "red", "red_on_white", "white_on_gray", "white_on_green", "green_on_white", "white_on_red", "white_on_yellow", "yellow_on_white", "black_on_light_yellow", "black_on_light_green", "black_on_light_red", ] # noqa: E501 + + Keyword Args: + value (str): Color palette to apply.., must be one of ["blue", "custom_bg", "custom_image", "custom_text", "gray_on_white", "grey", "green", "orange", "red", "red_on_white", "white_on_gray", "white_on_green", "green_on_white", "white_on_red", "white_on_yellow", "yellow_on_white", "black_on_light_yellow", "black_on_light_green", "black_on_light_red", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_request_style.py b/src/datadog_api_client/v1/model/widget_request_style.py index d6c87ccd7c..a5041a32b5 100644 --- a/src/datadog_api_client/v1/model/widget_request_style.py +++ b/src/datadog_api_client/v1/model/widget_request_style.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class WidgetRequestStyle(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetRequestStyle - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + line_type (WidgetLineType): [optional] # noqa: E501 + line_width (WidgetLineWidth): [optional] # noqa: E501 + palette (str): Color palette to apply to the widget.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_service_summary_display_format.py b/src/datadog_api_client/v1/model/widget_service_summary_display_format.py index 73267a135f..984a908a27 100644 --- a/src/datadog_api_client/v1/model/widget_service_summary_display_format.py +++ b/src/datadog_api_client/v1/model/widget_service_summary_display_format.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetServiceSummaryDisplayFormat(ModelSimple): @@ -52,7 +54,23 @@ class WidgetServiceSummaryDisplayFormat(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetServiceSummaryDisplayFormat - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Number of columns to display.., must be one of ["one_column", "two_column", "three_column", ] # noqa: E501 + + Keyword Args: + value (str): Number of columns to display.., must be one of ["one_column", "two_column", "three_column", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_size_format.py b/src/datadog_api_client/v1/model/widget_size_format.py index d240e61419..a1cbeec9af 100644 --- a/src/datadog_api_client/v1/model/widget_size_format.py +++ b/src/datadog_api_client/v1/model/widget_size_format.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetSizeFormat(ModelSimple): @@ -52,7 +54,23 @@ class WidgetSizeFormat(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetSizeFormat - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Size of the widget.., must be one of ["small", "medium", "large", ] # noqa: E501 + + Keyword Args: + value (str): Size of the widget.., must be one of ["small", "medium", "large", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_sort.py b/src/datadog_api_client/v1/model/widget_sort.py index ddf89303db..b80d81069f 100644 --- a/src/datadog_api_client/v1/model/widget_sort.py +++ b/src/datadog_api_client/v1/model/widget_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetSort(ModelSimple): @@ -51,7 +53,23 @@ class WidgetSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Widget sorting methods.., must be one of ["asc", "desc", ] # noqa: E501 + + Keyword Args: + value (str): Widget sorting methods.., must be one of ["asc", "desc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_style.py b/src/datadog_api_client/v1/model/widget_style.py index 260ae79c70..63244d60aa 100644 --- a/src/datadog_api_client/v1/model/widget_style.py +++ b/src/datadog_api_client/v1/model/widget_style.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetStyle(ModelNormal): @@ -50,7 +52,23 @@ class WidgetStyle(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetStyle - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + palette (str): Color palette to apply to the widget.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_summary_type.py b/src/datadog_api_client/v1/model/widget_summary_type.py index 6ffb77c9b7..fee8460794 100644 --- a/src/datadog_api_client/v1/model/widget_summary_type.py +++ b/src/datadog_api_client/v1/model/widget_summary_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetSummaryType(ModelSimple): @@ -52,7 +54,23 @@ class WidgetSummaryType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetSummaryType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Which summary type should be used.., must be one of ["monitors", "groups", "combined", ] # noqa: E501 + + Keyword Args: + value (str): Which summary type should be used.., must be one of ["monitors", "groups", "combined", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_text_align.py b/src/datadog_api_client/v1/model/widget_text_align.py index 66e95b7530..eb4dca7a52 100644 --- a/src/datadog_api_client/v1/model/widget_text_align.py +++ b/src/datadog_api_client/v1/model/widget_text_align.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetTextAlign(ModelSimple): @@ -52,7 +54,23 @@ class WidgetTextAlign(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetTextAlign - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): How to align the text on the widget.., must be one of ["center", "left", "right", ] # noqa: E501 + + Keyword Args: + value (str): How to align the text on the widget.., must be one of ["center", "left", "right", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_tick_edge.py b/src/datadog_api_client/v1/model/widget_tick_edge.py index 2929f417e7..fe6be6db3c 100644 --- a/src/datadog_api_client/v1/model/widget_tick_edge.py +++ b/src/datadog_api_client/v1/model/widget_tick_edge.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetTickEdge(ModelSimple): @@ -53,7 +55,23 @@ class WidgetTickEdge(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetTickEdge - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Define how you want to align the text on the widget.., must be one of ["bottom", "left", "right", "top", ] # noqa: E501 + + Keyword Args: + value (str): Define how you want to align the text on the widget.., must be one of ["bottom", "left", "right", "top", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_time.py b/src/datadog_api_client/v1/model/widget_time.py index ceeb7c22c3..31a7196a3c 100644 --- a/src/datadog_api_client/v1/model/widget_time.py +++ b/src/datadog_api_client/v1/model/widget_time.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class WidgetTime(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """WidgetTime - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + live_span (WidgetLiveSpan): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v1/model/widget_time_windows.py b/src/datadog_api_client/v1/model/widget_time_windows.py index 07319e8b77..a750fcc1e2 100644 --- a/src/datadog_api_client/v1/model/widget_time_windows.py +++ b/src/datadog_api_client/v1/model/widget_time_windows.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetTimeWindows(ModelSimple): @@ -57,7 +59,23 @@ class WidgetTimeWindows(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -81,6 +99,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -184,3 +204,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetTimeWindows - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Define a time window.., must be one of ["7d", "30d", "90d", "week_to_date", "previous_week", "month_to_date", "previous_month", "global_time", ] # noqa: E501 + + Keyword Args: + value (str): Define a time window.., must be one of ["7d", "30d", "90d", "week_to_date", "previous_week", "month_to_date", "previous_month", "global_time", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_vertical_align.py b/src/datadog_api_client/v1/model/widget_vertical_align.py index 3ad2d229bc..89cc5e5a1a 100644 --- a/src/datadog_api_client/v1/model/widget_vertical_align.py +++ b/src/datadog_api_client/v1/model/widget_vertical_align.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetVerticalAlign(ModelSimple): @@ -52,7 +54,23 @@ class WidgetVerticalAlign(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetVerticalAlign - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Vertical alignment.., must be one of ["center", "top", "bottom", ] # noqa: E501 + + Keyword Args: + value (str): Vertical alignment.., must be one of ["center", "top", "bottom", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_view_mode.py b/src/datadog_api_client/v1/model/widget_view_mode.py index 00667c5595..f69dc826ab 100644 --- a/src/datadog_api_client/v1/model/widget_view_mode.py +++ b/src/datadog_api_client/v1/model/widget_view_mode.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetViewMode(ModelSimple): @@ -52,7 +54,23 @@ class WidgetViewMode(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetViewMode - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Define how you want the SLO to be displayed.., must be one of ["overall", "component", "both", ] # noqa: E501 + + Keyword Args: + value (str): Define how you want the SLO to be displayed.., must be one of ["overall", "component", "both", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model/widget_viz_type.py b/src/datadog_api_client/v1/model/widget_viz_type.py index c4f56bcad3..96a924e9ec 100644 --- a/src/datadog_api_client/v1/model/widget_viz_type.py +++ b/src/datadog_api_client/v1/model/widget_viz_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v1.exceptions import ApiAttributeError class WidgetVizType(ModelSimple): @@ -51,7 +53,23 @@ class WidgetVizType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """WidgetVizType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Whether to display the Alert Graph as a timeseries or a top list.., must be one of ["timeseries", "toplist", ] # noqa: E501 + + Keyword Args: + value (str): Whether to display the Alert Graph as a timeseries or a top list.., must be one of ["timeseries", "toplist", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v1/model_utils.py b/src/datadog_api_client/v1/model_utils.py index ab1e263b7a..479990e4a0 100644 --- a/src/datadog_api_client/v1/model_utils.py +++ b/src/datadog_api_client/v1/model_utils.py @@ -24,9 +24,27 @@ file_type = io.IOBase +def convert_js_args_to_python_args(fn): + from functools import wraps + + @wraps(fn) + def wrapped_init(_self, *args, **kwargs): + """ + An attribute named `self` received from the api will conflicts with the reserved `self` + parameter of a class method. During generation, `self` attributes are mapped + to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. + """ + spec_property_naming = kwargs.get("_spec_property_naming", False) + if spec_property_naming: + kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) + return fn(_self, *args, **kwargs) + + return wrapped_init + + class cached_property(object): # this caches the result of the function call for fn with no inputs - # use this as a decorator on fuction methods that you want converted + # use this as a decorator on function methods that you want converted # into cached properties result_key = "_results" @@ -249,6 +267,109 @@ def __new__(cls, *args, **kwargs): new_inst.__init__(*args, **kwargs) return new_inst + @classmethod + @convert_js_args_to_python_args + def _new_from_openapi_data(cls, *args, **kwargs): + # this function uses the discriminator to + # pick a new schema/class to instantiate because a discriminator + # propertyName value was passed in + + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + + visited_composed_classes = kwargs.get("_visited_composed_classes", ()) + if cls.discriminator is None or cls in visited_composed_classes: + # Use case 1: this openapi schema (cls) does not have a discriminator + # Use case 2: we have already visited this class before and are sure that we + # want to instantiate it this time. We have visited this class deserializing + # a payload with a discriminator. During that process we traveled through + # this class but did not make an instance of it. Now we are making an + # instance of a composed class which contains cls in it, so this time make an instance of cls. + # + # Here's an example of use case 2: If Animal has a discriminator + # petType and we pass in "Dog", and the class Dog + # allOf includes Animal, we move through Animal + # once using the discriminator, and pick Dog. + # Then in the composed schema dog Dog, we will make an instance of the + # Animal class (because Dal has allOf: Animal) but this time we won't travel + # through Animal's discriminator because we passed in + # _visited_composed_classes = (Animal,) + + return cls._from_openapi_data(*args, **kwargs) + + # Get the name and value of the discriminator property. + # The discriminator name is obtained from the discriminator meta-data + # and the discriminator value is obtained from the input data. + discr_propertyname_py = list(cls.discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if discr_propertyname_js in kwargs: + discr_value = kwargs[discr_propertyname_js] + elif discr_propertyname_py in kwargs: + discr_value = kwargs[discr_propertyname_py] + else: + # The input data does not contain the discriminator property. + path_to_item = kwargs.get("_path_to_item", ()) + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) + ) + + # Implementation note: the last argument to get_discriminator_class + # is a list of visited classes. get_discriminator_class may recursively + # call itself and update the list of visited classes, and the initial + # value must be an empty list. Hence not using 'visited_composed_classes' + new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) + if new_cls is None: + path_to_item = kwargs.get("_path_to_item", ()) + disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) + raise ApiValueError( + "Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) + ) + + if new_cls in visited_composed_classes: + # if we are making an instance of a composed schema Descendent + # which allOf includes Ancestor, then Ancestor contains + # a discriminator that includes Descendent. + # So if we make an instance of Descendent, we have to make an + # instance of Ancestor to hold the allOf properties. + # This code detects that use case and makes the instance of Ancestor + # For example: + # When making an instance of Dog, _visited_composed_classes = (Dog,) + # then we make an instance of Animal to include in dog._composed_instances + # so when we are here, cls is Animal + # cls.discriminator != None + # cls not in _visited_composed_classes + # new_cls = Dog + # but we know we know that we already have Dog + # because it is in visited_composed_classes + # so make Animal here + return cls._from_openapi_data(*args, **kwargs) + + # Build a list containing all oneOf and anyOf descendants. + oneof_anyof_classes = None + if cls._composed_schemas is not None: + oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_child = new_cls in oneof_anyof_classes + kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) + + if cls._composed_schemas.get("allOf") and oneof_anyof_child: + # Validate that we can make self because when we make the + # new_cls it will not include the allOf validations in self + self_inst = cls._from_openapi_data(*args, **kwargs) + + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) + return new_inst + class ModelSimple(OpenApiModel): """the parent class of models whose type != object in their @@ -396,22 +517,42 @@ def __setitem__(self, name, value): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__["_var_name_to_model_instances"][name] = model_instance - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -421,12 +562,12 @@ def get(self, name, default=None): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -1102,17 +1243,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, configu ) if issubclass(model_class, ModelSimple): - return model_class(model_data, **kw_args) + return model_class._new_from_openapi_data(model_data, **kw_args) elif isinstance(model_data, list): - if issubclass(model_class, ModelComposed) and allows_single_value_input(model_class): - return model_class(model_data, **kw_args) - else: - return model_class(*model_data, **kw_args) + return model_class._new_from_openapi_data(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - return model_class(**kw_args) + return model_class._new_from_openapi_data(**kw_args) elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class(model_data, **kw_args) + return model_class._new_from_openapi_data(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1405,20 +1543,34 @@ def model_to_dict(model_instance, serialize=True): model_instances = [model_instance] if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) + seen_json_attribute_names = set() + used_fallback_python_attribute_names = set() + py_to_json_map = {} for model_instance in model_instances: for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map - attr = model_instance.attribute_map.get(attr, attr) + try: + attr = model_instance.attribute_map[attr] + py_to_json_map.update(model_instance.attribute_map) + seen_json_attribute_names.add(attr) + except KeyError: + used_fallback_python_attribute_names.add(attr) if isinstance(value, list): - if not value or isinstance(value[0], PRIMITIVE_TYPES): - # empty list or primitive types + if not value: + # empty list or None result[attr] = value - elif isinstance(value[0], ModelSimple): - result[attr] = [x.value for x in value] else: - result[attr] = [model_to_dict(x, serialize=serialize) if x is not None else None for x in value] + res = [] + for v in value: + if isinstance(v, PRIMITIVE_TYPES) or v is None: + res.append(v) + elif isinstance(v, ModelSimple): + res.append(v.value) + else: + res.append(model_to_dict(v, serialize=serialize)) + result[attr] = res elif isinstance(value, dict): result[attr] = dict( map( @@ -1434,6 +1586,16 @@ def model_to_dict(model_instance, serialize=True): result[attr] = model_to_dict(value, serialize=serialize) else: result[attr] = value + if serialize: + for python_key in used_fallback_python_attribute_names: + json_key = py_to_json_map.get(python_key) + if json_key is None: + continue + if python_key == json_key: + continue + json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names + if json_key_assigned_no_need_for_python_key: + del result[python_key] return result @@ -1472,27 +1634,19 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def convert_js_args_to_python_args(fn): - from functools import wraps - - @wraps(fn) - def wrapped_init(self, *args, **kwargs): - spec_property_naming = kwargs.get("_spec_property_naming", False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, self.__class__) - return fn(self, *args, **kwargs) - - return wrapped_init - - def get_allof_instances(self, model_args, constant_args): """ Args: self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1500,20 +1654,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas["allOf"]: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1568,30 +1710,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1646,24 +1767,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1675,46 +1780,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances(composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas["allOf"]: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1758,29 +1851,37 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances(self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = get_additional_properties_model_instances(composed_instances, self) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if ( - len(unused_args) > 0 - and len(additional_properties_model_instances) == 0 - and (self._configuration is None or not self._configuration.discard_unknown_keys) - ): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances - return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, unused_args] + return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, discarded_args] diff --git a/src/datadog_api_client/v1/openapi.yaml b/src/datadog_api_client/v1/openapi.yaml index 29b46291e4..f685af5ebe 100644 --- a/src/datadog_api_client/v1/openapi.yaml +++ b/src/datadog_api_client/v1/openapi.yaml @@ -8792,9 +8792,7 @@ components: description: The associated assertion property. type: string target: - additionalProperties: false description: Value used by the operator. - type: object type: $ref: '#/components/schemas/SyntheticsAssertionType' required: diff --git a/src/datadog_api_client/v1/rest.py b/src/datadog_api_client/v1/rest.py index 9be4f97a9f..8fcf205758 100644 --- a/src/datadog_api_client/v1/rest.py +++ b/src/datadog_api_client/v1/rest.py @@ -140,15 +140,15 @@ def request( elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) - if "Content-Type" not in headers: - headers["Content-Type"] = "application/json" - try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests + if (method != "DELETE") and ("Content-Type" not in headers): + headers["Content-Type"] = "application/json" if query_params: url += "?" + urlencode(query_params) - if re.search("json", headers["Content-Type"], re.IGNORECASE): + if ("Content-Type" not in headers) or (re.search("json", headers["Content-Type"], re.IGNORECASE)): request_body = None if body is not None: request_body = json.dumps(body) diff --git a/src/datadog_api_client/v2/api_client.py b/src/datadog_api_client/v2/api_client.py index 49d85aa055..1421c12c5a 100644 --- a/src/datadog_api_client/v2/api_client.py +++ b/src/datadog_api_client/v2/api_client.py @@ -124,7 +124,7 @@ def __call_api( _return_http_data_only: typing.Optional[bool] = None, collection_formats: typing.Optional[typing.Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, ): @@ -325,7 +325,7 @@ def call_api( _return_http_data_only: typing.Optional[bool] = None, collection_formats: typing.Optional[typing.Dict[str, str]] = None, _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, _check_type: typing.Optional[bool] = None, ): @@ -689,7 +689,7 @@ def __init__(self, settings=None, params_map=None, root_map=None, headers_map=No "async_req": (bool,), "_host_index": (none_type, int), "_preload_content": (bool,), - "_request_timeout": (none_type, int, (int,), [int]), + "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), "_return_http_data_only": (bool,), "_check_input_type": (bool,), "_check_return_type": (bool,), diff --git a/src/datadog_api_client/v2/model/api_error_response.py b/src/datadog_api_client/v2/model/api_error_response.py index 5276fce214..797b795612 100644 --- a/src/datadog_api_client/v2/model/api_error_response.py +++ b/src/datadog_api_client/v2/model/api_error_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class APIErrorResponse(ModelNormal): @@ -50,7 +52,23 @@ class APIErrorResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, errors, *args, **kwargs): # noqa: E501 + """APIErrorResponse - a model defined in OpenAPI + + Args: + errors ([str]): A list of errors. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.errors = errors + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, errors, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_create_attributes.py b/src/datadog_api_client/v2/model/api_key_create_attributes.py index 84f7be0f17..511c8e93c2 100644 --- a/src/datadog_api_client/v2/model/api_key_create_attributes.py +++ b/src/datadog_api_client/v2/model/api_key_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class APIKeyCreateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class APIKeyCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """APIKeyCreateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the API key. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_create_data.py b/src/datadog_api_client/v2/model/api_key_create_data.py index 2bad07c8a5..6155e5a978 100644 --- a/src/datadog_api_client/v2/model/api_key_create_data.py +++ b/src/datadog_api_client/v2/model/api_key_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class APIKeyCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """APIKeyCreateData - a model defined in OpenAPI + + Args: + attributes (APIKeyCreateAttributes): + type (APIKeysType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_create_request.py b/src/datadog_api_client/v2/model/api_key_create_request.py index 4019ced31d..893b4d6aca 100644 --- a/src/datadog_api_client/v2/model/api_key_create_request.py +++ b/src/datadog_api_client/v2/model/api_key_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class APIKeyCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """APIKeyCreateRequest - a model defined in OpenAPI + + Args: + data (APIKeyCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_relationships.py b/src/datadog_api_client/v2/model/api_key_relationships.py index dbaf67b41d..441f3e5218 100644 --- a/src/datadog_api_client/v2/model/api_key_relationships.py +++ b/src/datadog_api_client/v2/model/api_key_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class APIKeyRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """APIKeyRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_by (RelationshipToUser): [optional] # noqa: E501 + modified_by (RelationshipToUser): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_response.py b/src/datadog_api_client/v2/model/api_key_response.py index 21d6b546c4..a949610207 100644 --- a/src/datadog_api_client/v2/model/api_key_response.py +++ b/src/datadog_api_client/v2/model/api_key_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class APIKeyResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """APIKeyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (FullAPIKey): [optional] # noqa: E501 + included ([APIKeyResponseIncludedItem]): Array of objects related to the API key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_response_included_item.py b/src/datadog_api_client/v2/model/api_key_response_included_item.py index dd9786e656..5a7cfea2b1 100644 --- a/src/datadog_api_client/v2/model/api_key_response_included_item.py +++ b/src/datadog_api_client/v2/model/api_key_response_included_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """APIKeyResponseIncludedItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UserAttributes): [optional] # noqa: E501 + id (str): ID of the user.. [optional] # noqa: E501 + relationships (UserResponseRelationships): [optional] # noqa: E501 + type (UsersType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -187,28 +283,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/api_key_update_attributes.py b/src/datadog_api_client/v2/model/api_key_update_attributes.py index c28fcb8c62..3b3c67c606 100644 --- a/src/datadog_api_client/v2/model/api_key_update_attributes.py +++ b/src/datadog_api_client/v2/model/api_key_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class APIKeyUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class APIKeyUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """APIKeyUpdateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the API key. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_update_data.py b/src/datadog_api_client/v2/model/api_key_update_data.py index f7096ddd23..17dd13c217 100644 --- a/src/datadog_api_client/v2/model/api_key_update_data.py +++ b/src/datadog_api_client/v2/model/api_key_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class APIKeyUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """APIKeyUpdateData - a model defined in OpenAPI + + Args: + attributes (APIKeyUpdateAttributes): + id (str): ID of the API key. + type (APIKeysType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_key_update_request.py b/src/datadog_api_client/v2/model/api_key_update_request.py index 079128690e..2b0d149a5f 100644 --- a/src/datadog_api_client/v2/model/api_key_update_request.py +++ b/src/datadog_api_client/v2/model/api_key_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class APIKeyUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """APIKeyUpdateRequest - a model defined in OpenAPI + + Args: + data (APIKeyUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_keys_response.py b/src/datadog_api_client/v2/model/api_keys_response.py index f3c48866f3..24b3c54249 100644 --- a/src/datadog_api_client/v2/model/api_keys_response.py +++ b/src/datadog_api_client/v2/model/api_keys_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class APIKeysResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """APIKeysResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([PartialAPIKey]): Array of API keys.. [optional] # noqa: E501 + included ([APIKeyResponseIncludedItem]): Array of objects related to the API key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/api_keys_sort.py b/src/datadog_api_client/v2/model/api_keys_sort.py index 98ccfb4d08..fe65c6523f 100644 --- a/src/datadog_api_client/v2/model/api_keys_sort.py +++ b/src/datadog_api_client/v2/model/api_keys_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class APIKeysSort(ModelSimple): @@ -57,7 +59,23 @@ class APIKeysSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -81,6 +99,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """APIKeysSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Sorting options. if omitted defaults to "name", must be one of ["created_at", "-created_at", "last4", "-last4", "modified_at", "-modified_at", "name", "-name", ] # noqa: E501 + + Keyword Args: + value (str): Sorting options. if omitted defaults to "name", must be one of ["created_at", "-created_at", "last4", "-last4", "modified_at", "-modified_at", "name", "-name", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "name" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/api_keys_type.py b/src/datadog_api_client/v2/model/api_keys_type.py index ad96d68a3a..da4dcbf185 100644 --- a/src/datadog_api_client/v2/model/api_keys_type.py +++ b/src/datadog_api_client/v2/model/api_keys_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class APIKeysType(ModelSimple): @@ -50,7 +52,23 @@ class APIKeysType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """APIKeysType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): API Keys resource type.. if omitted defaults to "api_keys", must be one of ["api_keys", ] # noqa: E501 + + Keyword Args: + value (str): API Keys resource type.. if omitted defaults to "api_keys", must be one of ["api_keys", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "api_keys" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/application_key_create_attributes.py b/src/datadog_api_client/v2/model/application_key_create_attributes.py index e55095371e..ad4cfaadbd 100644 --- a/src/datadog_api_client/v2/model/application_key_create_attributes.py +++ b/src/datadog_api_client/v2/model/application_key_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ApplicationKeyCreateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class ApplicationKeyCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """ApplicationKeyCreateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the application key. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_create_data.py b/src/datadog_api_client/v2/model/application_key_create_data.py index 4b3422b7e8..98b7631124 100644 --- a/src/datadog_api_client/v2/model/application_key_create_data.py +++ b/src/datadog_api_client/v2/model/application_key_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ApplicationKeyCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """ApplicationKeyCreateData - a model defined in OpenAPI + + Args: + attributes (ApplicationKeyCreateAttributes): + type (ApplicationKeysType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_create_request.py b/src/datadog_api_client/v2/model/application_key_create_request.py index 2e6cc0a1d4..95d98eb409 100644 --- a/src/datadog_api_client/v2/model/application_key_create_request.py +++ b/src/datadog_api_client/v2/model/application_key_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApplicationKeyCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """ApplicationKeyCreateRequest - a model defined in OpenAPI + + Args: + data (ApplicationKeyCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_relationships.py b/src/datadog_api_client/v2/model/application_key_relationships.py index ca9d606f73..65c52fcf55 100644 --- a/src/datadog_api_client/v2/model/application_key_relationships.py +++ b/src/datadog_api_client/v2/model/application_key_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApplicationKeyRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApplicationKeyRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_by (RelationshipToUser): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_response.py b/src/datadog_api_client/v2/model/application_key_response.py index c76cd066e5..c8248f612a 100644 --- a/src/datadog_api_client/v2/model/application_key_response.py +++ b/src/datadog_api_client/v2/model/application_key_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ApplicationKeyResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApplicationKeyResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (FullApplicationKey): [optional] # noqa: E501 + included ([ApplicationKeyResponseIncludedItem]): Array of objects related to the application key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_response_included_item.py b/src/datadog_api_client/v2/model/application_key_response_included_item.py index 320eefc040..d34f8cb567 100644 --- a/src/datadog_api_client/v2/model/application_key_response_included_item.py +++ b/src/datadog_api_client/v2/model/application_key_response_included_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -103,6 +105,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ApplicationKeyResponseIncludedItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (RoleAttributes): [optional] # noqa: E501 + id (str): ID of the role.. [optional] # noqa: E501 + relationships (RoleResponseRelationships): [optional] # noqa: E501 + type (RolesType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -189,28 +285,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/application_key_update_attributes.py b/src/datadog_api_client/v2/model/application_key_update_attributes.py index b49b5d732d..d85cec1078 100644 --- a/src/datadog_api_client/v2/model/application_key_update_attributes.py +++ b/src/datadog_api_client/v2/model/application_key_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ApplicationKeyUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class ApplicationKeyUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """ApplicationKeyUpdateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the application key. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_update_data.py b/src/datadog_api_client/v2/model/application_key_update_data.py index 678d4f17da..7013d3a6b9 100644 --- a/src/datadog_api_client/v2/model/application_key_update_data.py +++ b/src/datadog_api_client/v2/model/application_key_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ApplicationKeyUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """ApplicationKeyUpdateData - a model defined in OpenAPI + + Args: + attributes (ApplicationKeyUpdateAttributes): + id (str): ID of the application key. + type (ApplicationKeysType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_key_update_request.py b/src/datadog_api_client/v2/model/application_key_update_request.py index f685fa69ea..c617be971e 100644 --- a/src/datadog_api_client/v2/model/application_key_update_request.py +++ b/src/datadog_api_client/v2/model/application_key_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ApplicationKeyUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """ApplicationKeyUpdateRequest - a model defined in OpenAPI + + Args: + data (ApplicationKeyUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/application_keys_sort.py b/src/datadog_api_client/v2/model/application_keys_sort.py index b7d20dcdb7..6b20c65856 100644 --- a/src/datadog_api_client/v2/model/application_keys_sort.py +++ b/src/datadog_api_client/v2/model/application_keys_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ApplicationKeysSort(ModelSimple): @@ -55,7 +57,23 @@ class ApplicationKeysSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -79,6 +97,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ApplicationKeysSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Sorting options. if omitted defaults to "name", must be one of ["created_at", "-created_at", "last4", "-last4", "name", "-name", ] # noqa: E501 + + Keyword Args: + value (str): Sorting options. if omitted defaults to "name", must be one of ["created_at", "-created_at", "last4", "-last4", "name", "-name", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "name" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/application_keys_type.py b/src/datadog_api_client/v2/model/application_keys_type.py index ce6172e1ca..6972d935e3 100644 --- a/src/datadog_api_client/v2/model/application_keys_type.py +++ b/src/datadog_api_client/v2/model/application_keys_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ApplicationKeysType(ModelSimple): @@ -50,7 +52,23 @@ class ApplicationKeysType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ApplicationKeysType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Application Keys resource type.. if omitted defaults to "application_keys", must be one of ["application_keys", ] # noqa: E501 + + Keyword Args: + value (str): Application Keys resource type.. if omitted defaults to "application_keys", must be one of ["application_keys", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "application_keys" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/creator.py b/src/datadog_api_client/v2/model/creator.py index e62ca29049..1a23dc9152 100644 --- a/src/datadog_api_client/v2/model/creator.py +++ b/src/datadog_api_client/v2/model/creator.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class Creator(ModelNormal): @@ -50,7 +52,23 @@ class Creator(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Creator - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + email (str): Email of the creator.. [optional] # noqa: E501 + handle (str): Handle of the creator.. [optional] # noqa: E501 + name (str): Name of the creator.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_add_items_request.py b/src/datadog_api_client/v2/model/dashboard_list_add_items_request.py index 3aaa7c8c2a..e2b5f28397 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_add_items_request.py +++ b/src/datadog_api_client/v2/model/dashboard_list_add_items_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListAddItemsRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListAddItemsRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dashboards ([DashboardListItemRequest]): List of dashboards to add the dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_add_items_response.py b/src/datadog_api_client/v2/model/dashboard_list_add_items_response.py index 595fb2104c..f2d3d3bcad 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_add_items_response.py +++ b/src/datadog_api_client/v2/model/dashboard_list_add_items_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListAddItemsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListAddItemsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + added_dashboards_to_list ([DashboardListItemResponse]): List of dashboards added to the dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_delete_items_request.py b/src/datadog_api_client/v2/model/dashboard_list_delete_items_request.py index 1a2fa34abd..f91e3062c2 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_delete_items_request.py +++ b/src/datadog_api_client/v2/model/dashboard_list_delete_items_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListDeleteItemsRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListDeleteItemsRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dashboards ([DashboardListItemRequest]): List of dashboards to delete from the dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_delete_items_response.py b/src/datadog_api_client/v2/model/dashboard_list_delete_items_response.py index c2d3b7116e..7759b95b88 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_delete_items_response.py +++ b/src/datadog_api_client/v2/model/dashboard_list_delete_items_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListDeleteItemsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListDeleteItemsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted_dashboards_from_list ([DashboardListItemResponse]): List of dashboards deleted from the dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_item.py b/src/datadog_api_client/v2/model/dashboard_list_item.py index c48a6c97fa..874c5fc25a 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_item.py +++ b/src/datadog_api_client/v2/model/dashboard_list_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class DashboardListItem(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,98 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """DashboardListItem - a model defined in OpenAPI + + Args: + id (str): ID of the dashboard. + type (DashboardType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + author (Creator): [optional] # noqa: E501 + created (datetime): Date of creation of the dashboard.. [optional] # noqa: E501 + icon (str): URL to the icon of the dashboard.. [optional] # noqa: E501 + is_favorite (bool): Whether or not the dashboard is in the favorites.. [optional] # noqa: E501 + is_read_only (bool): Whether or not the dashboard is read only.. [optional] # noqa: E501 + is_shared (bool): Whether the dashboard is publicly shared or not.. [optional] # noqa: E501 + modified (datetime): Date of last edition of the dashboard.. [optional] # noqa: E501 + popularity (int): Popularity of the dashboard.. [optional] # noqa: E501 + title (str): Title of the dashboard.. [optional] # noqa: E501 + url (str): URL path to the dashboard.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -211,3 +322,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_item_request.py b/src/datadog_api_client/v2/model/dashboard_list_item_request.py index 560d5449f3..3d170a7322 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_item_request.py +++ b/src/datadog_api_client/v2/model/dashboard_list_item_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListItemRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """DashboardListItemRequest - a model defined in OpenAPI + + Args: + id (str): ID of the dashboard. + type (DashboardType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_item_response.py b/src/datadog_api_client/v2/model/dashboard_list_item_response.py index 7dabc424a2..9ce33980f0 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_item_response.py +++ b/src/datadog_api_client/v2/model/dashboard_list_item_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListItemResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """DashboardListItemResponse - a model defined in OpenAPI + + Args: + id (str): ID of the dashboard. + type (DashboardType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -99,11 +200,9 @@ def discriminator(): ) @convert_js_args_to_python_args - def __init__(self, id, type, *args, **kwargs): # noqa: E501 + def __init__(self, type, *args, **kwargs): # noqa: E501 """DashboardListItemResponse - a model defined in OpenAPI - Args: - id (str): ID of the dashboard. type (DashboardType): Keyword Args: @@ -163,7 +262,6 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.id = id self.type = type for var_name, var_value in kwargs.items(): if ( @@ -175,3 +273,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_items.py b/src/datadog_api_client/v2/model/dashboard_list_items.py index 6472cb669a..30ba17dca8 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_items.py +++ b/src/datadog_api_client/v2/model/dashboard_list_items.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListItems(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, dashboards, *args, **kwargs): # noqa: E501 + """DashboardListItems - a model defined in OpenAPI + + Args: + dashboards ([DashboardListItem]): List of dashboards in the dashboard list. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total (int): Number of dashboards in the dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.dashboards = dashboards + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +274,8 @@ def __init__(self, dashboards, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_update_items_request.py b/src/datadog_api_client/v2/model/dashboard_list_update_items_request.py index 81a19d7bbe..59accbcaf4 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_update_items_request.py +++ b/src/datadog_api_client/v2/model/dashboard_list_update_items_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListUpdateItemsRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListUpdateItemsRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dashboards ([DashboardListItemRequest]): List of dashboards to update the dashboard list to.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_list_update_items_response.py b/src/datadog_api_client/v2/model/dashboard_list_update_items_response.py index b40cd87da8..340d3cb7ca 100644 --- a/src/datadog_api_client/v2/model/dashboard_list_update_items_response.py +++ b/src/datadog_api_client/v2/model/dashboard_list_update_items_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class DashboardListUpdateItemsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """DashboardListUpdateItemsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + dashboards ([DashboardListItemResponse]): List of dashboards in the dashboard list.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/dashboard_type.py b/src/datadog_api_client/v2/model/dashboard_type.py index e853d56c88..dc50bcb810 100644 --- a/src/datadog_api_client/v2/model/dashboard_type.py +++ b/src/datadog_api_client/v2/model/dashboard_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class DashboardType(ModelSimple): @@ -54,7 +56,23 @@ class DashboardType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """DashboardType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the dashboard.., must be one of ["custom_timeboard", "custom_screenboard", "integration_screenboard", "integration_timeboard", "host_timeboard", ] # noqa: E501 + + Keyword Args: + value (str): The type of the dashboard.., must be one of ["custom_timeboard", "custom_screenboard", "integration_screenboard", "integration_timeboard", "host_timeboard", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/full_api_key.py b/src/datadog_api_client/v2/model/full_api_key.py index baaa1e3693..0cf10740d7 100644 --- a/src/datadog_api_client/v2/model/full_api_key.py +++ b/src/datadog_api_client/v2/model/full_api_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class FullAPIKey(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FullAPIKey - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (FullAPIKeyAttributes): [optional] # noqa: E501 + id (str): ID of the API key.. [optional] # noqa: E501 + relationships (APIKeyRelationships): [optional] # noqa: E501 + type (APIKeysType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/full_api_key_attributes.py b/src/datadog_api_client/v2/model/full_api_key_attributes.py index d516927874..6fa4112e91 100644 --- a/src/datadog_api_client/v2/model/full_api_key_attributes.py +++ b/src/datadog_api_client/v2/model/full_api_key_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class FullAPIKeyAttributes(ModelNormal): @@ -55,7 +57,23 @@ class FullAPIKeyAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +109,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FullAPIKeyAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (str): Creation date of the API key.. [optional] # noqa: E501 + key (str): The API key.. [optional] # noqa: E501 + last4 (str): The last four characters of the API key.. [optional] # noqa: E501 + modified_at (str): Date the API key was last modified.. [optional] # noqa: E501 + name (str): Name of the API key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +277,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/full_application_key.py b/src/datadog_api_client/v2/model/full_application_key.py index b78ea8a2b2..dc3de28b44 100644 --- a/src/datadog_api_client/v2/model/full_application_key.py +++ b/src/datadog_api_client/v2/model/full_application_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class FullApplicationKey(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FullApplicationKey - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (FullApplicationKeyAttributes): [optional] # noqa: E501 + id (str): ID of the application key.. [optional] # noqa: E501 + relationships (ApplicationKeyRelationships): [optional] # noqa: E501 + type (ApplicationKeysType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/full_application_key_attributes.py b/src/datadog_api_client/v2/model/full_application_key_attributes.py index b8371f63d4..2c91a07cea 100644 --- a/src/datadog_api_client/v2/model/full_application_key_attributes.py +++ b/src/datadog_api_client/v2/model/full_application_key_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class FullApplicationKeyAttributes(ModelNormal): @@ -55,7 +57,23 @@ class FullApplicationKeyAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +107,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """FullApplicationKeyAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (str): Creation date of the application key.. [optional] # noqa: E501 + key (str): The application key.. [optional] # noqa: E501 + last4 (str): The last four characters of the application key.. [optional] # noqa: E501 + name (str): Name of the application key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +273,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_create_attributes.py b/src/datadog_api_client/v2/model/incident_create_attributes.py index ecbcea7bc5..291f53eece 100644 --- a/src/datadog_api_client/v2/model/incident_create_attributes.py +++ b/src/datadog_api_client/v2/model/incident_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, customer_impacted, title, *args, **kwargs): # noqa: E501 + """IncidentCreateAttributes - a model defined in OpenAPI + + Args: + customer_impacted (bool): A flag indicating whether the incident caused customer impact. + title (str): The title of the incident, which summarizes what happened. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + fields ({str: (IncidentFieldAttributes,)}): A condensed view of the user-defined fields for which to create initial selections.. [optional] # noqa: E501 + initial_timeline_cells ([IncidentTimelineCellCreateAttributes]): An array of initial timeline cells to be placed at the beginning of the incident timeline.. [optional] # noqa: E501 + notification_handles ([str]): Notification handles that will be notified of the incident at creation.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.customer_impacted = customer_impacted + self.title = title + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +292,8 @@ def __init__(self, customer_impacted, title, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_create_data.py b/src/datadog_api_client/v2/model/incident_create_data.py index 4af769e630..715ec6d4ca 100644 --- a/src/datadog_api_client/v2/model/incident_create_data.py +++ b/src/datadog_api_client/v2/model/incident_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """IncidentCreateData - a model defined in OpenAPI + + Args: + attributes (IncidentCreateAttributes): + type (IncidentType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + relationships (IncidentCreateRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_create_relationships.py b/src/datadog_api_client/v2/model/incident_create_relationships.py index 94f9aaf16a..45b14bc063 100644 --- a/src/datadog_api_client/v2/model/incident_create_relationships.py +++ b/src/datadog_api_client/v2/model/incident_create_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentCreateRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, commander, *args, **kwargs): # noqa: E501 + """IncidentCreateRelationships - a model defined in OpenAPI + + Args: + commander (RelationshipToUser): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.commander = commander + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, commander, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_create_request.py b/src/datadog_api_client/v2/model/incident_create_request.py index 2d77d779c6..27915b0d25 100644 --- a/src/datadog_api_client/v2/model/incident_create_request.py +++ b/src/datadog_api_client/v2/model/incident_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentCreateRequest - a model defined in OpenAPI + + Args: + data (IncidentCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_field_attributes.py b/src/datadog_api_client/v2/model/incident_field_attributes.py index fbd79c96f5..aa0c975fcf 100644 --- a/src/datadog_api_client/v2/model/incident_field_attributes.py +++ b/src/datadog_api_client/v2/model/incident_field_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,98 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentFieldAttributes - a model defined in OpenAPI + + Keyword Args: + type (IncidentFieldAttributesValueType): + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + value ([str]): The multiple values selected for this field.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -116,13 +210,11 @@ def discriminator(): ) @convert_js_args_to_python_args - def __init__(self, type, *args, **kwargs): # noqa: E501 + def __init__(self, *args, **kwargs): # noqa: E501 """IncidentFieldAttributes - a model defined in OpenAPI - Args: - type (IncidentFieldAttributesValueType): - Keyword Args: + type (IncidentFieldAttributesValueType): _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -187,30 +279,27 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = { - "type": type, - } - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/incident_field_attributes_multiple_value.py b/src/datadog_api_client/v2/model/incident_field_attributes_multiple_value.py index 46b4970b79..d7cc907440 100644 --- a/src/datadog_api_client/v2/model/incident_field_attributes_multiple_value.py +++ b/src/datadog_api_client/v2/model/incident_field_attributes_multiple_value.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentFieldAttributesMultipleValue(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentFieldAttributesMultipleValue - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (IncidentFieldAttributesValueType): [optional] # noqa: E501 + value ([str]): The multiple values selected for this field.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_field_attributes_single_value.py b/src/datadog_api_client/v2/model/incident_field_attributes_single_value.py index c8ccad1f05..530fb21fc1 100644 --- a/src/datadog_api_client/v2/model/incident_field_attributes_single_value.py +++ b/src/datadog_api_client/v2/model/incident_field_attributes_single_value.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class IncidentFieldAttributesSingleValue(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentFieldAttributesSingleValue - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + type (IncidentFieldAttributesSingleValueType): [optional] # noqa: E501 + value (str): The single value selected for this field.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_field_attributes_single_value_type.py b/src/datadog_api_client/v2/model/incident_field_attributes_single_value_type.py index fbca963cd4..4716691dcb 100644 --- a/src/datadog_api_client/v2/model/incident_field_attributes_single_value_type.py +++ b/src/datadog_api_client/v2/model/incident_field_attributes_single_value_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentFieldAttributesSingleValueType(ModelSimple): @@ -51,7 +53,23 @@ class IncidentFieldAttributesSingleValueType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentFieldAttributesSingleValueType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the single value field definitions.. if omitted defaults to "dropdown", must be one of ["dropdown", "textbox", ] # noqa: E501 + + Keyword Args: + value (str): Type of the single value field definitions.. if omitted defaults to "dropdown", must be one of ["dropdown", "textbox", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "dropdown" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_field_attributes_value_type.py b/src/datadog_api_client/v2/model/incident_field_attributes_value_type.py index b101445245..a4a2352798 100644 --- a/src/datadog_api_client/v2/model/incident_field_attributes_value_type.py +++ b/src/datadog_api_client/v2/model/incident_field_attributes_value_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentFieldAttributesValueType(ModelSimple): @@ -53,7 +55,23 @@ class IncidentFieldAttributesValueType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -176,3 +196,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentFieldAttributesValueType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the single value field definitions.. if omitted defaults to "multiselect", must be one of ["multiselect", "textarray", "metrictag", "autocomplete", ] # noqa: E501 + + Keyword Args: + value (str): Type of the single value field definitions.. if omitted defaults to "multiselect", must be one of ["multiselect", "textarray", "metrictag", "autocomplete", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "multiselect" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_integration_metadata_type.py b/src/datadog_api_client/v2/model/incident_integration_metadata_type.py index 0564bde03e..5f415dba61 100644 --- a/src/datadog_api_client/v2/model/incident_integration_metadata_type.py +++ b/src/datadog_api_client/v2/model/incident_integration_metadata_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentIntegrationMetadataType(ModelSimple): @@ -50,7 +52,23 @@ class IncidentIntegrationMetadataType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentIntegrationMetadataType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Integration metadata resource type.. if omitted defaults to "incident_integrations", must be one of ["incident_integrations", ] # noqa: E501 + + Keyword Args: + value (str): Integration metadata resource type.. if omitted defaults to "incident_integrations", must be one of ["incident_integrations", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "incident_integrations" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_postmortem_type.py b/src/datadog_api_client/v2/model/incident_postmortem_type.py index d7e6f9578d..3cd7ef4498 100644 --- a/src/datadog_api_client/v2/model/incident_postmortem_type.py +++ b/src/datadog_api_client/v2/model/incident_postmortem_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentPostmortemType(ModelSimple): @@ -50,7 +52,23 @@ class IncidentPostmortemType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentPostmortemType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Incident postmortem resource type.. if omitted defaults to "incident_postmortems", must be one of ["incident_postmortems", ] # noqa: E501 + + Keyword Args: + value (str): Incident postmortem resource type.. if omitted defaults to "incident_postmortems", must be one of ["incident_postmortems", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "incident_postmortems" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_related_object.py b/src/datadog_api_client/v2/model/incident_related_object.py index 02ebbc49a6..c4065a75bb 100644 --- a/src/datadog_api_client/v2/model/incident_related_object.py +++ b/src/datadog_api_client/v2/model/incident_related_object.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentRelatedObject(ModelSimple): @@ -50,7 +52,23 @@ class IncidentRelatedObject(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentRelatedObject - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Object related to an incident.. if omitted defaults to "users", must be one of ["users", ] # noqa: E501 + + Keyword Args: + value (str): Object related to an incident.. if omitted defaults to "users", must be one of ["users", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "users" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_response.py b/src/datadog_api_client/v2/model/incident_response.py index 7270031310..2c41e9952b 100644 --- a/src/datadog_api_client/v2/model/incident_response.py +++ b/src/datadog_api_client/v2/model/incident_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class IncidentResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentResponse - a model defined in OpenAPI + + Args: + data (IncidentResponseData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + included ([IncidentResponseIncludedItem]): Included related resources that the user requested.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_response_attributes.py b/src/datadog_api_client/v2/model/incident_response_attributes.py index f961aaac1f..46c0aa935d 100644 --- a/src/datadog_api_client/v2/model/incident_response_attributes.py +++ b/src/datadog_api_client/v2/model/incident_response_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentResponseAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -134,6 +153,103 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, title, *args, **kwargs): # noqa: E501 + """IncidentResponseAttributes - a model defined in OpenAPI + + Args: + title (str): The title of the incident, which summarizes what happened. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (datetime): Timestamp when the incident was created.. [optional] # noqa: E501 + customer_impact_duration (int): Length of the incident's customer impact in seconds. Equals the difference between `customer_impact_start` and `customer_impact_end`.. [optional] # noqa: E501 + customer_impact_end (datetime, none_type): Timestamp when customers were no longer impacted by the incident.. [optional] # noqa: E501 + customer_impact_scope (str, none_type): A summary of the impact customers experienced during the incident.. [optional] # noqa: E501 + customer_impact_start (datetime, none_type): Timestamp when customers began being impacted by the incident.. [optional] # noqa: E501 + customer_impacted (bool): A flag indicating whether the incident caused customer impact.. [optional] # noqa: E501 + detected (datetime, none_type): Timestamp when the incident was detected.. [optional] # noqa: E501 + fields ({str: (IncidentFieldAttributes,)}): A condensed view of the user-defined fields attached to incidents.. [optional] # noqa: E501 + modified (datetime): Timestamp when the incident was last modified.. [optional] # noqa: E501 + notification_handles ([str]): Notification handles that will be notified of the incident during update.. [optional] # noqa: E501 + postmortem_id (str): The UUID of the postmortem object attached to the incident.. [optional] # noqa: E501 + public_id (int): The monotonically increasing integer ID for the incident.. [optional] # noqa: E501 + resolved (datetime, none_type): Timestamp when the incident's state was set to resolved.. [optional] # noqa: E501 + time_to_detect (int): The amount of time in seconds to detect the incident. Equals the difference between `customer_impact_start` and `detected`.. [optional] # noqa: E501 + time_to_internal_response (int): The amount of time in seconds to call incident after detection. Equals the difference of `detected` and `created`.. [optional] # noqa: E501 + time_to_repair (int): The amount of time in seconds to resolve customer impact after detecting the issue. Equals the difference between `customer_impact_end` and `detected`.. [optional] # noqa: E501 + time_to_resolve (int): The amount of time in seconds to resolve the incident after it was created. Equals the difference between `created` and `resolved`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.title = title + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -237,3 +353,8 @@ def __init__(self, title, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_response_data.py b/src/datadog_api_client/v2/model/incident_response_data.py index 374bd49cbe..d7b8f17d1d 100644 --- a/src/datadog_api_client/v2/model/incident_response_data.py +++ b/src/datadog_api_client/v2/model/incident_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """IncidentResponseData - a model defined in OpenAPI + + Args: + id (str): The incident's ID. + type (IncidentType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentResponseAttributes): [optional] # noqa: E501 + relationships (IncidentResponseRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +288,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_response_included_item.py b/src/datadog_api_client/v2/model/incident_response_included_item.py index bf80534792..628a35bf82 100644 --- a/src/datadog_api_client/v2/model/incident_response_included_item.py +++ b/src/datadog_api_client/v2/model/incident_response_included_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentResponseIncludedItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UserAttributes): [optional] # noqa: E501 + id (str): ID of the user.. [optional] # noqa: E501 + relationships (UserResponseRelationships): [optional] # noqa: E501 + type (UsersType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -187,28 +283,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/incident_response_relationships.py b/src/datadog_api_client/v2/model/incident_response_relationships.py index 8b9d277d47..cc16cbbad8 100644 --- a/src/datadog_api_client/v2/model/incident_response_relationships.py +++ b/src/datadog_api_client/v2/model/incident_response_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class IncidentResponseRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentResponseRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + commander_user (RelationshipToUser): [optional] # noqa: E501 + created_by_user (RelationshipToUser): [optional] # noqa: E501 + integrations (RelationshipToIncidentIntegrationMetadatas): [optional] # noqa: E501 + last_modified_by_user (RelationshipToUser): [optional] # noqa: E501 + postmortem (RelationshipToIncidentPostmortem): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +286,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_create_attributes.py b/src/datadog_api_client/v2/model/incident_service_create_attributes.py index 901ebe7bf3..c61d7bc816 100644 --- a/src/datadog_api_client/v2/model/incident_service_create_attributes.py +++ b/src/datadog_api_client/v2/model/incident_service_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentServiceCreateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class IncidentServiceCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """IncidentServiceCreateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the incident service. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_create_data.py b/src/datadog_api_client/v2/model/incident_service_create_data.py index f630163043..94f579b0b3 100644 --- a/src/datadog_api_client/v2/model/incident_service_create_data.py +++ b/src/datadog_api_client/v2/model/incident_service_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentServiceCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """IncidentServiceCreateData - a model defined in OpenAPI + + Args: + type (IncidentServiceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentServiceCreateAttributes): [optional] # noqa: E501 + relationships (IncidentServiceRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_create_request.py b/src/datadog_api_client/v2/model/incident_service_create_request.py index bffefd241d..8f632325db 100644 --- a/src/datadog_api_client/v2/model/incident_service_create_request.py +++ b/src/datadog_api_client/v2/model/incident_service_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentServiceCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentServiceCreateRequest - a model defined in OpenAPI + + Args: + data (IncidentServiceCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_included_items.py b/src/datadog_api_client/v2/model/incident_service_included_items.py index 440b7ffa5a..658ff4894f 100644 --- a/src/datadog_api_client/v2/model/incident_service_included_items.py +++ b/src/datadog_api_client/v2/model/incident_service_included_items.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentServiceIncludedItems - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UserAttributes): [optional] # noqa: E501 + id (str): ID of the user.. [optional] # noqa: E501 + relationships (UserResponseRelationships): [optional] # noqa: E501 + type (UsersType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -187,28 +283,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/incident_service_relationships.py b/src/datadog_api_client/v2/model/incident_service_relationships.py index 3b04da2a1d..2ebdd17b06 100644 --- a/src/datadog_api_client/v2/model/incident_service_relationships.py +++ b/src/datadog_api_client/v2/model/incident_service_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentServiceRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentServiceRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_by (RelationshipToUser): [optional] # noqa: E501 + last_modified_by (RelationshipToUser): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_response.py b/src/datadog_api_client/v2/model/incident_service_response.py index ce72f67632..1d2a98dc63 100644 --- a/src/datadog_api_client/v2/model/incident_service_response.py +++ b/src/datadog_api_client/v2/model/incident_service_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class IncidentServiceResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentServiceResponse - a model defined in OpenAPI + + Args: + data (IncidentServiceResponseData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + included ([IncidentServiceIncludedItems]): Included objects from relationships.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_response_attributes.py b/src/datadog_api_client/v2/model/incident_service_response_attributes.py index 90518d4e1e..51a451ed6e 100644 --- a/src/datadog_api_client/v2/model/incident_service_response_attributes.py +++ b/src/datadog_api_client/v2/model/incident_service_response_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentServiceResponseAttributes(ModelNormal): @@ -50,7 +52,23 @@ class IncidentServiceResponseAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentServiceResponseAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (datetime): Timestamp of when the incident service was created.. [optional] # noqa: E501 + modified (datetime): Timestamp of when the incident service was modified.. [optional] # noqa: E501 + name (str): Name of the incident service.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_response_data.py b/src/datadog_api_client/v2/model/incident_service_response_data.py index 31ce01cc13..b2c7d6ab04 100644 --- a/src/datadog_api_client/v2/model/incident_service_response_data.py +++ b/src/datadog_api_client/v2/model/incident_service_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentServiceResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """IncidentServiceResponseData - a model defined in OpenAPI + + Args: + id (str): The incident service's ID. + type (IncidentServiceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentServiceResponseAttributes): [optional] # noqa: E501 + relationships (IncidentServiceRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +288,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_type.py b/src/datadog_api_client/v2/model/incident_service_type.py index d070b7e8ab..3579d2ee12 100644 --- a/src/datadog_api_client/v2/model/incident_service_type.py +++ b/src/datadog_api_client/v2/model/incident_service_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentServiceType(ModelSimple): @@ -50,7 +52,23 @@ class IncidentServiceType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentServiceType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Incident service resource type.. if omitted defaults to "services", must be one of ["services", ] # noqa: E501 + + Keyword Args: + value (str): Incident service resource type.. if omitted defaults to "services", must be one of ["services", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "services" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_service_update_attributes.py b/src/datadog_api_client/v2/model/incident_service_update_attributes.py index 9d110699d6..2afac1fbb8 100644 --- a/src/datadog_api_client/v2/model/incident_service_update_attributes.py +++ b/src/datadog_api_client/v2/model/incident_service_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentServiceUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class IncidentServiceUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """IncidentServiceUpdateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the incident service. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_update_data.py b/src/datadog_api_client/v2/model/incident_service_update_data.py index 58fe87244f..d0e05a08b1 100644 --- a/src/datadog_api_client/v2/model/incident_service_update_data.py +++ b/src/datadog_api_client/v2/model/incident_service_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentServiceUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """IncidentServiceUpdateData - a model defined in OpenAPI + + Args: + type (IncidentServiceType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentServiceUpdateAttributes): [optional] # noqa: E501 + id (str): The incident service's ID.. [optional] # noqa: E501 + relationships (IncidentServiceRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +286,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_service_update_request.py b/src/datadog_api_client/v2/model/incident_service_update_request.py index f9feea9490..ed90c73410 100644 --- a/src/datadog_api_client/v2/model/incident_service_update_request.py +++ b/src/datadog_api_client/v2/model/incident_service_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentServiceUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentServiceUpdateRequest - a model defined in OpenAPI + + Args: + data (IncidentServiceUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_services_response.py b/src/datadog_api_client/v2/model/incident_services_response.py index 4684a3108e..4cde7f2b80 100644 --- a/src/datadog_api_client/v2/model/incident_services_response.py +++ b/src/datadog_api_client/v2/model/incident_services_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentServicesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentServicesResponse - a model defined in OpenAPI + + Args: + data ([IncidentServiceResponseData]): An array of incident services. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + included ([IncidentServiceIncludedItems]): Included related resources which the user requested.. [optional] # noqa: E501 + meta (IncidentServicesResponseMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_services_response_meta.py b/src/datadog_api_client/v2/model/incident_services_response_meta.py index 369a60f380..857dbc4fef 100644 --- a/src/datadog_api_client/v2/model/incident_services_response_meta.py +++ b/src/datadog_api_client/v2/model/incident_services_response_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class IncidentServicesResponseMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentServicesResponseMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + pagination (IncidentServicesResponseMetaPagination): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +266,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_services_response_meta_pagination.py b/src/datadog_api_client/v2/model/incident_services_response_meta_pagination.py index 9b9f362010..2710ac1054 100644 --- a/src/datadog_api_client/v2/model/incident_services_response_meta_pagination.py +++ b/src/datadog_api_client/v2/model/incident_services_response_meta_pagination.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentServicesResponseMetaPagination(ModelNormal): @@ -50,7 +52,23 @@ class IncidentServicesResponseMetaPagination(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentServicesResponseMetaPagination - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next_offset (int): The index of the first element in the next page of results. Equal to page size added to the current offset.. [optional] # noqa: E501 + offset (int): The index of the first element in the results.. [optional] # noqa: E501 + size (int): Maximum size of pages to return.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_create_attributes.py b/src/datadog_api_client/v2/model/incident_team_create_attributes.py index 1bae890905..687eb13c60 100644 --- a/src/datadog_api_client/v2/model/incident_team_create_attributes.py +++ b/src/datadog_api_client/v2/model/incident_team_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentTeamCreateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class IncidentTeamCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """IncidentTeamCreateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the incident team. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_create_data.py b/src/datadog_api_client/v2/model/incident_team_create_data.py index 31579ac862..8740aecc65 100644 --- a/src/datadog_api_client/v2/model/incident_team_create_data.py +++ b/src/datadog_api_client/v2/model/incident_team_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentTeamCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """IncidentTeamCreateData - a model defined in OpenAPI + + Args: + type (IncidentTeamType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentTeamCreateAttributes): [optional] # noqa: E501 + relationships (IncidentTeamRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_create_request.py b/src/datadog_api_client/v2/model/incident_team_create_request.py index 73f1016fb7..e0b0594df0 100644 --- a/src/datadog_api_client/v2/model/incident_team_create_request.py +++ b/src/datadog_api_client/v2/model/incident_team_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentTeamCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentTeamCreateRequest - a model defined in OpenAPI + + Args: + data (IncidentTeamCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_included_items.py b/src/datadog_api_client/v2/model/incident_team_included_items.py index 5fd6ea8f62..2ebbcd38dc 100644 --- a/src/datadog_api_client/v2/model/incident_team_included_items.py +++ b/src/datadog_api_client/v2/model/incident_team_included_items.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentTeamIncludedItems - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UserAttributes): [optional] # noqa: E501 + id (str): ID of the user.. [optional] # noqa: E501 + relationships (UserResponseRelationships): [optional] # noqa: E501 + type (UsersType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -187,28 +283,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/incident_team_relationships.py b/src/datadog_api_client/v2/model/incident_team_relationships.py index 3f5b1fe3a5..0c7bf96d20 100644 --- a/src/datadog_api_client/v2/model/incident_team_relationships.py +++ b/src/datadog_api_client/v2/model/incident_team_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentTeamRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentTeamRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_by (RelationshipToUser): [optional] # noqa: E501 + last_modified_by (RelationshipToUser): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_response.py b/src/datadog_api_client/v2/model/incident_team_response.py index db44fac8c4..dea9473ec9 100644 --- a/src/datadog_api_client/v2/model/incident_team_response.py +++ b/src/datadog_api_client/v2/model/incident_team_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class IncidentTeamResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentTeamResponse - a model defined in OpenAPI + + Args: + data (IncidentTeamResponseData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + included ([IncidentTeamIncludedItems]): Included objects from relationships.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +276,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_response_attributes.py b/src/datadog_api_client/v2/model/incident_team_response_attributes.py index 8f17606004..073cac8c6f 100644 --- a/src/datadog_api_client/v2/model/incident_team_response_attributes.py +++ b/src/datadog_api_client/v2/model/incident_team_response_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentTeamResponseAttributes(ModelNormal): @@ -50,7 +52,23 @@ class IncidentTeamResponseAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentTeamResponseAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (datetime): Timestamp of when the incident team was created.. [optional] # noqa: E501 + modified (datetime): Timestamp of when the incident team was modified.. [optional] # noqa: E501 + name (str): Name of the incident team.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_response_data.py b/src/datadog_api_client/v2/model/incident_team_response_data.py index c7b748f8d2..6017d30e1e 100644 --- a/src/datadog_api_client/v2/model/incident_team_response_data.py +++ b/src/datadog_api_client/v2/model/incident_team_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentTeamResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentTeamResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentTeamResponseAttributes): [optional] # noqa: E501 + id (str): The incident team's ID.. [optional] # noqa: E501 + relationships (IncidentTeamRelationships): [optional] # noqa: E501 + type (IncidentTeamType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_type.py b/src/datadog_api_client/v2/model/incident_team_type.py index 66c4dce34f..1274fa9f0a 100644 --- a/src/datadog_api_client/v2/model/incident_team_type.py +++ b/src/datadog_api_client/v2/model/incident_team_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentTeamType(ModelSimple): @@ -50,7 +52,23 @@ class IncidentTeamType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentTeamType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Incident Team resource type.. if omitted defaults to "teams", must be one of ["teams", ] # noqa: E501 + + Keyword Args: + value (str): Incident Team resource type.. if omitted defaults to "teams", must be one of ["teams", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "teams" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_team_update_attributes.py b/src/datadog_api_client/v2/model/incident_team_update_attributes.py index 1001c0dfcc..922dd07143 100644 --- a/src/datadog_api_client/v2/model/incident_team_update_attributes.py +++ b/src/datadog_api_client/v2/model/incident_team_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentTeamUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class IncidentTeamUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """IncidentTeamUpdateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the incident team. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_update_data.py b/src/datadog_api_client/v2/model/incident_team_update_data.py index b0feab36fe..3fff53638e 100644 --- a/src/datadog_api_client/v2/model/incident_team_update_data.py +++ b/src/datadog_api_client/v2/model/incident_team_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentTeamUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """IncidentTeamUpdateData - a model defined in OpenAPI + + Args: + type (IncidentTeamType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentTeamUpdateAttributes): [optional] # noqa: E501 + id (str): The incident team's ID.. [optional] # noqa: E501 + relationships (IncidentTeamRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +286,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_team_update_request.py b/src/datadog_api_client/v2/model/incident_team_update_request.py index 1e221ed20e..1746b6f28b 100644 --- a/src/datadog_api_client/v2/model/incident_team_update_request.py +++ b/src/datadog_api_client/v2/model/incident_team_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentTeamUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentTeamUpdateRequest - a model defined in OpenAPI + + Args: + data (IncidentTeamUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_teams_response.py b/src/datadog_api_client/v2/model/incident_teams_response.py index 89630a1974..796a85a529 100644 --- a/src/datadog_api_client/v2/model/incident_teams_response.py +++ b/src/datadog_api_client/v2/model/incident_teams_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentTeamsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentTeamsResponse - a model defined in OpenAPI + + Args: + data ([IncidentTeamResponseData]): An array of incident teams. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + included ([IncidentTeamIncludedItems]): Included related resources which the user requested.. [optional] # noqa: E501 + meta (IncidentServicesResponseMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_timeline_cell_create_attributes.py b/src/datadog_api_client/v2/model/incident_timeline_cell_create_attributes.py index 7b512f3057..01630d5de9 100644 --- a/src/datadog_api_client/v2/model/incident_timeline_cell_create_attributes.py +++ b/src/datadog_api_client/v2/model/incident_timeline_cell_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -107,6 +109,99 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentTimelineCellCreateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + important (bool): A flag indicating whether the timeline cell is important and should be highlighted.. [optional] if omitted the server will use the default value of False # noqa: E501 + cell_type (IncidentTimelineCellMarkdownContentType): [optional] # noqa: E501 + content (IncidentTimelineCellMarkdownCreateAttributesContent): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -192,28 +287,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_content_type.py b/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_content_type.py index a3b5919a8a..69aacca851 100644 --- a/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_content_type.py +++ b/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_content_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentTimelineCellMarkdownContentType(ModelSimple): @@ -50,7 +52,23 @@ class IncidentTimelineCellMarkdownContentType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentTimelineCellMarkdownContentType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Markdown timeline cell.. if omitted defaults to "markdown", must be one of ["markdown", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Markdown timeline cell.. if omitted defaults to "markdown", must be one of ["markdown", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "markdown" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes.py b/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes.py index 7f4e976628..cbf98cec18 100644 --- a/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes.py +++ b/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class IncidentTimelineCellMarkdownCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cell_type, content, *args, **kwargs): # noqa: E501 + """IncidentTimelineCellMarkdownCreateAttributes - a model defined in OpenAPI + + Args: + cell_type (IncidentTimelineCellMarkdownContentType): + content (IncidentTimelineCellMarkdownCreateAttributesContent): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + important (bool): A flag indicating whether the timeline cell is important and should be highlighted.. [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cell_type = cell_type + self.content = content + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +288,8 @@ def __init__(self, cell_type, content, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes_content.py b/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes_content.py index 3eb4556e6f..f840ef1648 100644 --- a/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes_content.py +++ b/src/datadog_api_client/v2/model/incident_timeline_cell_markdown_create_attributes_content.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentTimelineCellMarkdownCreateAttributesContent(ModelNormal): @@ -50,7 +52,23 @@ class IncidentTimelineCellMarkdownCreateAttributesContent(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentTimelineCellMarkdownCreateAttributesContent - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + content (str): The Markdown content of the cell.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_type.py b/src/datadog_api_client/v2/model/incident_type.py index e0b76588bd..dec7e0d8fd 100644 --- a/src/datadog_api_client/v2/model/incident_type.py +++ b/src/datadog_api_client/v2/model/incident_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class IncidentType(ModelSimple): @@ -50,7 +52,23 @@ class IncidentType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """IncidentType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Incident resource type.. if omitted defaults to "incidents", must be one of ["incidents", ] # noqa: E501 + + Keyword Args: + value (str): Incident resource type.. if omitted defaults to "incidents", must be one of ["incidents", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "incidents" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/incident_update_attributes.py b/src/datadog_api_client/v2/model/incident_update_attributes.py index 48302162a7..7c29b17655 100644 --- a/src/datadog_api_client/v2/model/incident_update_attributes.py +++ b/src/datadog_api_client/v2/model/incident_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentUpdateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + customer_impact_end (datetime, none_type): Timestamp when customers were no longer impacted by the incident.. [optional] # noqa: E501 + customer_impact_scope (str): A summary of the impact customers experienced during the incident.. [optional] # noqa: E501 + customer_impact_start (datetime, none_type): Timestamp when customers began being impacted by the incident.. [optional] # noqa: E501 + customer_impacted (bool): A flag indicating whether the incident caused customer impact.. [optional] # noqa: E501 + detected (datetime, none_type): Timestamp when the incident was detected.. [optional] # noqa: E501 + fields ({str: (IncidentFieldAttributes,)}): A condensed view of the user-defined fields for which to update selections.. [optional] # noqa: E501 + notification_handles ([str]): Notification handles that will be notified of the incident during update.. [optional] # noqa: E501 + resolved (datetime, none_type): Timestamp when the incident's state was set to resolved.. [optional] # noqa: E501 + title (str): The title of the incident, which summarizes what happened.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -204,3 +308,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_update_data.py b/src/datadog_api_client/v2/model/incident_update_data.py index 0edaa00576..fbdad32ac2 100644 --- a/src/datadog_api_client/v2/model/incident_update_data.py +++ b/src/datadog_api_client/v2/model/incident_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """IncidentUpdateData - a model defined in OpenAPI + + Args: + id (str): The team's ID. + type (IncidentType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (IncidentUpdateAttributes): [optional] # noqa: E501 + relationships (IncidentUpdateRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +288,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_update_relationships.py b/src/datadog_api_client/v2/model/incident_update_relationships.py index 405c923379..3b29a89e5d 100644 --- a/src/datadog_api_client/v2/model/incident_update_relationships.py +++ b/src/datadog_api_client/v2/model/incident_update_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class IncidentUpdateRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -99,6 +118,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """IncidentUpdateRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + commander_user (RelationshipToUser): [optional] # noqa: E501 + created_by_user (RelationshipToUser): [optional] # noqa: E501 + integrations (RelationshipToIncidentIntegrationMetadatas): [optional] # noqa: E501 + last_modified_by_user (RelationshipToUser): [optional] # noqa: E501 + postmortem (RelationshipToIncidentPostmortem): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -186,3 +286,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incident_update_request.py b/src/datadog_api_client/v2/model/incident_update_request.py index 2ace93b0f8..1fc85905c0 100644 --- a/src/datadog_api_client/v2/model/incident_update_request.py +++ b/src/datadog_api_client/v2/model/incident_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class IncidentUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentUpdateRequest - a model defined in OpenAPI + + Args: + data (IncidentUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/incidents_response.py b/src/datadog_api_client/v2/model/incidents_response.py index 4ab52a291d..c46ca422e6 100644 --- a/src/datadog_api_client/v2/model/incidents_response.py +++ b/src/datadog_api_client/v2/model/incidents_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class IncidentsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """IncidentsResponse - a model defined in OpenAPI + + Args: + data ([IncidentResponseData]): An array of incidents. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + included ([IncidentResponseIncludedItem]): Included related resources that the user requested.. [optional] # noqa: E501 + meta (IncidentServicesResponseMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/list_application_keys_response.py b/src/datadog_api_client/v2/model/list_application_keys_response.py index 1b3605870f..76d86fcb0f 100644 --- a/src/datadog_api_client/v2/model/list_application_keys_response.py +++ b/src/datadog_api_client/v2/model/list_application_keys_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ListApplicationKeysResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ListApplicationKeysResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([PartialApplicationKey]): Array of application keys.. [optional] # noqa: E501 + included ([ApplicationKeyResponseIncludedItem]): Array of objects related to the application key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/log.py b/src/datadog_api_client/v2/model/log.py index 19fd89252a..c1fd9967fb 100644 --- a/src/datadog_api_client/v2/model/log.py +++ b/src/datadog_api_client/v2/model/log.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class Log(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Log - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (LogAttributes): [optional] # noqa: E501 + id (str): Unique ID of the Log.. [optional] # noqa: E501 + type (LogType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/log_attributes.py b/src/datadog_api_client/v2/model/log_attributes.py index f2c269c959..baceb10e74 100644 --- a/src/datadog_api_client/v2/model/log_attributes.py +++ b/src/datadog_api_client/v2/model/log_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogAttributes(ModelNormal): @@ -50,7 +52,23 @@ class LogAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): JSON object of attributes from your log.. [optional] # noqa: E501 + host (str): Name of the machine from where the logs are being sent.. [optional] # noqa: E501 + message (str): The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes) of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry. That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.. [optional] # noqa: E501 + service (str): The name of the application or service generating the log events. It is used to switch from Logs to APM, so make sure you define the same value when you use both products.. [optional] # noqa: E501 + status (str): Status of the message associated with your log.. [optional] # noqa: E501 + tags ([str]): Array of tags associated with your log.. [optional] # noqa: E501 + timestamp (datetime): Timestamp of your log.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/log_type.py b/src/datadog_api_client/v2/model/log_type.py index 429b28cd8e..d45cc78f0b 100644 --- a/src/datadog_api_client/v2/model/log_type.py +++ b/src/datadog_api_client/v2/model/log_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogType(ModelSimple): @@ -50,7 +52,23 @@ class LogType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the event.. if omitted defaults to "log", must be one of ["log", ] # noqa: E501 + + Keyword Args: + value (str): Type of the event.. if omitted defaults to "log", must be one of ["log", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "log" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_aggregate_bucket.py b/src/datadog_api_client/v2/model/logs_aggregate_bucket.py index e4bbf6b586..fe50849266 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_bucket.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_bucket.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsAggregateBucket(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateBucket - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + by ({str: (str,)}): The key, value pairs for each group by. [optional] # noqa: E501 + computes ({str: (LogsAggregateBucketValue,)}): A map of the metric name -> value for regular compute or list of values for a timeseries. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_bucket_value.py b/src/datadog_api_client/v2/model/logs_aggregate_bucket_value.py index 954404492d..08f1d6bd1c 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_bucket_value.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_bucket_value.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -95,6 +97,96 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateBucketValue - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -177,28 +269,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries.py b/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries.py index 85de0a61e2..fedd13ae5d 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -54,7 +56,24 @@ class LogsAggregateBucketValueTimeseries(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -79,6 +98,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -165,9 +186,92 @@ def __init__(self, *args, **kwargs): valid_classes=(self.__class__,), ) - if not isinstance(value, list): + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsAggregateBucketValueTimeseries - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([LogsAggregateBucketValueTimeseriesPoint]): A timeseries array. # noqa: E501 + + Keyword Args: + value ([LogsAggregateBucketValueTimeseriesPoint]): A timeseries array. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: raise ApiTypeError( - "Invalid non-list arguments=%s passed to %s." + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( args, self.__class__.__name__, @@ -193,3 +297,5 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries_point.py b/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries_point.py index 90e74f730b..fa37a0421e 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries_point.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_bucket_value_timeseries_point.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsAggregateBucketValueTimeseriesPoint(ModelNormal): @@ -50,7 +52,23 @@ class LogsAggregateBucketValueTimeseriesPoint(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateBucketValueTimeseriesPoint - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + time (str): The time value for this point. [optional] # noqa: E501 + value (float): The value for this point. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_request.py b/src/datadog_api_client/v2/model/logs_aggregate_request.py index f6184be188..8fef465f5e 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_request.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class LogsAggregateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + compute ([LogsCompute]): The list of metrics or timeseries to compute for the retrieved buckets.. [optional] # noqa: E501 + filter (LogsQueryFilter): [optional] # noqa: E501 + group_by ([LogsGroupBy]): The rules for the group by. [optional] # noqa: E501 + options (LogsQueryOptions): [optional] # noqa: E501 + page (LogsAggregateRequestPage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +288,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_request_page.py b/src/datadog_api_client/v2/model/logs_aggregate_request_page.py index 46a36ca277..a10ce4741e 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_request_page.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_request_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsAggregateRequestPage(ModelNormal): @@ -50,7 +52,23 @@ class LogsAggregateRequestPage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateRequestPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cursor (str): The returned paging point to use to get the next results. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_response.py b/src/datadog_api_client/v2/model/logs_aggregate_response.py index e8a25ca428..a3880f57e8 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_response.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsAggregateResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (LogsAggregateResponseData): [optional] # noqa: E501 + meta (LogsResponseMetadata): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_response_data.py b/src/datadog_api_client/v2/model/logs_aggregate_response_data.py index 0c71ec73aa..901ec650a2 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_response_data.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsAggregateResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + buckets ([LogsAggregateBucket]): The list of matching buckets, one item per bucket. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_response_status.py b/src/datadog_api_client/v2/model/logs_aggregate_response_status.py index 42bdfa259d..62b8bd8e37 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_response_status.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_response_status.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsAggregateResponseStatus(ModelSimple): @@ -51,7 +53,23 @@ class LogsAggregateResponseStatus(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsAggregateResponseStatus - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The status of the response., must be one of ["done", "timeout", ] # noqa: E501 + + Keyword Args: + value (str): The status of the response., must be one of ["done", "timeout", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_aggregate_sort.py b/src/datadog_api_client/v2/model/logs_aggregate_sort.py index d232fa6cf4..2af50382a6 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_sort.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsAggregateSort(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsAggregateSort - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregation (LogsAggregationFunction): [optional] # noqa: E501 + metric (str): The metric to sort by (only used for `type=measure`). [optional] # noqa: E501 + order (LogsSortOrder): [optional] # noqa: E501 + type (LogsAggregateSortType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_aggregate_sort_type.py b/src/datadog_api_client/v2/model/logs_aggregate_sort_type.py index c6ef8b3a32..0d18866a6b 100644 --- a/src/datadog_api_client/v2/model/logs_aggregate_sort_type.py +++ b/src/datadog_api_client/v2/model/logs_aggregate_sort_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsAggregateSortType(ModelSimple): @@ -51,7 +53,23 @@ class LogsAggregateSortType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsAggregateSortType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of sorting algorithm. if omitted defaults to "alphabetical", must be one of ["alphabetical", "measure", ] # noqa: E501 + + Keyword Args: + value (str): The type of sorting algorithm. if omitted defaults to "alphabetical", must be one of ["alphabetical", "measure", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "alphabetical" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_aggregation_function.py b/src/datadog_api_client/v2/model/logs_aggregation_function.py index db8cf6e888..1b2c8507a3 100644 --- a/src/datadog_api_client/v2/model/logs_aggregation_function.py +++ b/src/datadog_api_client/v2/model/logs_aggregation_function.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsAggregationFunction(ModelSimple): @@ -60,7 +62,23 @@ class LogsAggregationFunction(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -187,3 +207,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsAggregationFunction - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): An aggregation function., must be one of ["count", "cardinality", "pc75", "pc90", "pc95", "pc98", "pc99", "sum", "min", "max", "avg", ] # noqa: E501 + + Keyword Args: + value (str): An aggregation function., must be one of ["count", "cardinality", "pc75", "pc90", "pc95", "pc98", "pc99", "sum", "min", "max", "avg", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_archive.py b/src/datadog_api_client/v2/model/logs_archive.py index 5fb3cdc4bf..33488de4a4 100644 --- a/src/datadog_api_client/v2/model/logs_archive.py +++ b/src/datadog_api_client/v2/model/logs_archive.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchive(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchive - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (LogsArchiveDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_attributes.py b/src/datadog_api_client/v2/model/logs_archive_attributes.py index 075e6dc7f8..6cbe3d6c52 100644 --- a/src/datadog_api_client/v2/model/logs_archive_attributes.py +++ b/src/datadog_api_client/v2/model/logs_archive_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsArchiveAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,93 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, destination, name, query, *args, **kwargs): # noqa: E501 + """LogsArchiveAttributes - a model defined in OpenAPI + + Args: + destination (LogsArchiveDestination): + name (str): The archive name. + query (str): The archive query/filter. Logs matching this query are included in the archive. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_tags (bool): To store the tags in the archive, set the value \"true\". If it is set to \"false\", the tags will be deleted when the logs are sent to the archive.. [optional] if omitted the server will use the default value of False # noqa: E501 + rehydration_tags ([str]): An array of tags to add to rehydrated logs from an archive.. [optional] # noqa: E501 + state (LogsArchiveState): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.destination = destination + self.name = name + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -190,3 +296,8 @@ def __init__(self, destination, name, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_create_request.py b/src/datadog_api_client/v2/model/logs_archive_create_request.py index 03280f10c6..5ebe65f983 100644 --- a/src/datadog_api_client/v2/model/logs_archive_create_request.py +++ b/src/datadog_api_client/v2/model/logs_archive_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchiveCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchiveCreateRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (LogsArchiveCreateRequestDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py b/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py index 30653a42a5..088f12847b 100644 --- a/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py +++ b/src/datadog_api_client/v2/model/logs_archive_create_request_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchiveCreateRequestAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, destination, name, query, *args, **kwargs): # noqa: E501 + """LogsArchiveCreateRequestAttributes - a model defined in OpenAPI + + Args: + destination (LogsArchiveCreateRequestDestination): + name (str): The archive name. + query (str): The archive query/filter. Logs matching this query are included in the archive. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_tags (bool): To store the tags in the archive, set the value \"true\". If it is set to \"false\", the tags will be deleted when the logs are sent to the archive.. [optional] if omitted the server will use the default value of False # noqa: E501 + rehydration_tags ([str]): An array of tags to add to rehydrated logs from an archive.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.destination = destination + self.name = name + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -185,3 +290,8 @@ def __init__(self, destination, name, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_create_request_definition.py b/src/datadog_api_client/v2/model/logs_archive_create_request_definition.py index 55c0b6ee1f..866e063895 100644 --- a/src/datadog_api_client/v2/model/logs_archive_create_request_definition.py +++ b/src/datadog_api_client/v2/model/logs_archive_create_request_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchiveCreateRequestDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchiveCreateRequestDefinition - a model defined in OpenAPI + + Args: + + Keyword Args: + type (str): The type of the resource. The value should always be archives.. defaults to "archives" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (LogsArchiveCreateRequestAttributes): [optional] # noqa: E501 + """ + + type = kwargs.get("type", "archives") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_create_request_destination.py b/src/datadog_api_client/v2/model/logs_archive_create_request_destination.py index 49d8e40caa..bae603e0df 100644 --- a/src/datadog_api_client/v2/model/logs_archive_create_request_destination.py +++ b/src/datadog_api_client/v2/model/logs_archive_create_request_destination.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -103,6 +105,103 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchiveCreateRequestDestination - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The archive path.. [optional] # noqa: E501 + region (str): The region where the archive will be stored.. [optional] # noqa: E501 + container (str): The container where the archive will be stored.. [optional] # noqa: E501 + integration (LogsArchiveIntegrationS3): [optional] # noqa: E501 + storage_account (str): The associated storage account.. [optional] # noqa: E501 + type (LogsArchiveDestinationS3Type): [optional] # noqa: E501 + bucket (str): The bucket where the archive will be stored.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -192,28 +291,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/logs_archive_definition.py b/src/datadog_api_client/v2/model/logs_archive_definition.py index 66a4982e25..24d216defb 100644 --- a/src/datadog_api_client/v2/model/logs_archive_definition.py +++ b/src/datadog_api_client/v2/model/logs_archive_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchiveDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchiveDefinition - a model defined in OpenAPI + + Args: + + Keyword Args: + type (str): The type of the resource. The value should always be archives.. defaults to "archives" # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (LogsArchiveAttributes): [optional] # noqa: E501 + id (str): The archive ID.. [optional] # noqa: E501 + """ + + type = kwargs.get("type", "archives") + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -104,10 +206,7 @@ def discriminator(): def __init__(self, *args, **kwargs): # noqa: E501 """LogsArchiveDefinition - a model defined in OpenAPI - Args: - Keyword Args: - type (str): The type of the resource. The value should always be archives.. defaults to "archives" # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -142,7 +241,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 id (str): The archive ID.. [optional] # noqa: E501 """ - type = kwargs.get("type", "archives") _check_type = kwargs.pop("_check_type", True) _spec_property_naming = kwargs.pop("_spec_property_naming", False) _path_to_item = kwargs.pop("_path_to_item", ()) @@ -167,7 +265,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.type = type for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -178,3 +275,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_destination.py b/src/datadog_api_client/v2/model/logs_archive_destination.py index 0ed4150c74..374feb8c24 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -103,6 +105,103 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchiveDestination - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The archive path.. [optional] # noqa: E501 + region (str): The region where the archive will be stored.. [optional] # noqa: E501 + container (str): The container where the archive will be stored.. [optional] # noqa: E501 + integration (LogsArchiveIntegrationS3): [optional] # noqa: E501 + storage_account (str): The associated storage account.. [optional] # noqa: E501 + type (LogsArchiveDestinationS3Type): [optional] # noqa: E501 + bucket (str): The bucket where the archive will be stored.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -192,28 +291,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/logs_archive_destination_azure.py b/src/datadog_api_client/v2/model/logs_archive_destination_azure.py index d9021c65cb..5aeb81334a 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination_azure.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination_azure.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsArchiveDestinationAzure(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,94 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, container, integration, storage_account, type, *args, **kwargs): # noqa: E501 + """LogsArchiveDestinationAzure - a model defined in OpenAPI + + Args: + container (str): The container where the archive will be stored. + integration (LogsArchiveIntegrationAzure): + storage_account (str): The associated storage account. + type (LogsArchiveDestinationAzureType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The archive path.. [optional] # noqa: E501 + region (str): The region where the archive will be stored.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.container = container + self.integration = integration + self.storage_account = storage_account + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -191,3 +298,8 @@ def __init__(self, container, integration, storage_account, type, *args, **kwarg # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_destination_azure_type.py b/src/datadog_api_client/v2/model/logs_archive_destination_azure_type.py index f13af0d063..9838fda72c 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination_azure_type.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination_azure_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveDestinationAzureType(ModelSimple): @@ -50,7 +52,23 @@ class LogsArchiveDestinationAzureType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsArchiveDestinationAzureType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the Azure archive destination.. if omitted defaults to "azure", must be one of ["azure", ] # noqa: E501 + + Keyword Args: + value (str): Type of the Azure archive destination.. if omitted defaults to "azure", must be one of ["azure", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "azure" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_archive_destination_gcs.py b/src/datadog_api_client/v2/model/logs_archive_destination_gcs.py index 47dc852e6b..7821b99a61 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination_gcs.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination_gcs.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsArchiveDestinationGCS(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, bucket, integration, type, *args, **kwargs): # noqa: E501 + """LogsArchiveDestinationGCS - a model defined in OpenAPI + + Args: + bucket (str): The bucket where the archive will be stored. + integration (LogsArchiveIntegrationGCS): + type (LogsArchiveDestinationGCSType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The archive path.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.bucket = bucket + self.integration = integration + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +288,8 @@ def __init__(self, bucket, integration, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_destination_gcs_type.py b/src/datadog_api_client/v2/model/logs_archive_destination_gcs_type.py index d838b417de..ccb01790b3 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination_gcs_type.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination_gcs_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveDestinationGCSType(ModelSimple): @@ -50,7 +52,23 @@ class LogsArchiveDestinationGCSType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsArchiveDestinationGCSType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the GCS archive destination.. if omitted defaults to "gcs", must be one of ["gcs", ] # noqa: E501 + + Keyword Args: + value (str): Type of the GCS archive destination.. if omitted defaults to "gcs", must be one of ["gcs", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "gcs" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_archive_destination_s3.py b/src/datadog_api_client/v2/model/logs_archive_destination_s3.py index 7774b30561..8ec5a407b8 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination_s3.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination_s3.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsArchiveDestinationS3(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, bucket, integration, type, *args, **kwargs): # noqa: E501 + """LogsArchiveDestinationS3 - a model defined in OpenAPI + + Args: + bucket (str): The bucket where the archive will be stored. + integration (LogsArchiveIntegrationS3): + type (LogsArchiveDestinationS3Type): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The archive path.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.bucket = bucket + self.integration = integration + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +288,8 @@ def __init__(self, bucket, integration, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_destination_s3_type.py b/src/datadog_api_client/v2/model/logs_archive_destination_s3_type.py index 4486c6072f..d4ceac342f 100644 --- a/src/datadog_api_client/v2/model/logs_archive_destination_s3_type.py +++ b/src/datadog_api_client/v2/model/logs_archive_destination_s3_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveDestinationS3Type(ModelSimple): @@ -50,7 +52,23 @@ class LogsArchiveDestinationS3Type(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsArchiveDestinationS3Type - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the S3 archive destination.. if omitted defaults to "s3", must be one of ["s3", ] # noqa: E501 + + Keyword Args: + value (str): Type of the S3 archive destination.. if omitted defaults to "s3", must be one of ["s3", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "s3" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_archive_integration_azure.py b/src/datadog_api_client/v2/model/logs_archive_integration_azure.py index 77be63f245..25674ddcc4 100644 --- a/src/datadog_api_client/v2/model/logs_archive_integration_azure.py +++ b/src/datadog_api_client/v2/model/logs_archive_integration_azure.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveIntegrationAzure(ModelNormal): @@ -50,7 +52,23 @@ class LogsArchiveIntegrationAzure(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, client_id, tenant_id, *args, **kwargs): # noqa: E501 + """LogsArchiveIntegrationAzure - a model defined in OpenAPI + + Args: + client_id (str): A client ID. + tenant_id (str): A tenant ID. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.client_id = client_id + self.tenant_id = tenant_id + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, client_id, tenant_id, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_integration_gcs.py b/src/datadog_api_client/v2/model/logs_archive_integration_gcs.py index 51ca0ec0a4..1858293555 100644 --- a/src/datadog_api_client/v2/model/logs_archive_integration_gcs.py +++ b/src/datadog_api_client/v2/model/logs_archive_integration_gcs.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveIntegrationGCS(ModelNormal): @@ -50,7 +52,23 @@ class LogsArchiveIntegrationGCS(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, client_email, project_id, *args, **kwargs): # noqa: E501 + """LogsArchiveIntegrationGCS - a model defined in OpenAPI + + Args: + client_email (str): A client email. + project_id (str): A project ID. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.client_email = client_email + self.project_id = project_id + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, client_email, project_id, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_integration_s3.py b/src/datadog_api_client/v2/model/logs_archive_integration_s3.py index 80eb7bb9db..209a3df10c 100644 --- a/src/datadog_api_client/v2/model/logs_archive_integration_s3.py +++ b/src/datadog_api_client/v2/model/logs_archive_integration_s3.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveIntegrationS3(ModelNormal): @@ -50,7 +52,23 @@ class LogsArchiveIntegrationS3(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, account_id, role_name, *args, **kwargs): # noqa: E501 + """LogsArchiveIntegrationS3 - a model defined in OpenAPI + + Args: + account_id (str): The account ID for the integration. + role_name (str): The path of the integration. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.account_id = account_id + self.role_name = role_name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, account_id, role_name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_order.py b/src/datadog_api_client/v2/model/logs_archive_order.py index 43d3aac510..56759fa8d5 100644 --- a/src/datadog_api_client/v2/model/logs_archive_order.py +++ b/src/datadog_api_client/v2/model/logs_archive_order.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchiveOrder(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchiveOrder - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (LogsArchiveOrderDefinition): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_order_attributes.py b/src/datadog_api_client/v2/model/logs_archive_order_attributes.py index cccba49cd0..05e9f64c51 100644 --- a/src/datadog_api_client/v2/model/logs_archive_order_attributes.py +++ b/src/datadog_api_client/v2/model/logs_archive_order_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveOrderAttributes(ModelNormal): @@ -50,7 +52,23 @@ class LogsArchiveOrderAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, archive_ids, *args, **kwargs): # noqa: E501 + """LogsArchiveOrderAttributes - a model defined in OpenAPI + + Args: + archive_ids ([str]): An ordered array of `` strings, the order of archive IDs in the array define the overall archives order for Datadog. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.archive_ids = archive_ids + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +262,8 @@ def __init__(self, archive_ids, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_order_definition.py b/src/datadog_api_client/v2/model/logs_archive_order_definition.py index 89e1dc32d8..fcb7337a60 100644 --- a/src/datadog_api_client/v2/model/logs_archive_order_definition.py +++ b/src/datadog_api_client/v2/model/logs_archive_order_definition.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsArchiveOrderDefinition(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """LogsArchiveOrderDefinition - a model defined in OpenAPI + + Args: + attributes (LogsArchiveOrderAttributes): + type (LogsArchiveOrderDefinitionType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_archive_order_definition_type.py b/src/datadog_api_client/v2/model/logs_archive_order_definition_type.py index 7d7a9f748c..d2093f2834 100644 --- a/src/datadog_api_client/v2/model/logs_archive_order_definition_type.py +++ b/src/datadog_api_client/v2/model/logs_archive_order_definition_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveOrderDefinitionType(ModelSimple): @@ -50,7 +52,23 @@ class LogsArchiveOrderDefinitionType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsArchiveOrderDefinitionType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of the archive order definition.. if omitted defaults to "archive_order", must be one of ["archive_order", ] # noqa: E501 + + Keyword Args: + value (str): Type of the archive order definition.. if omitted defaults to "archive_order", must be one of ["archive_order", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "archive_order" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_archive_state.py b/src/datadog_api_client/v2/model/logs_archive_state.py index 7de8d4df24..2e9f9a78fa 100644 --- a/src/datadog_api_client/v2/model/logs_archive_state.py +++ b/src/datadog_api_client/v2/model/logs_archive_state.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsArchiveState(ModelSimple): @@ -53,7 +55,23 @@ class LogsArchiveState(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -180,3 +200,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsArchiveState - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The state of the archive.., must be one of ["UNKNOWN", "WORKING", "FAILING", "WORKING_AUTH_LEGACY", ] # noqa: E501 + + Keyword Args: + value (str): The state of the archive.., must be one of ["UNKNOWN", "WORKING", "FAILING", "WORKING_AUTH_LEGACY", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_archives.py b/src/datadog_api_client/v2/model/logs_archives.py index e2205d8a48..bcbc53a054 100644 --- a/src/datadog_api_client/v2/model/logs_archives.py +++ b/src/datadog_api_client/v2/model/logs_archives.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsArchives(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsArchives - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([LogsArchiveDefinition]): A list of archives.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_compute.py b/src/datadog_api_client/v2/model/logs_compute.py index 8684928770..d894805967 100644 --- a/src/datadog_api_client/v2/model/logs_compute.py +++ b/src/datadog_api_client/v2/model/logs_compute.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsCompute(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, aggregation, *args, **kwargs): # noqa: E501 + """LogsCompute - a model defined in OpenAPI + + Args: + aggregation (LogsAggregationFunction): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + interval (str): The time buckets' size (only used for type=timeseries) Defaults to a resolution of 150 points. [optional] # noqa: E501 + metric (str): The metric to use. [optional] # noqa: E501 + type (LogsComputeType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.aggregation = aggregation + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, aggregation, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_compute_type.py b/src/datadog_api_client/v2/model/logs_compute_type.py index fcc02a75b6..6d147fcc0c 100644 --- a/src/datadog_api_client/v2/model/logs_compute_type.py +++ b/src/datadog_api_client/v2/model/logs_compute_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsComputeType(ModelSimple): @@ -51,7 +53,23 @@ class LogsComputeType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsComputeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of compute. if omitted defaults to "total", must be one of ["timeseries", "total", ] # noqa: E501 + + Keyword Args: + value (str): The type of compute. if omitted defaults to "total", must be one of ["timeseries", "total", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "total" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_group_by.py b/src/datadog_api_client/v2/model/logs_group_by.py index 45528590a1..eed5100ee9 100644 --- a/src/datadog_api_client/v2/model/logs_group_by.py +++ b/src/datadog_api_client/v2/model/logs_group_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class LogsGroupBy(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,91 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, facet, *args, **kwargs): # noqa: E501 + """LogsGroupBy - a model defined in OpenAPI + + Args: + facet (str): The name of the facet to use (required) + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + histogram (LogsGroupByHistogram): [optional] # noqa: E501 + limit (int): The maximum buckets to return for this group by. [optional] if omitted the server will use the default value of 10 # noqa: E501 + missing (LogsGroupByMissing): [optional] # noqa: E501 + sort (LogsAggregateSort): [optional] # noqa: E501 + total (LogsGroupByTotal): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.facet = facet + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -192,3 +296,8 @@ def __init__(self, facet, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_group_by_histogram.py b/src/datadog_api_client/v2/model/logs_group_by_histogram.py index dff0e1e1a5..f109effc3c 100644 --- a/src/datadog_api_client/v2/model/logs_group_by_histogram.py +++ b/src/datadog_api_client/v2/model/logs_group_by_histogram.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsGroupByHistogram(ModelNormal): @@ -50,7 +52,23 @@ class LogsGroupByHistogram(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, interval, max, min, *args, **kwargs): # noqa: E501 + """LogsGroupByHistogram - a model defined in OpenAPI + + Args: + interval (float): The bin size of the histogram buckets + max (float): The maximum value for the measure used in the histogram (values greater than this one are filtered out) + min (float): The minimum value for the measure used in the histogram (values smaller than this one are filtered out) + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.interval = interval + self.max = max + self.min = min + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -172,3 +274,8 @@ def __init__(self, interval, max, min, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_group_by_missing.py b/src/datadog_api_client/v2/model/logs_group_by_missing.py index ea5cf925bf..e6f11f9bbe 100644 --- a/src/datadog_api_client/v2/model/logs_group_by_missing.py +++ b/src/datadog_api_client/v2/model/logs_group_by_missing.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsGroupByMissing(ModelNormal): @@ -90,6 +92,82 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsGroupByMissing - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -172,3 +250,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_group_by_total.py b/src/datadog_api_client/v2/model/logs_group_by_total.py index 3476d2f6db..5fdfb732a9 100644 --- a/src/datadog_api_client/v2/model/logs_group_by_total.py +++ b/src/datadog_api_client/v2/model/logs_group_by_total.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsGroupByTotal(ModelNormal): @@ -90,6 +92,82 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsGroupByTotal - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -172,3 +250,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_list_request.py b/src/datadog_api_client/v2/model/logs_list_request.py index 43bb444baf..5f6c868c81 100644 --- a/src/datadog_api_client/v2/model/logs_list_request.py +++ b/src/datadog_api_client/v2/model/logs_list_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class LogsListRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsListRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsQueryFilter): [optional] # noqa: E501 + options (LogsQueryOptions): [optional] # noqa: E501 + page (LogsListRequestPage): [optional] # noqa: E501 + sort (LogsSort): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_list_request_page.py b/src/datadog_api_client/v2/model/logs_list_request_page.py index 1a39ee4b48..1f9b439ce0 100644 --- a/src/datadog_api_client/v2/model/logs_list_request_page.py +++ b/src/datadog_api_client/v2/model/logs_list_request_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsListRequestPage(ModelNormal): @@ -54,7 +56,23 @@ class LogsListRequestPage(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsListRequestPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cursor (str): List following results with a cursor provided in the previous query.. [optional] # noqa: E501 + limit (int): Maximum number of logs in the response.. [optional] if omitted the server will use the default value of 10 # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_list_response.py b/src/datadog_api_client/v2/model/logs_list_response.py index 3eb1f52027..215c9c2045 100644 --- a/src/datadog_api_client/v2/model/logs_list_response.py +++ b/src/datadog_api_client/v2/model/logs_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([Log]): Array of logs matching the request.. [optional] # noqa: E501 + links (LogsListResponseLinks): [optional] # noqa: E501 + meta (LogsResponseMetadata): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_list_response_links.py b/src/datadog_api_client/v2/model/logs_list_response_links.py index f88d4f1fca..ff9fe266a9 100644 --- a/src/datadog_api_client/v2/model/logs_list_response_links.py +++ b/src/datadog_api_client/v2/model/logs_list_response_links.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsListResponseLinks(ModelNormal): @@ -50,7 +52,23 @@ class LogsListResponseLinks(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsListResponseLinks - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str): Link for the next set of results. Note that the request can also be made using the POST endpoint.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_compute.py b/src/datadog_api_client/v2/model/logs_metric_compute.py index cd8ebb5294..9c849efbe0 100644 --- a/src/datadog_api_client/v2/model/logs_metric_compute.py +++ b/src/datadog_api_client/v2/model/logs_metric_compute.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsMetricCompute(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, aggregation_type, *args, **kwargs): # noqa: E501 + """LogsMetricCompute - a model defined in OpenAPI + + Args: + aggregation_type (LogsMetricComputeAggregationType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The path to the value the log-based metric will aggregate on (only used if the aggregation type is a \"distribution\").. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.aggregation_type = aggregation_type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -174,3 +274,8 @@ def __init__(self, aggregation_type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_compute_aggregation_type.py b/src/datadog_api_client/v2/model/logs_metric_compute_aggregation_type.py index 3d22400a75..c21190386f 100644 --- a/src/datadog_api_client/v2/model/logs_metric_compute_aggregation_type.py +++ b/src/datadog_api_client/v2/model/logs_metric_compute_aggregation_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricComputeAggregationType(ModelSimple): @@ -51,7 +53,23 @@ class LogsMetricComputeAggregationType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsMetricComputeAggregationType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of aggregation to use.., must be one of ["count", "distribution", ] # noqa: E501 + + Keyword Args: + value (str): The type of aggregation to use.., must be one of ["count", "distribution", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_metric_create_attributes.py b/src/datadog_api_client/v2/model/logs_metric_create_attributes.py index da4f4dc49e..8949393d53 100644 --- a/src/datadog_api_client/v2/model/logs_metric_create_attributes.py +++ b/src/datadog_api_client/v2/model/logs_metric_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsMetricCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, compute, *args, **kwargs): # noqa: E501 + """LogsMetricCreateAttributes - a model defined in OpenAPI + + Args: + compute (LogsMetricCompute): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsMetricFilter): [optional] # noqa: E501 + group_by ([LogsMetricGroupBy]): The rules for the group by.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.compute = compute + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, compute, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_create_data.py b/src/datadog_api_client/v2/model/logs_metric_create_data.py index 68df8b998e..3f09f2e84c 100644 --- a/src/datadog_api_client/v2/model/logs_metric_create_data.py +++ b/src/datadog_api_client/v2/model/logs_metric_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsMetricCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """LogsMetricCreateData - a model defined in OpenAPI + + Args: + attributes (LogsMetricCreateAttributes): + id (str): The name of the log-based metric. + type (LogsMetricType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_create_request.py b/src/datadog_api_client/v2/model/logs_metric_create_request.py index 80d3416f7e..7de4b9c0fa 100644 --- a/src/datadog_api_client/v2/model/logs_metric_create_request.py +++ b/src/datadog_api_client/v2/model/logs_metric_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsMetricCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """LogsMetricCreateRequest - a model defined in OpenAPI + + Args: + data (LogsMetricCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_filter.py b/src/datadog_api_client/v2/model/logs_metric_filter.py index dec2d68bcd..7d194dd2c6 100644 --- a/src/datadog_api_client/v2/model/logs_metric_filter.py +++ b/src/datadog_api_client/v2/model/logs_metric_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricFilter(ModelNormal): @@ -50,7 +52,23 @@ class LogsMetricFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + query (str): The search query - following the log search syntax.. [optional] if omitted the server will use the default value of "*" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_group_by.py b/src/datadog_api_client/v2/model/logs_metric_group_by.py index 2b972731df..9d8225b896 100644 --- a/src/datadog_api_client/v2/model/logs_metric_group_by.py +++ b/src/datadog_api_client/v2/model/logs_metric_group_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricGroupBy(ModelNormal): @@ -50,7 +52,23 @@ class LogsMetricGroupBy(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, path, *args, **kwargs): # noqa: E501 + """LogsMetricGroupBy - a model defined in OpenAPI + + Args: + path (str): The path to the value the log-based metric will be aggregated over. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tag_name (str): Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.path = path + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +266,8 @@ def __init__(self, path, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_response.py b/src/datadog_api_client/v2/model/logs_metric_response.py index 8741231be4..f9d1b6a815 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response.py +++ b/src/datadog_api_client/v2/model/logs_metric_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsMetricResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (LogsMetricResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_response_attributes.py b/src/datadog_api_client/v2/model/logs_metric_response_attributes.py index 8ddda237c2..8555cfe6b1 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response_attributes.py +++ b/src/datadog_api_client/v2/model/logs_metric_response_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsMetricResponseAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricResponseAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + compute (LogsMetricResponseCompute): [optional] # noqa: E501 + filter (LogsMetricResponseFilter): [optional] # noqa: E501 + group_by ([LogsMetricResponseGroupBy]): The rules for the group by.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_response_compute.py b/src/datadog_api_client/v2/model/logs_metric_response_compute.py index 1be68a1c07..9f97143e26 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response_compute.py +++ b/src/datadog_api_client/v2/model/logs_metric_response_compute.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsMetricResponseCompute(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricResponseCompute - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + aggregation_type (LogsMetricResponseComputeAggregationType): [optional] # noqa: E501 + path (str): The path to the value the log-based metric will aggregate on (only used if the aggregation type is a \"distribution\").. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_response_compute_aggregation_type.py b/src/datadog_api_client/v2/model/logs_metric_response_compute_aggregation_type.py index 483f4c7bfd..a921363470 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response_compute_aggregation_type.py +++ b/src/datadog_api_client/v2/model/logs_metric_response_compute_aggregation_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricResponseComputeAggregationType(ModelSimple): @@ -51,7 +53,23 @@ class LogsMetricResponseComputeAggregationType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsMetricResponseComputeAggregationType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of aggregation to use.., must be one of ["count", "distribution", ] # noqa: E501 + + Keyword Args: + value (str): The type of aggregation to use.., must be one of ["count", "distribution", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_metric_response_data.py b/src/datadog_api_client/v2/model/logs_metric_response_data.py index 26b6e800da..187a9ef83a 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response_data.py +++ b/src/datadog_api_client/v2/model/logs_metric_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsMetricResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (LogsMetricResponseAttributes): [optional] # noqa: E501 + id (str): The name of the log-based metric.. [optional] # noqa: E501 + type (LogsMetricType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_response_filter.py b/src/datadog_api_client/v2/model/logs_metric_response_filter.py index ccf6134cd5..c70bc778a3 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response_filter.py +++ b/src/datadog_api_client/v2/model/logs_metric_response_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricResponseFilter(ModelNormal): @@ -50,7 +52,23 @@ class LogsMetricResponseFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricResponseFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + query (str): The search query - following the log search syntax.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_response_group_by.py b/src/datadog_api_client/v2/model/logs_metric_response_group_by.py index de9f31bf81..d6cc4cbac1 100644 --- a/src/datadog_api_client/v2/model/logs_metric_response_group_by.py +++ b/src/datadog_api_client/v2/model/logs_metric_response_group_by.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricResponseGroupBy(ModelNormal): @@ -50,7 +52,23 @@ class LogsMetricResponseGroupBy(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricResponseGroupBy - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + path (str): The path to the value the log-based metric will be aggregated over.. [optional] # noqa: E501 + tag_name (str): Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_type.py b/src/datadog_api_client/v2/model/logs_metric_type.py index 2e50258613..6424de5910 100644 --- a/src/datadog_api_client/v2/model/logs_metric_type.py +++ b/src/datadog_api_client/v2/model/logs_metric_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsMetricType(ModelSimple): @@ -50,7 +52,23 @@ class LogsMetricType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsMetricType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the resource. The value should always be logs_metrics.. if omitted defaults to "logs_metrics", must be one of ["logs_metrics", ] # noqa: E501 + + Keyword Args: + value (str): The type of the resource. The value should always be logs_metrics.. if omitted defaults to "logs_metrics", must be one of ["logs_metrics", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "logs_metrics" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_metric_update_attributes.py b/src/datadog_api_client/v2/model/logs_metric_update_attributes.py index 12cd26384a..473297778b 100644 --- a/src/datadog_api_client/v2/model/logs_metric_update_attributes.py +++ b/src/datadog_api_client/v2/model/logs_metric_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsMetricUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricUpdateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (LogsMetricFilter): [optional] # noqa: E501 + group_by ([LogsMetricGroupBy]): The rules for the group by.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_update_data.py b/src/datadog_api_client/v2/model/logs_metric_update_data.py index fa12249c08..4400b269b4 100644 --- a/src/datadog_api_client/v2/model/logs_metric_update_data.py +++ b/src/datadog_api_client/v2/model/logs_metric_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class LogsMetricUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """LogsMetricUpdateData - a model defined in OpenAPI + + Args: + attributes (LogsMetricUpdateAttributes): + type (LogsMetricType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metric_update_request.py b/src/datadog_api_client/v2/model/logs_metric_update_request.py index a91d2a7634..9b9373ba38 100644 --- a/src/datadog_api_client/v2/model/logs_metric_update_request.py +++ b/src/datadog_api_client/v2/model/logs_metric_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsMetricUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """LogsMetricUpdateRequest - a model defined in OpenAPI + + Args: + data (LogsMetricUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_metrics_response.py b/src/datadog_api_client/v2/model/logs_metrics_response.py index deef61561c..8616fe1c9a 100644 --- a/src/datadog_api_client/v2/model/logs_metrics_response.py +++ b/src/datadog_api_client/v2/model/logs_metrics_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class LogsMetricsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsMetricsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([LogsMetricResponseData]): A list of log-based metric objects.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_query_filter.py b/src/datadog_api_client/v2/model/logs_query_filter.py index c1859b7408..0160b7651b 100644 --- a/src/datadog_api_client/v2/model/logs_query_filter.py +++ b/src/datadog_api_client/v2/model/logs_query_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsQueryFilter(ModelNormal): @@ -50,7 +52,23 @@ class LogsQueryFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsQueryFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _from (str): The minimum time for the requested logs, supports date math and regular timestamps. [optional] if omitted the server will use the default value of "now-15m" # noqa: E501 + indexes ([str]): For customers with multiple indexes, the indexes to search. Defaults to ['*'] which means all indexes.. [optional] if omitted the server will use the default value of ["*"] # noqa: E501 + query (str): The search query - following the log search syntax.. [optional] if omitted the server will use the default value of "*" # noqa: E501 + to (str): The maximum time for the requested logs, supports date math and regular timestamps. [optional] if omitted the server will use the default value of "now" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_query_options.py b/src/datadog_api_client/v2/model/logs_query_options.py index 8ea91b5b1c..fda1b0528c 100644 --- a/src/datadog_api_client/v2/model/logs_query_options.py +++ b/src/datadog_api_client/v2/model/logs_query_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsQueryOptions(ModelNormal): @@ -50,7 +52,23 @@ class LogsQueryOptions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsQueryOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + time_offset (int): The time offset (in seconds) to apply to the query.. [optional] # noqa: E501 + timezone (str): The timezone can be specified both as an offset, for example: \"UTC+03:00\".. [optional] if omitted the server will use the default value of "UTC" # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_response_metadata.py b/src/datadog_api_client/v2/model/logs_response_metadata.py index eef836b11d..8ef0d5a9d7 100644 --- a/src/datadog_api_client/v2/model/logs_response_metadata.py +++ b/src/datadog_api_client/v2/model/logs_response_metadata.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class LogsResponseMetadata(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsResponseMetadata - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + elapsed (int): The time elapsed in milliseconds. [optional] # noqa: E501 + page (LogsResponseMetadataPage): [optional] # noqa: E501 + request_id (str): The identifier of the request. [optional] # noqa: E501 + status (LogsAggregateResponseStatus): [optional] # noqa: E501 + warnings ([LogsWarning]): A list of warnings (non fatal errors) encountered, partial results might be returned if warnings are present in the response.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_response_metadata_page.py b/src/datadog_api_client/v2/model/logs_response_metadata_page.py index ff83b5111f..ffb6a4c87e 100644 --- a/src/datadog_api_client/v2/model/logs_response_metadata_page.py +++ b/src/datadog_api_client/v2/model/logs_response_metadata_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsResponseMetadataPage(ModelNormal): @@ -50,7 +52,23 @@ class LogsResponseMetadataPage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsResponseMetadataPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + after (str): The cursor to use to get the next results, if any. To make the next request, use the same. parameters with the addition of the `page[cursor]`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/logs_sort.py b/src/datadog_api_client/v2/model/logs_sort.py index 2e370b354d..0b56fb989c 100644 --- a/src/datadog_api_client/v2/model/logs_sort.py +++ b/src/datadog_api_client/v2/model/logs_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsSort(ModelSimple): @@ -51,7 +53,23 @@ class LogsSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Sort parameters when querying logs.., must be one of ["timestamp", "-timestamp", ] # noqa: E501 + + Keyword Args: + value (str): Sort parameters when querying logs.., must be one of ["timestamp", "-timestamp", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_sort_order.py b/src/datadog_api_client/v2/model/logs_sort_order.py index 570f409af2..01785088e7 100644 --- a/src/datadog_api_client/v2/model/logs_sort_order.py +++ b/src/datadog_api_client/v2/model/logs_sort_order.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsSortOrder(ModelSimple): @@ -51,7 +53,23 @@ class LogsSortOrder(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """LogsSortOrder - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The order to use, ascending or descending., must be one of ["asc", "desc", ] # noqa: E501 + + Keyword Args: + value (str): The order to use, ascending or descending., must be one of ["asc", "desc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/logs_warning.py b/src/datadog_api_client/v2/model/logs_warning.py index d796e87a18..0b160ef9c9 100644 --- a/src/datadog_api_client/v2/model/logs_warning.py +++ b/src/datadog_api_client/v2/model/logs_warning.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class LogsWarning(ModelNormal): @@ -50,7 +52,23 @@ class LogsWarning(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """LogsWarning - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + code (str): A unique code for this type of warning. [optional] # noqa: E501 + detail (str): A detailed explanation of this specific warning. [optional] # noqa: E501 + title (str): A short human-readable summary of the warning. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric.py b/src/datadog_api_client/v2/model/metric.py index 418b9c58c7..05ecf80c92 100644 --- a/src/datadog_api_client/v2/model/metric.py +++ b/src/datadog_api_client/v2/model/metric.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class Metric(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Metric - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_all_tags.py b/src/datadog_api_client/v2/model/metric_all_tags.py index 1d829d250d..547273a0a4 100644 --- a/src/datadog_api_client/v2/model/metric_all_tags.py +++ b/src/datadog_api_client/v2/model/metric_all_tags.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class MetricAllTags(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricAllTags - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricAllTagsAttributes): [optional] # noqa: E501 + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_all_tags_attributes.py b/src/datadog_api_client/v2/model/metric_all_tags_attributes.py index fda7c64ce1..33a90c6b16 100644 --- a/src/datadog_api_client/v2/model/metric_all_tags_attributes.py +++ b/src/datadog_api_client/v2/model/metric_all_tags_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricAllTagsAttributes(ModelNormal): @@ -50,7 +52,23 @@ class MetricAllTagsAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricAllTagsAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tags ([str]): List of indexed tag value pairs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_all_tags_response.py b/src/datadog_api_client/v2/model/metric_all_tags_response.py index 9b25035bda..8133573fd7 100644 --- a/src/datadog_api_client/v2/model/metric_all_tags_response.py +++ b/src/datadog_api_client/v2/model/metric_all_tags_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricAllTagsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricAllTagsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (MetricAllTags): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_distinct_volume.py b/src/datadog_api_client/v2/model/metric_distinct_volume.py index 85a484aaf1..2c3a3e789f 100644 --- a/src/datadog_api_client/v2/model/metric_distinct_volume.py +++ b/src/datadog_api_client/v2/model/metric_distinct_volume.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class MetricDistinctVolume(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricDistinctVolume - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricDistinctVolumeAttributes): [optional] # noqa: E501 + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricDistinctVolumeType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_distinct_volume_attributes.py b/src/datadog_api_client/v2/model/metric_distinct_volume_attributes.py index 33310aba8b..2f3f3ed1f5 100644 --- a/src/datadog_api_client/v2/model/metric_distinct_volume_attributes.py +++ b/src/datadog_api_client/v2/model/metric_distinct_volume_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricDistinctVolumeAttributes(ModelNormal): @@ -50,7 +52,23 @@ class MetricDistinctVolumeAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricDistinctVolumeAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + distinct_volume (int): Distinct volume for the given metric.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_distinct_volume_type.py b/src/datadog_api_client/v2/model/metric_distinct_volume_type.py index 7ea50c9e8e..fd1a04ccf9 100644 --- a/src/datadog_api_client/v2/model/metric_distinct_volume_type.py +++ b/src/datadog_api_client/v2/model/metric_distinct_volume_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricDistinctVolumeType(ModelSimple): @@ -50,7 +52,23 @@ class MetricDistinctVolumeType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MetricDistinctVolumeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The metric distinct volume type.. if omitted defaults to "distinct_metric_volumes", must be one of ["distinct_metric_volumes", ] # noqa: E501 + + Keyword Args: + value (str): The metric distinct volume type.. if omitted defaults to "distinct_metric_volumes", must be one of ["distinct_metric_volumes", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "distinct_metric_volumes" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/metric_ingested_indexed_volume.py b/src/datadog_api_client/v2/model/metric_ingested_indexed_volume.py index 520ef3e859..3854b9d50a 100644 --- a/src/datadog_api_client/v2/model/metric_ingested_indexed_volume.py +++ b/src/datadog_api_client/v2/model/metric_ingested_indexed_volume.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class MetricIngestedIndexedVolume(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricIngestedIndexedVolume - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricIngestedIndexedVolumeAttributes): [optional] # noqa: E501 + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricIngestedIndexedVolumeType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_attributes.py b/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_attributes.py index 057a04fe4c..80b0baa0ec 100644 --- a/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_attributes.py +++ b/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricIngestedIndexedVolumeAttributes(ModelNormal): @@ -50,7 +52,23 @@ class MetricIngestedIndexedVolumeAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricIngestedIndexedVolumeAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + indexed_volume (int): Indexed volume for the given metric.. [optional] # noqa: E501 + ingested_volume (int): Ingested volume for the given metric.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_type.py b/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_type.py index 38a6a35d12..84c0a8123c 100644 --- a/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_type.py +++ b/src/datadog_api_client/v2/model/metric_ingested_indexed_volume_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricIngestedIndexedVolumeType(ModelSimple): @@ -50,7 +52,23 @@ class MetricIngestedIndexedVolumeType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MetricIngestedIndexedVolumeType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The metric ingested and indexed volume type.. if omitted defaults to "metric_volumes", must be one of ["metric_volumes", ] # noqa: E501 + + Keyword Args: + value (str): The metric ingested and indexed volume type.. if omitted defaults to "metric_volumes", must be one of ["metric_volumes", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "metric_volumes" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration.py b/src/datadog_api_client/v2/model/metric_tag_configuration.py index a3d90f2bee..5f6599942b 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class MetricTagConfiguration(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricTagConfiguration - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricTagConfigurationAttributes): [optional] # noqa: E501 + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricTagConfigurationType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_attributes.py b/src/datadog_api_client/v2/model/metric_tag_configuration_attributes.py index 8b249027be..4458de7fda 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_attributes.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricTagConfigurationAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Timestamp when the tag configuration was created.. [optional] # noqa: E501 + include_percentiles (bool): Toggle to turn on/off percentile aggregations for distribution metrics. Only present when the `metric_type` is `distribution`.. [optional] # noqa: E501 + metric_type (MetricTagConfigurationMetricTypes): [optional] # noqa: E501 + modified_at (datetime): Timestamp when the tag configuration was last modified.. [optional] # noqa: E501 + tags ([str]): List of tag keys on which to group.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_create_attributes.py b/src/datadog_api_client/v2/model/metric_tag_configuration_create_attributes.py index 642d165890..721f91f31c 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_create_attributes.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricTagConfigurationCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, metric_type, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationCreateAttributes - a model defined in OpenAPI + + Args: + metric_type (MetricTagConfigurationMetricTypes): + + Keyword Args: + tags ([str]): A list of tag keys that will be queryable for your metric.. defaults to [] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_percentiles (bool): Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a `metric_type` of `distribution`.. [optional] if omitted the server will use the default value of False # noqa: E501 + """ + + tags = kwargs.get("tags", []) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.metric_type = metric_type + self.tags = tags + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +282,8 @@ def __init__(self, metric_type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_create_data.py b/src/datadog_api_client/v2/model/metric_tag_configuration_create_data.py index 17dc28919d..3431783ed6 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_create_data.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class MetricTagConfigurationCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationCreateData - a model defined in OpenAPI + + Args: + id (str): The metric name for this resource. + type (MetricTagConfigurationType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricTagConfigurationCreateAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_create_request.py b/src/datadog_api_client/v2/model/metric_tag_configuration_create_request.py index e9c2698591..942e648513 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_create_request.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricTagConfigurationCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationCreateRequest - a model defined in OpenAPI + + Args: + data (MetricTagConfigurationCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_metric_types.py b/src/datadog_api_client/v2/model/metric_tag_configuration_metric_types.py index 868e75b45e..9ebe69c40b 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_metric_types.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_metric_types.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricTagConfigurationMetricTypes(ModelSimple): @@ -53,7 +55,23 @@ class MetricTagConfigurationMetricTypes(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -77,6 +95,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -176,3 +196,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MetricTagConfigurationMetricTypes - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The metric's type.. if omitted defaults to "gauge", must be one of ["gauge", "count", "rate", "distribution", ] # noqa: E501 + + Keyword Args: + value (str): The metric's type.. if omitted defaults to "gauge", must be one of ["gauge", "count", "rate", "distribution", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "gauge" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_response.py b/src/datadog_api_client/v2/model/metric_tag_configuration_response.py index ce5e772646..25b9750450 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_response.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricTagConfigurationResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (MetricTagConfiguration): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_type.py b/src/datadog_api_client/v2/model/metric_tag_configuration_type.py index 5fda8b1130..2874bb196e 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_type.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricTagConfigurationType(ModelSimple): @@ -50,7 +52,23 @@ class MetricTagConfigurationType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MetricTagConfigurationType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The metric tag configuration resource type.. if omitted defaults to "manage_tags", must be one of ["manage_tags", ] # noqa: E501 + + Keyword Args: + value (str): The metric tag configuration resource type.. if omitted defaults to "manage_tags", must be one of ["manage_tags", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "manage_tags" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_update_attributes.py b/src/datadog_api_client/v2/model/metric_tag_configuration_update_attributes.py index 1af8a3a15b..b259fba6cf 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_update_attributes.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricTagConfigurationUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class MetricTagConfigurationUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationUpdateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + include_percentiles (bool): Toggle to include/exclude percentiles for a distribution metric. Defaults to false. Can only be applied to metrics that have a `metric_type` of `distribution`.. [optional] if omitted the server will use the default value of False # noqa: E501 + tags ([str]): A list of tag keys that will be queryable for your metric.. [optional] if omitted the server will use the default value of [] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_update_data.py b/src/datadog_api_client/v2/model/metric_tag_configuration_update_data.py index 3f394bea00..f35e67b302 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_update_data.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class MetricTagConfigurationUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationUpdateData - a model defined in OpenAPI + + Args: + id (str): The metric name for this resource. + type (MetricTagConfigurationType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricTagConfigurationUpdateAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_tag_configuration_update_request.py b/src/datadog_api_client/v2/model/metric_tag_configuration_update_request.py index 4ca19c168e..73689340a4 100644 --- a/src/datadog_api_client/v2/model/metric_tag_configuration_update_request.py +++ b/src/datadog_api_client/v2/model/metric_tag_configuration_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricTagConfigurationUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """MetricTagConfigurationUpdateRequest - a model defined in OpenAPI + + Args: + data (MetricTagConfigurationUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metric_type.py b/src/datadog_api_client/v2/model/metric_type.py index 5d856aa13b..53aa3dcbc8 100644 --- a/src/datadog_api_client/v2/model/metric_type.py +++ b/src/datadog_api_client/v2/model/metric_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class MetricType(ModelSimple): @@ -50,7 +52,23 @@ class MetricType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """MetricType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The metric resource type.. if omitted defaults to "metrics", must be one of ["metrics", ] # noqa: E501 + + Keyword Args: + value (str): The metric resource type.. if omitted defaults to "metrics", must be one of ["metrics", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "metrics" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/metric_volumes.py b/src/datadog_api_client/v2/model/metric_volumes.py index aefb51ed70..255055790a 100644 --- a/src/datadog_api_client/v2/model/metric_volumes.py +++ b/src/datadog_api_client/v2/model/metric_volumes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -103,6 +105,99 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricVolumes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (MetricIngestedIndexedVolumeAttributes): [optional] # noqa: E501 + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricIngestedIndexedVolumeType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -188,28 +283,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/metric_volumes_response.py b/src/datadog_api_client/v2/model/metric_volumes_response.py index cbe52f1cda..78f598f6c7 100644 --- a/src/datadog_api_client/v2/model/metric_volumes_response.py +++ b/src/datadog_api_client/v2/model/metric_volumes_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricVolumesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricVolumesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (MetricVolumes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations.py b/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations.py index 0217e3cf58..57b02ddf5d 100644 --- a/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations.py +++ b/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -101,6 +103,99 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricsAndMetricTagConfigurations - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): The metric name for this resource.. [optional] # noqa: E501 + type (MetricTagConfigurationType): [optional] # noqa: E501 + attributes (MetricTagConfigurationAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -186,28 +281,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations_response.py b/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations_response.py index ee93491790..de7de4a38a 100644 --- a/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations_response.py +++ b/src/datadog_api_client/v2/model/metrics_and_metric_tag_configurations_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class MetricsAndMetricTagConfigurationsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """MetricsAndMetricTagConfigurationsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([MetricsAndMetricTagConfigurations]): Array of metrics and metric tag configurations.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/organization.py b/src/datadog_api_client/v2/model/organization.py index 3b8301d9d7..708ad6de87 100644 --- a/src/datadog_api_client/v2/model/organization.py +++ b/src/datadog_api_client/v2/model/organization.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class Organization(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """Organization - a model defined in OpenAPI + + Args: + type (OrganizationsType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (OrganizationAttributes): [optional] # noqa: E501 + id (str): ID of the organization.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/organization_attributes.py b/src/datadog_api_client/v2/model/organization_attributes.py index a24af425d3..d5a5a43901 100644 --- a/src/datadog_api_client/v2/model/organization_attributes.py +++ b/src/datadog_api_client/v2/model/organization_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class OrganizationAttributes(ModelNormal): @@ -50,7 +52,23 @@ class OrganizationAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """OrganizationAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the organization.. [optional] # noqa: E501 + description (str): Description of the organization.. [optional] # noqa: E501 + disabled (bool): Whether or not the organization is disabled.. [optional] # noqa: E501 + modified_at (datetime): Time of last organization modification.. [optional] # noqa: E501 + name (str): Name of the organization.. [optional] # noqa: E501 + public_id (str): Public ID of the organization.. [optional] # noqa: E501 + sharing (str): Sharing type of the organization.. [optional] # noqa: E501 + url (str): URL of the site that this organization exists at.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/organizations_type.py b/src/datadog_api_client/v2/model/organizations_type.py index a16c5d9e34..4c9a57a3fd 100644 --- a/src/datadog_api_client/v2/model/organizations_type.py +++ b/src/datadog_api_client/v2/model/organizations_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class OrganizationsType(ModelSimple): @@ -50,7 +52,23 @@ class OrganizationsType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """OrganizationsType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Organizations resource type.. if omitted defaults to "orgs", must be one of ["orgs", ] # noqa: E501 + + Keyword Args: + value (str): Organizations resource type.. if omitted defaults to "orgs", must be one of ["orgs", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "orgs" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/pagination.py b/src/datadog_api_client/v2/model/pagination.py index 3eeeb504ca..c2cad6fb01 100644 --- a/src/datadog_api_client/v2/model/pagination.py +++ b/src/datadog_api_client/v2/model/pagination.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class Pagination(ModelNormal): @@ -50,7 +52,23 @@ class Pagination(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """Pagination - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + total_count (int): Total count.. [optional] # noqa: E501 + total_filtered_count (int): Total count of elements matched by the filter.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/partial_api_key.py b/src/datadog_api_client/v2/model/partial_api_key.py index d3fd19286c..e7ca89bdc5 100644 --- a/src/datadog_api_client/v2/model/partial_api_key.py +++ b/src/datadog_api_client/v2/model/partial_api_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class PartialAPIKey(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PartialAPIKey - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (PartialAPIKeyAttributes): [optional] # noqa: E501 + id (str): ID of the API key.. [optional] # noqa: E501 + relationships (APIKeyRelationships): [optional] # noqa: E501 + type (APIKeysType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/partial_api_key_attributes.py b/src/datadog_api_client/v2/model/partial_api_key_attributes.py index ccc263cafc..dc35eeb24f 100644 --- a/src/datadog_api_client/v2/model/partial_api_key_attributes.py +++ b/src/datadog_api_client/v2/model/partial_api_key_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class PartialAPIKeyAttributes(ModelNormal): @@ -55,7 +57,23 @@ class PartialAPIKeyAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +107,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PartialAPIKeyAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (str): Creation date of the API key.. [optional] # noqa: E501 + last4 (str): The last four characters of the API key.. [optional] # noqa: E501 + modified_at (str): Date the API key was last modified.. [optional] # noqa: E501 + name (str): Name of the API key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +273,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/partial_application_key.py b/src/datadog_api_client/v2/model/partial_application_key.py index 18ba1c0d8a..aa45412b16 100644 --- a/src/datadog_api_client/v2/model/partial_application_key.py +++ b/src/datadog_api_client/v2/model/partial_application_key.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class PartialApplicationKey(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PartialApplicationKey - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (PartialApplicationKeyAttributes): [optional] # noqa: E501 + id (str): ID of the application key.. [optional] # noqa: E501 + relationships (ApplicationKeyRelationships): [optional] # noqa: E501 + type (ApplicationKeysType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/partial_application_key_attributes.py b/src/datadog_api_client/v2/model/partial_application_key_attributes.py index 041ac66c69..fab4afc82c 100644 --- a/src/datadog_api_client/v2/model/partial_application_key_attributes.py +++ b/src/datadog_api_client/v2/model/partial_application_key_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class PartialApplicationKeyAttributes(ModelNormal): @@ -55,7 +57,23 @@ class PartialApplicationKeyAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +105,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PartialApplicationKeyAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (str): Creation date of the application key.. [optional] # noqa: E501 + last4 (str): The last four characters of the application key.. [optional] # noqa: E501 + name (str): Name of the application key.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -172,3 +269,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/permission.py b/src/datadog_api_client/v2/model/permission.py index a4c375f568..404d5565a9 100644 --- a/src/datadog_api_client/v2/model/permission.py +++ b/src/datadog_api_client/v2/model/permission.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class Permission(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """Permission - a model defined in OpenAPI + + Args: + type (PermissionsType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (PermissionAttributes): [optional] # noqa: E501 + id (str): ID of the permission.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/permission_attributes.py b/src/datadog_api_client/v2/model/permission_attributes.py index 30e06062b1..fe1df86ad8 100644 --- a/src/datadog_api_client/v2/model/permission_attributes.py +++ b/src/datadog_api_client/v2/model/permission_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class PermissionAttributes(ModelNormal): @@ -50,7 +52,23 @@ class PermissionAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,6 +108,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PermissionAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created (datetime): Creation time of the permission.. [optional] # noqa: E501 + description (str): Description of the permission.. [optional] # noqa: E501 + display_name (str): Displayed name for the permission.. [optional] # noqa: E501 + display_type (str): Display type.. [optional] # noqa: E501 + group_name (str): Name of the permission group.. [optional] # noqa: E501 + name (str): Name of the permission.. [optional] # noqa: E501 + restricted (bool): Whether or not the permission is restricted.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/permissions_response.py b/src/datadog_api_client/v2/model/permissions_response.py index acc99f16f7..83c16755f0 100644 --- a/src/datadog_api_client/v2/model/permissions_response.py +++ b/src/datadog_api_client/v2/model/permissions_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class PermissionsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """PermissionsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([Permission]): Array of permissions.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/permissions_type.py b/src/datadog_api_client/v2/model/permissions_type.py index 75a6f60a9c..823f302a70 100644 --- a/src/datadog_api_client/v2/model/permissions_type.py +++ b/src/datadog_api_client/v2/model/permissions_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class PermissionsType(ModelSimple): @@ -50,7 +52,23 @@ class PermissionsType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """PermissionsType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Permissions resource type.. if omitted defaults to "permissions", must be one of ["permissions", ] # noqa: E501 + + Keyword Args: + value (str): Permissions resource type.. if omitted defaults to "permissions", must be one of ["permissions", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "permissions" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/process_summaries_meta.py b/src/datadog_api_client/v2/model/process_summaries_meta.py index eb06ce45e4..ed4d14c3d5 100644 --- a/src/datadog_api_client/v2/model/process_summaries_meta.py +++ b/src/datadog_api_client/v2/model/process_summaries_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ProcessSummariesMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ProcessSummariesMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (ProcessSummariesMetaPage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/process_summaries_meta_page.py b/src/datadog_api_client/v2/model/process_summaries_meta_page.py index 58d194b12c..1912518b4e 100644 --- a/src/datadog_api_client/v2/model/process_summaries_meta_page.py +++ b/src/datadog_api_client/v2/model/process_summaries_meta_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ProcessSummariesMetaPage(ModelNormal): @@ -55,7 +57,23 @@ class ProcessSummariesMetaPage(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +103,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ProcessSummariesMetaPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + after (str): The cursor used to get the next results, if any. To make the next request, use the same parameters with the addition of the `page[cursor]`.. [optional] # noqa: E501 + size (int): Number of results returned.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -169,3 +265,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/process_summaries_response.py b/src/datadog_api_client/v2/model/process_summaries_response.py index ee37291a36..80a62fd820 100644 --- a/src/datadog_api_client/v2/model/process_summaries_response.py +++ b/src/datadog_api_client/v2/model/process_summaries_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ProcessSummariesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ProcessSummariesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([ProcessSummary]): Array of process summary objects.. [optional] # noqa: E501 + meta (ProcessSummariesMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/process_summary.py b/src/datadog_api_client/v2/model/process_summary.py index eb66d12af6..209af85e61 100644 --- a/src/datadog_api_client/v2/model/process_summary.py +++ b/src/datadog_api_client/v2/model/process_summary.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class ProcessSummary(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ProcessSummary - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (ProcessSummaryAttributes): [optional] # noqa: E501 + id (str): Process ID.. [optional] # noqa: E501 + type (ProcessSummaryType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/process_summary_attributes.py b/src/datadog_api_client/v2/model/process_summary_attributes.py index 0c7281f6e6..d17815337a 100644 --- a/src/datadog_api_client/v2/model/process_summary_attributes.py +++ b/src/datadog_api_client/v2/model/process_summary_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ProcessSummaryAttributes(ModelNormal): @@ -50,7 +52,23 @@ class ProcessSummaryAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ProcessSummaryAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cmdline (str): Process command line.. [optional] # noqa: E501 + host (str): Host running the process.. [optional] # noqa: E501 + pid (int): Process ID.. [optional] # noqa: E501 + ppid (int): Parent process ID.. [optional] # noqa: E501 + start (str): Time the process was started.. [optional] # noqa: E501 + tags ([str]): List of tags associated with the process.. [optional] # noqa: E501 + timestamp (str): Time the process was seen.. [optional] # noqa: E501 + user (str): Process owner.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/process_summary_type.py b/src/datadog_api_client/v2/model/process_summary_type.py index 8760f59c8f..ec12a699bb 100644 --- a/src/datadog_api_client/v2/model/process_summary_type.py +++ b/src/datadog_api_client/v2/model/process_summary_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class ProcessSummaryType(ModelSimple): @@ -50,7 +52,23 @@ class ProcessSummaryType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """ProcessSummaryType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Type of process summary.. if omitted defaults to "process", must be one of ["process", ] # noqa: E501 + + Keyword Args: + value (str): Type of process summary.. if omitted defaults to "process", must be one of ["process", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "process" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/query_sort_order.py b/src/datadog_api_client/v2/model/query_sort_order.py index 38eaaef7dc..3231f9b9c4 100644 --- a/src/datadog_api_client/v2/model/query_sort_order.py +++ b/src/datadog_api_client/v2/model/query_sort_order.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class QuerySortOrder(ModelSimple): @@ -51,7 +53,23 @@ class QuerySortOrder(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -174,3 +194,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """QuerySortOrder - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Direction of sort.. if omitted defaults to "desc", must be one of ["asc", "desc", ] # noqa: E501 + + Keyword Args: + value (str): Direction of sort.. if omitted defaults to "desc", must be one of ["asc", "desc", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "desc" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadata_data.py b/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadata_data.py index 4847e31d17..bd5a1d9376 100644 --- a/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadata_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadata_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToIncidentIntegrationMetadataData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """RelationshipToIncidentIntegrationMetadataData - a model defined in OpenAPI + + Args: + id (str): A unique identifier that represents the integration metadata. + type (IncidentIntegrationMetadataType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadatas.py b/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadatas.py index c05ec78b9d..ff7c79dde5 100644 --- a/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadatas.py +++ b/src/datadog_api_client/v2/model/relationship_to_incident_integration_metadatas.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class RelationshipToIncidentIntegrationMetadatas(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RelationshipToIncidentIntegrationMetadatas - a model defined in OpenAPI + + Args: + data ([RelationshipToIncidentIntegrationMetadataData]): The integration metadata relationship array + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_incident_postmortem.py b/src/datadog_api_client/v2/model/relationship_to_incident_postmortem.py index 036c4e2c8b..e10434b966 100644 --- a/src/datadog_api_client/v2/model/relationship_to_incident_postmortem.py +++ b/src/datadog_api_client/v2/model/relationship_to_incident_postmortem.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class RelationshipToIncidentPostmortem(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RelationshipToIncidentPostmortem - a model defined in OpenAPI + + Args: + data (RelationshipToIncidentPostmortemData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +272,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_incident_postmortem_data.py b/src/datadog_api_client/v2/model/relationship_to_incident_postmortem_data.py index 3917fc161c..a4f5a1057a 100644 --- a/src/datadog_api_client/v2/model/relationship_to_incident_postmortem_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_incident_postmortem_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToIncidentPostmortemData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """RelationshipToIncidentPostmortemData - a model defined in OpenAPI + + Args: + id (str): A unique identifier that represents the postmortem. + type (IncidentPostmortemType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_organization.py b/src/datadog_api_client/v2/model/relationship_to_organization.py index 7f4ff2966e..391d6c76db 100644 --- a/src/datadog_api_client/v2/model/relationship_to_organization.py +++ b/src/datadog_api_client/v2/model/relationship_to_organization.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToOrganization(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RelationshipToOrganization - a model defined in OpenAPI + + Args: + data (RelationshipToOrganizationData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_organization_data.py b/src/datadog_api_client/v2/model/relationship_to_organization_data.py index aa863ed595..cd2c25b4ee 100644 --- a/src/datadog_api_client/v2/model/relationship_to_organization_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_organization_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToOrganizationData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """RelationshipToOrganizationData - a model defined in OpenAPI + + Args: + id (str): ID of the organization. + type (OrganizationsType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_organizations.py b/src/datadog_api_client/v2/model/relationship_to_organizations.py index f4fdec4c58..0841f37b08 100644 --- a/src/datadog_api_client/v2/model/relationship_to_organizations.py +++ b/src/datadog_api_client/v2/model/relationship_to_organizations.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToOrganizations(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RelationshipToOrganizations - a model defined in OpenAPI + + Args: + data ([RelationshipToOrganizationData]): Relationships to organization objects. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_permission.py b/src/datadog_api_client/v2/model/relationship_to_permission.py index cd2eea2f9e..62f4530164 100644 --- a/src/datadog_api_client/v2/model/relationship_to_permission.py +++ b/src/datadog_api_client/v2/model/relationship_to_permission.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToPermission(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RelationshipToPermission - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (RelationshipToPermissionData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_permission_data.py b/src/datadog_api_client/v2/model/relationship_to_permission_data.py index de31cf99b5..007ccbed44 100644 --- a/src/datadog_api_client/v2/model/relationship_to_permission_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_permission_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToPermissionData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RelationshipToPermissionData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): ID of the permission.. [optional] # noqa: E501 + type (PermissionsType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_permissions.py b/src/datadog_api_client/v2/model/relationship_to_permissions.py index 2c1ebb56fb..a797e2a994 100644 --- a/src/datadog_api_client/v2/model/relationship_to_permissions.py +++ b/src/datadog_api_client/v2/model/relationship_to_permissions.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToPermissions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RelationshipToPermissions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([RelationshipToPermissionData]): Relationships to permission objects.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_role.py b/src/datadog_api_client/v2/model/relationship_to_role.py index fea73ee00c..be11d880da 100644 --- a/src/datadog_api_client/v2/model/relationship_to_role.py +++ b/src/datadog_api_client/v2/model/relationship_to_role.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToRole(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RelationshipToRole - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (RelationshipToRoleData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_role_data.py b/src/datadog_api_client/v2/model/relationship_to_role_data.py index 9d1c5a33c3..b2bd89ec42 100644 --- a/src/datadog_api_client/v2/model/relationship_to_role_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_role_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToRoleData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RelationshipToRoleData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + id (str): ID of the role.. [optional] # noqa: E501 + type (RolesType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_roles.py b/src/datadog_api_client/v2/model/relationship_to_roles.py index 930a6bedb4..115d6daec0 100644 --- a/src/datadog_api_client/v2/model/relationship_to_roles.py +++ b/src/datadog_api_client/v2/model/relationship_to_roles.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToRoles(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RelationshipToRoles - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([RelationshipToRoleData]): An array containing type and ID of a role.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_user.py b/src/datadog_api_client/v2/model/relationship_to_user.py index 7c4211d041..ae16181f99 100644 --- a/src/datadog_api_client/v2/model/relationship_to_user.py +++ b/src/datadog_api_client/v2/model/relationship_to_user.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToUser(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RelationshipToUser - a model defined in OpenAPI + + Args: + data (RelationshipToUserData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_user_data.py b/src/datadog_api_client/v2/model/relationship_to_user_data.py index 7ef99fc222..29e6a3e1e5 100644 --- a/src/datadog_api_client/v2/model/relationship_to_user_data.py +++ b/src/datadog_api_client/v2/model/relationship_to_user_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToUserData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, type, *args, **kwargs): # noqa: E501 + """RelationshipToUserData - a model defined in OpenAPI + + Args: + id (str): A unique identifier that represents the user. + type (UsersType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -175,3 +276,8 @@ def __init__(self, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/relationship_to_users.py b/src/datadog_api_client/v2/model/relationship_to_users.py index 498122d13f..b8b1253ea7 100644 --- a/src/datadog_api_client/v2/model/relationship_to_users.py +++ b/src/datadog_api_client/v2/model/relationship_to_users.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RelationshipToUsers(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RelationshipToUsers - a model defined in OpenAPI + + Args: + data ([RelationshipToUserData]): Relationships to user objects. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/response_meta_attributes.py b/src/datadog_api_client/v2/model/response_meta_attributes.py index 26f745c60b..70eafc3317 100644 --- a/src/datadog_api_client/v2/model/response_meta_attributes.py +++ b/src/datadog_api_client/v2/model/response_meta_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class ResponseMetaAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """ResponseMetaAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (Pagination): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role.py b/src/datadog_api_client/v2/model/role.py index b6add838c9..db2356d1b8 100644 --- a/src/datadog_api_client/v2/model/role.py +++ b/src/datadog_api_client/v2/model/role.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class Role(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """Role - a model defined in OpenAPI + + Args: + type (RolesType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (RoleAttributes): [optional] # noqa: E501 + id (str): ID of the role.. [optional] # noqa: E501 + relationships (RoleResponseRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +286,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_attributes.py b/src/datadog_api_client/v2/model/role_attributes.py index 9aa1215d91..554e67a572 100644 --- a/src/datadog_api_client/v2/model/role_attributes.py +++ b/src/datadog_api_client/v2/model/role_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class RoleAttributes(ModelNormal): @@ -50,7 +52,23 @@ class RoleAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the role.. [optional] # noqa: E501 + modified_at (datetime): Time of last role modification.. [optional] # noqa: E501 + name (str): Name of the role.. [optional] # noqa: E501 + user_count (int): Number of users with that role.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_create_attributes.py b/src/datadog_api_client/v2/model/role_create_attributes.py index eec0138a91..ac8c8c7771 100644 --- a/src/datadog_api_client/v2/model/role_create_attributes.py +++ b/src/datadog_api_client/v2/model/role_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class RoleCreateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class RoleCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 + """RoleCreateAttributes - a model defined in OpenAPI + + Args: + name (str): Name of the role. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the role.. [optional] # noqa: E501 + modified_at (datetime): Time of last role modification.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +270,8 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_create_data.py b/src/datadog_api_client/v2/model/role_create_data.py index e448e2f980..4849496ae0 100644 --- a/src/datadog_api_client/v2/model/role_create_data.py +++ b/src/datadog_api_client/v2/model/role_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class RoleCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, *args, **kwargs): # noqa: E501 + """RoleCreateData - a model defined in OpenAPI + + Args: + attributes (RoleCreateAttributes): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + relationships (RoleRelationships): [optional] # noqa: E501 + type (RolesType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +282,8 @@ def __init__(self, attributes, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_create_request.py b/src/datadog_api_client/v2/model/role_create_request.py index 7085365da0..8dc5c3937d 100644 --- a/src/datadog_api_client/v2/model/role_create_request.py +++ b/src/datadog_api_client/v2/model/role_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RoleCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RoleCreateRequest - a model defined in OpenAPI + + Args: + data (RoleCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_create_response.py b/src/datadog_api_client/v2/model/role_create_response.py index a73e5a1342..3a814caa44 100644 --- a/src/datadog_api_client/v2/model/role_create_response.py +++ b/src/datadog_api_client/v2/model/role_create_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RoleCreateResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleCreateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (RoleCreateResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_create_response_data.py b/src/datadog_api_client/v2/model/role_create_response_data.py index 2d6106bcc4..ee7c5ac9b1 100644 --- a/src/datadog_api_client/v2/model/role_create_response_data.py +++ b/src/datadog_api_client/v2/model/role_create_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class RoleCreateResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """RoleCreateResponseData - a model defined in OpenAPI + + Args: + type (RolesType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (RoleCreateAttributes): [optional] # noqa: E501 + id (str): ID of the role.. [optional] # noqa: E501 + relationships (RoleResponseRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +286,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_relationships.py b/src/datadog_api_client/v2/model/role_relationships.py index 37f9ff8bc2..881c8e5a34 100644 --- a/src/datadog_api_client/v2/model/role_relationships.py +++ b/src/datadog_api_client/v2/model/role_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class RoleRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + permissions (RelationshipToPermissions): [optional] # noqa: E501 + users (RelationshipToUsers): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_response.py b/src/datadog_api_client/v2/model/role_response.py index 5830356681..87116a66de 100644 --- a/src/datadog_api_client/v2/model/role_response.py +++ b/src/datadog_api_client/v2/model/role_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RoleResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (Role): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_response_relationships.py b/src/datadog_api_client/v2/model/role_response_relationships.py index 6c010aaa9a..2c39c93884 100644 --- a/src/datadog_api_client/v2/model/role_response_relationships.py +++ b/src/datadog_api_client/v2/model/role_response_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RoleResponseRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleResponseRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + permissions (RelationshipToPermissions): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_update_attributes.py b/src/datadog_api_client/v2/model/role_update_attributes.py index a9d1744c1b..917543b4a4 100644 --- a/src/datadog_api_client/v2/model/role_update_attributes.py +++ b/src/datadog_api_client/v2/model/role_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class RoleUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class RoleUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleUpdateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the role.. [optional] # noqa: E501 + modified_at (datetime): Time of last role modification.. [optional] # noqa: E501 + name (str): Name of the role.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_update_data.py b/src/datadog_api_client/v2/model/role_update_data.py index 7995ebc5b7..c07fcaffd3 100644 --- a/src/datadog_api_client/v2/model/role_update_data.py +++ b/src/datadog_api_client/v2/model/role_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class RoleUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """RoleUpdateData - a model defined in OpenAPI + + Args: + attributes (RoleUpdateAttributes): + id (str): ID of the role. + type (RolesType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_update_request.py b/src/datadog_api_client/v2/model/role_update_request.py index af7eb598f4..4e6549c522 100644 --- a/src/datadog_api_client/v2/model/role_update_request.py +++ b/src/datadog_api_client/v2/model/role_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RoleUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """RoleUpdateRequest - a model defined in OpenAPI + + Args: + data (RoleUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_update_response.py b/src/datadog_api_client/v2/model/role_update_response.py index bbee1a1969..973757007d 100644 --- a/src/datadog_api_client/v2/model/role_update_response.py +++ b/src/datadog_api_client/v2/model/role_update_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class RoleUpdateResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RoleUpdateResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (RoleUpdateResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/role_update_response_data.py b/src/datadog_api_client/v2/model/role_update_response_data.py index 935b8e2b68..0d8be5ff25 100644 --- a/src/datadog_api_client/v2/model/role_update_response_data.py +++ b/src/datadog_api_client/v2/model/role_update_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class RoleUpdateResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, type, *args, **kwargs): # noqa: E501 + """RoleUpdateResponseData - a model defined in OpenAPI + + Args: + type (RolesType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (RoleUpdateAttributes): [optional] # noqa: E501 + id (str): ID of the role.. [optional] # noqa: E501 + relationships (RoleResponseRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -184,3 +286,8 @@ def __init__(self, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/roles_response.py b/src/datadog_api_client/v2/model/roles_response.py index de04e7c735..10ce0c9540 100644 --- a/src/datadog_api_client/v2/model/roles_response.py +++ b/src/datadog_api_client/v2/model/roles_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class RolesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """RolesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([Role]): Array of returned roles.. [optional] # noqa: E501 + meta (ResponseMetaAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/roles_sort.py b/src/datadog_api_client/v2/model/roles_sort.py index 3d69baf784..21831d2179 100644 --- a/src/datadog_api_client/v2/model/roles_sort.py +++ b/src/datadog_api_client/v2/model/roles_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class RolesSort(ModelSimple): @@ -55,7 +57,23 @@ class RolesSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -79,6 +97,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """RolesSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Sorting options for roles.. if omitted defaults to "name", must be one of ["name", "-name", "modified_at", "-modified_at", "user_count", "-user_count", ] # noqa: E501 + + Keyword Args: + value (str): Sorting options for roles.. if omitted defaults to "name", must be one of ["name", "-name", "modified_at", "-modified_at", "user_count", "-user_count", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "name" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/roles_type.py b/src/datadog_api_client/v2/model/roles_type.py index 7ea435c0a1..eff20680d7 100644 --- a/src/datadog_api_client/v2/model/roles_type.py +++ b/src/datadog_api_client/v2/model/roles_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class RolesType(ModelSimple): @@ -50,7 +52,23 @@ class RolesType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """RolesType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Roles type.. if omitted defaults to "roles", must be one of ["roles", ] # noqa: E501 + + Keyword Args: + value (str): Roles type.. if omitted defaults to "roles", must be one of ["roles", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "roles" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_filter.py b/src/datadog_api_client/v2/model/security_filter.py index d33978d08d..82facde0df 100644 --- a/src/datadog_api_client/v2/model/security_filter.py +++ b/src/datadog_api_client/v2/model/security_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (SecurityFilterAttributes): [optional] # noqa: E501 + id (str): The ID of the security filter.. [optional] # noqa: E501 + type (SecurityFilterType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_attributes.py b/src/datadog_api_client/v2/model/security_filter_attributes.py index 77413d533c..fa74736b1e 100644 --- a/src/datadog_api_client/v2/model/security_filter_attributes.py +++ b/src/datadog_api_client/v2/model/security_filter_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SecurityFilterAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,6 +124,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFilterAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + exclusion_filters ([SecurityFilterExclusionFilterResponse]): The list of exclusion filters applied in this security filter.. [optional] # noqa: E501 + filtered_data_type (SecurityFilterFilteredDataType): [optional] # noqa: E501 + is_builtin (bool): Whether the security filter is the built-in filter.. [optional] # noqa: E501 + is_enabled (bool): Whether the security filter is enabled.. [optional] # noqa: E501 + name (str): The security filter name.. [optional] # noqa: E501 + query (str): The security filter query. Logs accepted by this query will be accepted by this filter.. [optional] # noqa: E501 + version (int): The version of the security filter.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -194,3 +296,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_create_attributes.py b/src/datadog_api_client/v2/model/security_filter_create_attributes.py index 61fe897901..13e6d43263 100644 --- a/src/datadog_api_client/v2/model/security_filter_create_attributes.py +++ b/src/datadog_api_client/v2/model/security_filter_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityFilterCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,96 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls, exclusion_filters, filtered_data_type, is_enabled, name, query, *args, **kwargs + ): # noqa: E501 + """SecurityFilterCreateAttributes - a model defined in OpenAPI + + Args: + exclusion_filters ([SecurityFilterExclusionFilter]): Exclusion filters to exclude some logs from the security filter. + filtered_data_type (SecurityFilterFilteredDataType): + is_enabled (bool): Whether the security filter is enabled. + name (str): The name of the security filter. + query (str): The query of the security filter. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.exclusion_filters = exclusion_filters + self.filtered_data_type = filtered_data_type + self.is_enabled = is_enabled + self.name = name + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +298,8 @@ def __init__(self, exclusion_filters, filtered_data_type, is_enabled, name, quer # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_create_data.py b/src/datadog_api_client/v2/model/security_filter_create_data.py index 7b8569884c..c9acac8f21 100644 --- a/src/datadog_api_client/v2/model/security_filter_create_data.py +++ b/src/datadog_api_client/v2/model/security_filter_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityFilterCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """SecurityFilterCreateData - a model defined in OpenAPI + + Args: + attributes (SecurityFilterCreateAttributes): + type (SecurityFilterType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_create_request.py b/src/datadog_api_client/v2/model/security_filter_create_request.py index 2810df19e2..08caa6cc27 100644 --- a/src/datadog_api_client/v2/model/security_filter_create_request.py +++ b/src/datadog_api_client/v2/model/security_filter_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SecurityFilterCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """SecurityFilterCreateRequest - a model defined in OpenAPI + + Args: + data (SecurityFilterCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_exclusion_filter.py b/src/datadog_api_client/v2/model/security_filter_exclusion_filter.py index 790bd80c1f..fb8e165772 100644 --- a/src/datadog_api_client/v2/model/security_filter_exclusion_filter.py +++ b/src/datadog_api_client/v2/model/security_filter_exclusion_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityFilterExclusionFilter(ModelNormal): @@ -50,7 +52,23 @@ class SecurityFilterExclusionFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, name, query, *args, **kwargs): # noqa: E501 + """SecurityFilterExclusionFilter - a model defined in OpenAPI + + Args: + name (str): Exclusion filter name. + query (str): Exclusion filter query. Logs that match this query are excluded from the security filter. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +268,8 @@ def __init__(self, name, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_exclusion_filter_response.py b/src/datadog_api_client/v2/model/security_filter_exclusion_filter_response.py index 638b995a82..5c34f3a739 100644 --- a/src/datadog_api_client/v2/model/security_filter_exclusion_filter_response.py +++ b/src/datadog_api_client/v2/model/security_filter_exclusion_filter_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityFilterExclusionFilterResponse(ModelNormal): @@ -50,7 +52,23 @@ class SecurityFilterExclusionFilterResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFilterExclusionFilterResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The exclusion filter name.. [optional] # noqa: E501 + query (str): The exclusion filter query.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_filtered_data_type.py b/src/datadog_api_client/v2/model/security_filter_filtered_data_type.py index 494af3e1e0..fd39d27fd3 100644 --- a/src/datadog_api_client/v2/model/security_filter_filtered_data_type.py +++ b/src/datadog_api_client/v2/model/security_filter_filtered_data_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityFilterFilteredDataType(ModelSimple): @@ -50,7 +52,23 @@ class SecurityFilterFilteredDataType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityFilterFilteredDataType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The filtered data type.. if omitted defaults to "logs", must be one of ["logs", ] # noqa: E501 + + Keyword Args: + value (str): The filtered data type.. if omitted defaults to "logs", must be one of ["logs", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "logs" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_filter_meta.py b/src/datadog_api_client/v2/model/security_filter_meta.py index 9e42330169..a88db2c242 100644 --- a/src/datadog_api_client/v2/model/security_filter_meta.py +++ b/src/datadog_api_client/v2/model/security_filter_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityFilterMeta(ModelNormal): @@ -50,7 +52,23 @@ class SecurityFilterMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFilterMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + warning (str): A warning message.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_response.py b/src/datadog_api_client/v2/model/security_filter_response.py index f6e467e9a6..30dac11a7c 100644 --- a/src/datadog_api_client/v2/model/security_filter_response.py +++ b/src/datadog_api_client/v2/model/security_filter_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityFilterResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFilterResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (SecurityFilter): [optional] # noqa: E501 + meta (SecurityFilterMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_type.py b/src/datadog_api_client/v2/model/security_filter_type.py index 894281e13c..345376466c 100644 --- a/src/datadog_api_client/v2/model/security_filter_type.py +++ b/src/datadog_api_client/v2/model/security_filter_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityFilterType(ModelSimple): @@ -50,7 +52,23 @@ class SecurityFilterType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityFilterType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of the resource. The value should always be `security_filters`.. if omitted defaults to "security_filters", must be one of ["security_filters", ] # noqa: E501 + + Keyword Args: + value (str): The type of the resource. The value should always be `security_filters`.. if omitted defaults to "security_filters", must be one of ["security_filters", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "security_filters" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_filter_update_attributes.py b/src/datadog_api_client/v2/model/security_filter_update_attributes.py index 8c0c62ff2d..68f1d4e032 100644 --- a/src/datadog_api_client/v2/model/security_filter_update_attributes.py +++ b/src/datadog_api_client/v2/model/security_filter_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SecurityFilterUpdateAttributes(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFilterUpdateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + exclusion_filters ([SecurityFilterExclusionFilter]): Exclusion filters to exclude some logs from the security filter.. [optional] # noqa: E501 + filtered_data_type (SecurityFilterFilteredDataType): [optional] # noqa: E501 + is_enabled (bool): Whether the security filter is enabled.. [optional] # noqa: E501 + name (str): The name of the security filter.. [optional] # noqa: E501 + query (str): The query of the security filter.. [optional] # noqa: E501 + version (int): The version of the security filter to update.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -189,3 +290,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_update_data.py b/src/datadog_api_client/v2/model/security_filter_update_data.py index c86a6e72c9..e8b2008000 100644 --- a/src/datadog_api_client/v2/model/security_filter_update_data.py +++ b/src/datadog_api_client/v2/model/security_filter_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityFilterUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """SecurityFilterUpdateData - a model defined in OpenAPI + + Args: + attributes (SecurityFilterUpdateAttributes): + type (SecurityFilterType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filter_update_request.py b/src/datadog_api_client/v2/model/security_filter_update_request.py index b003568a86..6ec6717f4b 100644 --- a/src/datadog_api_client/v2/model/security_filter_update_request.py +++ b/src/datadog_api_client/v2/model/security_filter_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SecurityFilterUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """SecurityFilterUpdateRequest - a model defined in OpenAPI + + Args: + data (SecurityFilterUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_filters_response.py b/src/datadog_api_client/v2/model/security_filters_response.py index 1b701bbcf2..7d331cd68a 100644 --- a/src/datadog_api_client/v2/model/security_filters_response.py +++ b/src/datadog_api_client/v2/model/security_filters_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityFiltersResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityFiltersResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([SecurityFilter]): A list of security filters objects.. [optional] # noqa: E501 + meta (SecurityFilterMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_filter.py b/src/datadog_api_client/v2/model/security_monitoring_filter.py index 2917d05efa..79b8e03b3c 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_filter.py +++ b/src/datadog_api_client/v2/model/security_monitoring_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SecurityMonitoringFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + action (SecurityMonitoringFilterAction): [optional] # noqa: E501 + query (str): Query for selecting logs to apply the filtering action.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_filter_action.py b/src/datadog_api_client/v2/model/security_monitoring_filter_action.py index cf95f6637c..18509a0668 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_filter_action.py +++ b/src/datadog_api_client/v2/model/security_monitoring_filter_action.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringFilterAction(ModelSimple): @@ -51,7 +53,23 @@ class SecurityMonitoringFilterAction(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringFilterAction - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of filtering action.., must be one of ["require", "suppress", ] # noqa: E501 + + Keyword Args: + value (str): The type of filtering action.., must be one of ["require", "suppress", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py b/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py index d1c54946f7..0e2a19dd16 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py +++ b/src/datadog_api_client/v2/model/security_monitoring_list_rules_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityMonitoringListRulesResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringListRulesResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([SecurityMonitoringRuleResponse]): Array containing the list of rules.. [optional] # noqa: E501 + meta (ResponseMetaAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_case.py b/src/datadog_api_client/v2/model/security_monitoring_rule_case.py index d27b25e97a..012d9f1dc5 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_case.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_case.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SecurityMonitoringRuleCase(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleCase - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + condition (str): A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated based on the event counts in the previously defined queries.. [optional] # noqa: E501 + name (str): Name of the case.. [optional] # noqa: E501 + notifications ([str]): Notification targets for each rule case.. [optional] # noqa: E501 + status (SecurityMonitoringRuleSeverity): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py b/src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py index 56a76c2e25..1e57e77fa4 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_case_create.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class SecurityMonitoringRuleCaseCreate(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, status, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleCaseCreate - a model defined in OpenAPI + + Args: + status (SecurityMonitoringRuleSeverity): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + condition (str): A rule case contains logical operations (`>`,`>=`, `&&`, `||`) to determine if a signal should be generated based on the event counts in the previously defined queries.. [optional] # noqa: E501 + name (str): Name of the case.. [optional] # noqa: E501 + notifications ([str]): Notification targets for each rule case.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.status = status + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -180,3 +282,8 @@ def __init__(self, status, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py b/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py index 2c1af3df5b..dd675ca981 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_create_payload.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SecurityMonitoringRuleCreatePayload(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -107,6 +126,99 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, cases, is_enabled, message, name, options, queries, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleCreatePayload - a model defined in OpenAPI + + Args: + cases ([SecurityMonitoringRuleCaseCreate]): Cases for generating signals. + is_enabled (bool): Whether the rule is enabled. + message (str): Message for generated signals. + name (str): The name of the rule. + options (SecurityMonitoringRuleOptions): + queries ([SecurityMonitoringRuleQueryCreate]): Queries for selecting logs which are part of the rule. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filters ([SecurityMonitoringFilter]): Additional queries to filter matched events before they are processed.. [optional] # noqa: E501 + has_extended_title (bool): Whether the notifications include the triggering group-by values in their title.. [optional] # noqa: E501 + tags ([str]): Tags for generated signals.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.cases = cases + self.is_enabled = is_enabled + self.message = message + self.name = name + self.options = options + self.queries = queries + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -206,3 +318,8 @@ def __init__(self, cases, is_enabled, message, name, options, queries, *args, ** # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_detection_method.py b/src/datadog_api_client/v2/model/security_monitoring_rule_detection_method.py index 0709fe0300..a95cd7863c 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_detection_method.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_detection_method.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleDetectionMethod(ModelSimple): @@ -52,7 +54,23 @@ class SecurityMonitoringRuleDetectionMethod(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleDetectionMethod - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The detection method.., must be one of ["threshold", "new_value", "anomaly_detection", ] # noqa: E501 + + Keyword Args: + value (str): The detection method.., must be one of ["threshold", "new_value", "anomaly_detection", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_evaluation_window.py b/src/datadog_api_client/v2/model/security_monitoring_rule_evaluation_window.py index 4b7745ebe9..601125498d 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_evaluation_window.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_evaluation_window.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleEvaluationWindow(ModelSimple): @@ -57,7 +59,23 @@ class SecurityMonitoringRuleEvaluationWindow(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -81,6 +99,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -184,3 +204,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleEvaluationWindow - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): A time window is specified to match when at least one of the cases matches true. This is a sliding window and evaluates in real time.., must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, ] # noqa: E501 + + Keyword Args: + value (int): A time window is specified to match when at least one of the cases matches true. This is a sliding window and evaluates in real time.., must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_keep_alive.py b/src/datadog_api_client/v2/model/security_monitoring_rule_keep_alive.py index 825b09b9fd..fdb6aa32f7 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_keep_alive.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_keep_alive.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleKeepAlive(ModelSimple): @@ -59,7 +61,23 @@ class SecurityMonitoringRuleKeepAlive(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -83,6 +101,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -186,3 +206,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleKeepAlive - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): Once a signal is generated, the signal will remain “open” if a case is matched at least once within this keep alive window.., must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, ] # noqa: E501 + + Keyword Args: + value (int): Once a signal is generated, the signal will remain “open” if a case is matched at least once within this keep alive window.., must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_max_signal_duration.py b/src/datadog_api_client/v2/model/security_monitoring_rule_max_signal_duration.py index 4d3af8a95a..bb72546525 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_max_signal_duration.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_max_signal_duration.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleMaxSignalDuration(ModelSimple): @@ -61,7 +63,23 @@ class SecurityMonitoringRuleMaxSignalDuration(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +103,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -188,3 +208,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleMaxSignalDuration - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): A signal will “close” regardless of the query being matched once the time exceeds the maximum duration. This time is calculated from the first seen timestamp.., must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400, ] # noqa: E501 + + Keyword Args: + value (int): A signal will “close” regardless of the query being matched once the time exceeds the maximum duration. This time is calculated from the first seen timestamp.., must be one of [0, 60, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200, 86400, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options.py b/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options.py index 074ec06129..00f6be9d66 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SecurityMonitoringRuleNewValueOptions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleNewValueOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + forget_after (SecurityMonitoringRuleNewValueOptionsForgetAfter): [optional] # noqa: E501 + learning_duration (SecurityMonitoringRuleNewValueOptionsLearningDuration): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -179,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_forget_after.py b/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_forget_after.py index 48abfd9933..2203122d74 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_forget_after.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_forget_after.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleNewValueOptionsForgetAfter(ModelSimple): @@ -55,7 +57,23 @@ class SecurityMonitoringRuleNewValueOptionsForgetAfter(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -79,6 +97,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -182,3 +202,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleNewValueOptionsForgetAfter - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): The duration in days after which a learned value is forgotten.., must be one of [1, 2, 7, 14, 21, 28, ] # noqa: E501 + + Keyword Args: + value (int): The duration in days after which a learned value is forgotten.., must be one of [1, 2, 7, 14, 21, 28, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py b/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py index 53bc074499..2651989e2b 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_new_value_options_learning_duration.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleNewValueOptionsLearningDuration(ModelSimple): @@ -52,7 +54,23 @@ class SecurityMonitoringRuleNewValueOptionsLearningDuration(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -76,6 +94,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -179,3 +199,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleNewValueOptionsLearningDuration - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (int): The duration in days during which values are learned, and after which signals will be generated for values that weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.., must be one of [0, 1, 7, ] # noqa: E501 + + Keyword Args: + value (int): The duration in days during which values are learned, and after which signals will be generated for values that weren't learned. If set to 0, a signal will be generated for all new values after the first value is learned.., must be one of [0, 1, 7, ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_options.py b/src/datadog_api_client/v2/model/security_monitoring_rule_options.py index 897020f8da..50813c959a 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_options.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_options.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -72,7 +74,24 @@ class SecurityMonitoringRuleOptions(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -109,6 +128,87 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleOptions - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + detection_method (SecurityMonitoringRuleDetectionMethod): [optional] # noqa: E501 + evaluation_window (SecurityMonitoringRuleEvaluationWindow): [optional] # noqa: E501 + keep_alive (SecurityMonitoringRuleKeepAlive): [optional] # noqa: E501 + max_signal_duration (SecurityMonitoringRuleMaxSignalDuration): [optional] # noqa: E501 + new_value_options (SecurityMonitoringRuleNewValueOptions): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -196,3 +296,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_query.py b/src/datadog_api_client/v2/model/security_monitoring_rule_query.py index a6cc84cc41..ee06520fb4 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_query.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_query.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SecurityMonitoringRuleQuery(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleQuery - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_rule (SecurityMonitoringRuntimeAgentRule): [optional] # noqa: E501 + aggregation (SecurityMonitoringRuleQueryAggregation): [optional] # noqa: E501 + distinct_fields ([str]): Field for which the cardinality is measured. Sent as an array.. [optional] # noqa: E501 + group_by_fields ([str]): Fields to group by.. [optional] # noqa: E501 + metric (str): The target field to aggregate over when using the sum or max aggregations.. [optional] # noqa: E501 + name (str): Name of the query.. [optional] # noqa: E501 + query (str): Query to run on logs.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -190,3 +292,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_query_aggregation.py b/src/datadog_api_client/v2/model/security_monitoring_rule_query_aggregation.py index 698408cf94..05f77c3f6c 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_query_aggregation.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_query_aggregation.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleQueryAggregation(ModelSimple): @@ -54,7 +56,23 @@ class SecurityMonitoringRuleQueryAggregation(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleQueryAggregation - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The aggregation type.., must be one of ["count", "cardinality", "sum", "max", "new_value", ] # noqa: E501 + + Keyword Args: + value (str): The aggregation type.., must be one of ["count", "cardinality", "sum", "max", "new_value", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_query_create.py b/src/datadog_api_client/v2/model/security_monitoring_rule_query_create.py index 42c9aa5039..eafe58f40d 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_query_create.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_query_create.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class SecurityMonitoringRuleQueryCreate(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -101,6 +120,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, query, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleQueryCreate - a model defined in OpenAPI + + Args: + query (str): Query to run on logs. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_rule (SecurityMonitoringRuntimeAgentRule): [optional] # noqa: E501 + aggregation (SecurityMonitoringRuleQueryAggregation): [optional] # noqa: E501 + distinct_fields ([str]): Field for which the cardinality is measured. Sent as an array.. [optional] # noqa: E501 + group_by_fields ([str]): Fields to group by.. [optional] # noqa: E501 + metric (str): The target field to aggregate over when using the sum or max aggregations.. [optional] # noqa: E501 + name (str): Name of the query.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.query = query + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -193,3 +298,8 @@ def __init__(self, query, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_response.py b/src/datadog_api_client/v2/model/security_monitoring_rule_response.py index 0d182757d2..d0c29ce629 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_response.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class SecurityMonitoringRuleResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -121,6 +140,98 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cases ([SecurityMonitoringRuleCase]): Cases for generating signals.. [optional] # noqa: E501 + created_at (int): When the rule was created, timestamp in milliseconds.. [optional] # noqa: E501 + creation_author_id (int): User ID of the user who created the rule.. [optional] # noqa: E501 + filters ([SecurityMonitoringFilter]): Additional queries to filter matched events before they are processed.. [optional] # noqa: E501 + has_extended_title (bool): Whether the notifications include the triggering group-by values in their title.. [optional] # noqa: E501 + id (str): The ID of the rule.. [optional] # noqa: E501 + is_default (bool): Whether the rule is included by default.. [optional] # noqa: E501 + is_deleted (bool): Whether the rule has been deleted.. [optional] # noqa: E501 + is_enabled (bool): Whether the rule is enabled.. [optional] # noqa: E501 + message (str): Message for generated signals.. [optional] # noqa: E501 + name (str): The name of the rule.. [optional] # noqa: E501 + options (SecurityMonitoringRuleOptions): [optional] # noqa: E501 + queries ([SecurityMonitoringRuleQuery]): Queries for selecting logs which are part of the rule.. [optional] # noqa: E501 + tags ([str]): Tags for generated signals.. [optional] # noqa: E501 + update_author_id (int): User ID of the user who updated the rule.. [optional] # noqa: E501 + version (int): The version of the rule.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -219,3 +330,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_severity.py b/src/datadog_api_client/v2/model/security_monitoring_rule_severity.py index 20de88226b..796aea270d 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_severity.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_severity.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuleSeverity(ModelSimple): @@ -54,7 +56,23 @@ class SecurityMonitoringRuleSeverity(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -181,3 +201,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringRuleSeverity - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Severity of the Security Signal.., must be one of ["info", "low", "medium", "high", "critical", ] # noqa: E501 + + Keyword Args: + value (str): Severity of the Security Signal.., must be one of ["info", "low", "medium", "high", "critical", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py b/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py index 5a824310a5..92928e861c 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py +++ b/src/datadog_api_client/v2/model/security_monitoring_rule_update_payload.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -66,7 +68,24 @@ class SecurityMonitoringRuleUpdatePayload(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -113,6 +132,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuleUpdatePayload - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cases ([SecurityMonitoringRuleCase]): Cases for generating signals.. [optional] # noqa: E501 + filters ([SecurityMonitoringFilter]): Additional queries to filter matched events before they are processed.. [optional] # noqa: E501 + has_extended_title (bool): Whether the notifications include the triggering group-by values in their title.. [optional] # noqa: E501 + is_enabled (bool): Whether the rule is enabled.. [optional] # noqa: E501 + message (str): Message for generated signals.. [optional] # noqa: E501 + name (str): Name of the rule.. [optional] # noqa: E501 + options (SecurityMonitoringRuleOptions): [optional] # noqa: E501 + queries ([SecurityMonitoringRuleQuery]): Queries for selecting logs which are part of the rule.. [optional] # noqa: E501 + tags ([str]): Tags for generated signals.. [optional] # noqa: E501 + version (int): The version of the rule being updated.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -205,3 +310,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_runtime_agent_rule.py b/src/datadog_api_client/v2/model/security_monitoring_runtime_agent_rule.py index 4bd4ccda02..90872da6a1 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_runtime_agent_rule.py +++ b/src/datadog_api_client/v2/model/security_monitoring_runtime_agent_rule.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringRuntimeAgentRule(ModelNormal): @@ -50,7 +52,23 @@ class SecurityMonitoringRuntimeAgentRule(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -80,6 +98,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringRuntimeAgentRule - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + agent_rule_id (str): The Agent rule ID. Must be unique within the rule.. [optional] # noqa: E501 + expression (str): A Runtime Security expression determines what activity should be collected by the Datadog Agent. These logical expressions can use predefined operators and attributes. Tags cannot be used in Runtime Security expressions. Instead, allow or deny based on tags under the advanced option.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -164,3 +260,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signal.py b/src/datadog_api_client/v2/model/security_monitoring_signal.py index d35d80429c..06b738a4a2 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signal.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signal.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityMonitoringSignal(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignal - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (SecurityMonitoringSignalAttributes): [optional] # noqa: E501 + id (str): The unique ID of the security signal.. [optional] # noqa: E501 + type (SecurityMonitoringSignalType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signal_attributes.py b/src/datadog_api_client/v2/model/security_monitoring_signal_attributes.py index cf2ffdcd1c..2a276ad280 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signal_attributes.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signal_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalAttributes(ModelNormal): @@ -50,7 +52,23 @@ class SecurityMonitoringSignalAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): A JSON object of attributes in the security signal.. [optional] # noqa: E501 + message (str): The message in the security signal defined by the rule that generated the signal.. [optional] # noqa: E501 + tags ([bool, date, datetime, dict, float, int, list, str, none_type]): An array of tags associated with the security signal.. [optional] # noqa: E501 + timestamp (datetime): The timestamp of the security signal.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signal_list_request.py b/src/datadog_api_client/v2/model/security_monitoring_signal_list_request.py index fedd77bee5..815fcb418a 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signal_list_request.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signal_list_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SecurityMonitoringSignalListRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalListRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + filter (SecurityMonitoringSignalListRequestFilter): [optional] # noqa: E501 + page (SecurityMonitoringSignalListRequestPage): [optional] # noqa: E501 + sort (SecurityMonitoringSignalsSort): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_filter.py b/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_filter.py index deada4d02d..681c6fd743 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_filter.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_filter.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalListRequestFilter(ModelNormal): @@ -50,7 +52,23 @@ class SecurityMonitoringSignalListRequestFilter(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalListRequestFilter - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + _from (datetime): The minimum timestamp for requested security signals.. [optional] # noqa: E501 + query (str): Search query for listing security signals.. [optional] # noqa: E501 + to (datetime): The maximum timestamp for requested security signals.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_page.py b/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_page.py index c00950ddc7..bd25d01479 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_page.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signal_list_request_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalListRequestPage(ModelNormal): @@ -54,7 +56,23 @@ class SecurityMonitoringSignalListRequestPage(ModelNormal): }, } - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalListRequestPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + cursor (str): A list of results using the cursor provided in the previous query.. [optional] # noqa: E501 + limit (int): The maximum number of security signals in the response.. [optional] if omitted the server will use the default value of 10 # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signal_type.py b/src/datadog_api_client/v2/model/security_monitoring_signal_type.py index ab75e74236..91aa107165 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signal_type.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signal_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalType(ModelSimple): @@ -50,7 +52,23 @@ class SecurityMonitoringSignalType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringSignalType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The type of event.. if omitted defaults to "signal", must be one of ["signal", ] # noqa: E501 + + Keyword Args: + value (str): The type of event.. if omitted defaults to "signal", must be one of ["signal", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "signal" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response.py b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response.py index 1e1fe4bb4d..71dec932ca 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -64,7 +66,24 @@ class SecurityMonitoringSignalsListResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalsListResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([SecurityMonitoringSignal]): An array of security signals matching the request.. [optional] # noqa: E501 + links (SecurityMonitoringSignalsListResponseLinks): [optional] # noqa: E501 + meta (SecurityMonitoringSignalsListResponseMeta): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_links.py b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_links.py index 17cabd0e9f..e9436586d8 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_links.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_links.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalsListResponseLinks(ModelNormal): @@ -50,7 +52,23 @@ class SecurityMonitoringSignalsListResponseLinks(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalsListResponseLinks - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + next (str): The link for the next set of results. **Note**: The request can also be made using the POST endpoint.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta.py b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta.py index 9afeedc18d..8dfcc3c3c5 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class SecurityMonitoringSignalsListResponseMeta(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -87,6 +106,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalsListResponseMeta - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + page (SecurityMonitoringSignalsListResponseMetaPage): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +266,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta_page.py b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta_page.py index 62d663c6d1..800086d61c 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta_page.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signals_list_response_meta_page.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalsListResponseMetaPage(ModelNormal): @@ -50,7 +52,23 @@ class SecurityMonitoringSignalsListResponseMetaPage(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -78,6 +96,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """SecurityMonitoringSignalsListResponseMetaPage - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + after (str): The cursor used to get the next results, if any. To make the next request, use the same parameters with the addition of the `page[cursor]`.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -161,3 +256,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/security_monitoring_signals_sort.py b/src/datadog_api_client/v2/model/security_monitoring_signals_sort.py index a8f63a833f..74a3edaa8d 100644 --- a/src/datadog_api_client/v2/model/security_monitoring_signals_sort.py +++ b/src/datadog_api_client/v2/model/security_monitoring_signals_sort.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class SecurityMonitoringSignalsSort(ModelSimple): @@ -51,7 +53,23 @@ class SecurityMonitoringSignalsSort(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -75,6 +93,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -178,3 +198,99 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """SecurityMonitoringSignalsSort - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): The sort parameters used for querying security signals.., must be one of ["timestamp", "-timestamp", ] # noqa: E501 + + Keyword Args: + value (str): The sort parameters used for querying security signals.., must be one of ["timestamp", "-timestamp", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/user.py b/src/datadog_api_client/v2/model/user.py index 0a9977f844..27a7bf82fd 100644 --- a/src/datadog_api_client/v2/model/user.py +++ b/src/datadog_api_client/v2/model/user.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class User(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -95,6 +114,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """User - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UserAttributes): [optional] # noqa: E501 + id (str): ID of the user.. [optional] # noqa: E501 + relationships (UserResponseRelationships): [optional] # noqa: E501 + type (UsersType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +280,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_attributes.py b/src/datadog_api_client/v2/model/user_attributes.py index 5c95cea9c8..2f52a1b473 100644 --- a/src/datadog_api_client/v2/model/user_attributes.py +++ b/src/datadog_api_client/v2/model/user_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class UserAttributes(ModelNormal): @@ -50,7 +52,23 @@ class UserAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -96,6 +114,92 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the user.. [optional] # noqa: E501 + disabled (bool): Whether the user is disabled.. [optional] # noqa: E501 + email (str): Email of the user.. [optional] # noqa: E501 + handle (str): Handle of the user.. [optional] # noqa: E501 + icon (str): URL of the user's icon.. [optional] # noqa: E501 + modified_at (datetime): Time that the user was last modified.. [optional] # noqa: E501 + name (str): Name of the user.. [optional] # noqa: E501 + status (str): Status of the user.. [optional] # noqa: E501 + title (str): Title of the user.. [optional] # noqa: E501 + verified (bool): Whether the user is verified.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -188,3 +292,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_create_attributes.py b/src/datadog_api_client/v2/model/user_create_attributes.py index 6097d215db..02d72c71d6 100644 --- a/src/datadog_api_client/v2/model/user_create_attributes.py +++ b/src/datadog_api_client/v2/model/user_create_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class UserCreateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class UserCreateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, email, *args, **kwargs): # noqa: E501 + """UserCreateAttributes - a model defined in OpenAPI + + Args: + email (str): The email of the user. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the user.. [optional] # noqa: E501 + title (str): The title of the user.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.email = email + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +270,8 @@ def __init__(self, email, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_create_data.py b/src/datadog_api_client/v2/model/user_create_data.py index 425644c121..076df431e7 100644 --- a/src/datadog_api_client/v2/model/user_create_data.py +++ b/src/datadog_api_client/v2/model/user_create_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class UserCreateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,89 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, type, *args, **kwargs): # noqa: E501 + """UserCreateData - a model defined in OpenAPI + + Args: + attributes (UserCreateAttributes): + type (UsersType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + relationships (UserRelationships): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -182,3 +284,8 @@ def __init__(self, attributes, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_create_request.py b/src/datadog_api_client/v2/model/user_create_request.py index 46bfb7bc33..82db575d4a 100644 --- a/src/datadog_api_client/v2/model/user_create_request.py +++ b/src/datadog_api_client/v2/model/user_create_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserCreateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """UserCreateRequest - a model defined in OpenAPI + + Args: + data (UserCreateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitation_data.py b/src/datadog_api_client/v2/model/user_invitation_data.py index 77ac88ce4a..ef4ebe91d1 100644 --- a/src/datadog_api_client/v2/model/user_invitation_data.py +++ b/src/datadog_api_client/v2/model/user_invitation_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UserInvitationData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,88 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, relationships, type, *args, **kwargs): # noqa: E501 + """UserInvitationData - a model defined in OpenAPI + + Args: + relationships (UserInvitationRelationships): + type (UserInvitationsType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.relationships = relationships + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -177,3 +278,8 @@ def __init__(self, relationships, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitation_data_attributes.py b/src/datadog_api_client/v2/model/user_invitation_data_attributes.py index 339d43e2b6..81d9d3f524 100644 --- a/src/datadog_api_client/v2/model/user_invitation_data_attributes.py +++ b/src/datadog_api_client/v2/model/user_invitation_data_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class UserInvitationDataAttributes(ModelNormal): @@ -50,7 +52,23 @@ class UserInvitationDataAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -84,6 +102,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserInvitationDataAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + created_at (datetime): Creation time of the user invitation.. [optional] # noqa: E501 + expires_at (datetime): Time of invitation expiration.. [optional] # noqa: E501 + invite_type (str): Type of invitation.. [optional] # noqa: E501 + uuid (str): UUID of the user invitation.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -170,3 +268,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitation_relationships.py b/src/datadog_api_client/v2/model/user_invitation_relationships.py index a745d8f4f2..7c09858964 100644 --- a/src/datadog_api_client/v2/model/user_invitation_relationships.py +++ b/src/datadog_api_client/v2/model/user_invitation_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserInvitationRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, user, *args, **kwargs): # noqa: E501 + """UserInvitationRelationships - a model defined in OpenAPI + + Args: + user (RelationshipToUser): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.user = user + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, user, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitation_response.py b/src/datadog_api_client/v2/model/user_invitation_response.py index 337bc9df57..f7e008fcb9 100644 --- a/src/datadog_api_client/v2/model/user_invitation_response.py +++ b/src/datadog_api_client/v2/model/user_invitation_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserInvitationResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserInvitationResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (UserInvitationResponseData): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitation_response_data.py b/src/datadog_api_client/v2/model/user_invitation_response_data.py index 8a47c73c6c..b3444b1b80 100644 --- a/src/datadog_api_client/v2/model/user_invitation_response_data.py +++ b/src/datadog_api_client/v2/model/user_invitation_response_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UserInvitationResponseData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserInvitationResponseData - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (UserInvitationDataAttributes): [optional] # noqa: E501 + id (str): ID of the user invitation.. [optional] # noqa: E501 + type (UserInvitationsType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -176,3 +274,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitations_request.py b/src/datadog_api_client/v2/model/user_invitations_request.py index 513efc214e..e9077f90a7 100644 --- a/src/datadog_api_client/v2/model/user_invitations_request.py +++ b/src/datadog_api_client/v2/model/user_invitations_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserInvitationsRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """UserInvitationsRequest - a model defined in OpenAPI + + Args: + data ([UserInvitationData]): List of user invitations. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitations_response.py b/src/datadog_api_client/v2/model/user_invitations_response.py index c0651b149e..1dfb755a19 100644 --- a/src/datadog_api_client/v2/model/user_invitations_response.py +++ b/src/datadog_api_client/v2/model/user_invitations_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserInvitationsResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserInvitationsResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([UserInvitationResponseData]): Array of user invitations.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_invitations_type.py b/src/datadog_api_client/v2/model/user_invitations_type.py index 94809816e6..ebe47b61f6 100644 --- a/src/datadog_api_client/v2/model/user_invitations_type.py +++ b/src/datadog_api_client/v2/model/user_invitations_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class UserInvitationsType(ModelSimple): @@ -50,7 +52,23 @@ class UserInvitationsType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UserInvitationsType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): User invitations type.. if omitted defaults to "user_invitations", must be one of ["user_invitations", ] # noqa: E501 + + Keyword Args: + value (str): User invitations type.. if omitted defaults to "user_invitations", must be one of ["user_invitations", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "user_invitations" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model/user_relationships.py b/src/datadog_api_client/v2/model/user_relationships.py index 3e2519f629..c2ea04fa96 100644 --- a/src/datadog_api_client/v2/model/user_relationships.py +++ b/src/datadog_api_client/v2/model/user_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,83 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + roles (RelationshipToRoles): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -168,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_response.py b/src/datadog_api_client/v2/model/user_response.py index aca99dfdc6..f926fb3aaf 100644 --- a/src/datadog_api_client/v2/model/user_response.py +++ b/src/datadog_api_client/v2/model/user_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UserResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -89,6 +108,84 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (User): [optional] # noqa: E501 + included ([UserResponseIncludedItem]): Array of objects related to the user.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -173,3 +270,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_response_included_item.py b/src/datadog_api_client/v2/model/user_response_included_item.py index 2c7cdb3c6f..c3f9b59823 100644 --- a/src/datadog_api_client/v2/model/user_response_included_item.py +++ b/src/datadog_api_client/v2/model/user_response_included_item.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -105,6 +107,100 @@ def discriminator(): attribute_map = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserResponseIncludedItem - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + attributes (RoleAttributes): [optional] # noqa: E501 + id (str): ID of the role.. [optional] # noqa: E501 + relationships (RoleResponseRelationships): [optional] # noqa: E501 + type (RolesType): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + required_properties = set( [ "_data_store", @@ -191,28 +287,27 @@ def __init__(self, *args, **kwargs): # noqa: E501 "_configuration": _configuration, "_visited_composed_classes": self._visited_composed_classes, } - required_args = {} - model_args = {} - model_args.update(required_args) - model_args.update(kwargs) - composed_info = validate_get_composed_info(constant_args, model_args, self) + composed_info = validate_get_composed_info(constant_args, kwargs, self) self._composed_instances = composed_info[0] self._var_name_to_model_instances = composed_info[1] self._additional_properties_model_instances = composed_info[2] - unused_args = composed_info[3] + discarded_args = composed_info[3] - for var_name, var_value in required_args.items(): - setattr(self, var_name, var_value) for var_name, var_value in kwargs.items(): if ( - var_name in unused_args + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and not self._additional_properties_model_instances + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) @cached_property def _composed_schemas(): diff --git a/src/datadog_api_client/v2/model/user_response_relationships.py b/src/datadog_api_client/v2/model/user_response_relationships.py index 6d3601fbf4..5b351b5440 100644 --- a/src/datadog_api_client/v2/model/user_response_relationships.py +++ b/src/datadog_api_client/v2/model/user_response_relationships.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -62,7 +64,24 @@ class UserResponseRelationships(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -97,6 +116,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserResponseRelationships - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + org (RelationshipToOrganization): [optional] # noqa: E501 + other_orgs (RelationshipToOrganizations): [optional] # noqa: E501 + other_users (RelationshipToUsers): [optional] # noqa: E501 + roles (RelationshipToRoles): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -183,3 +282,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_update_attributes.py b/src/datadog_api_client/v2/model/user_update_attributes.py index d260f92df3..fe54dac39d 100644 --- a/src/datadog_api_client/v2/model/user_update_attributes.py +++ b/src/datadog_api_client/v2/model/user_update_attributes.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class UserUpdateAttributes(ModelNormal): @@ -50,7 +52,23 @@ class UserUpdateAttributes(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -82,6 +100,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UserUpdateAttributes - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + disabled (bool): If the user is enabled or disabled.. [optional] # noqa: E501 + email (str): The email of the user.. [optional] # noqa: E501 + name (str): The name of the user.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -167,3 +264,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_update_data.py b/src/datadog_api_client/v2/model/user_update_data.py index c065696e77..a272b866f7 100644 --- a/src/datadog_api_client/v2/model/user_update_data.py +++ b/src/datadog_api_client/v2/model/user_update_data.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -58,7 +60,24 @@ class UserUpdateData(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -91,6 +110,90 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, attributes, id, type, *args, **kwargs): # noqa: E501 + """UserUpdateData - a model defined in OpenAPI + + Args: + attributes (UserUpdateAttributes): + id (str): ID of the user. + type (UsersType): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.attributes = attributes + self.id = id + self.type = type + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -181,3 +284,8 @@ def __init__(self, attributes, id, type, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/user_update_request.py b/src/datadog_api_client/v2/model/user_update_request.py index 1f858efb30..d352fd5f26 100644 --- a/src/datadog_api_client/v2/model/user_update_request.py +++ b/src/datadog_api_client/v2/model/user_update_request.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -56,7 +58,24 @@ class UserUpdateRequest(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,6 +104,86 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, data, *args, **kwargs): # noqa: E501 + """UserUpdateRequest - a model defined in OpenAPI + + Args: + data (UserUpdateData): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -171,3 +270,8 @@ def __init__(self, data, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/users_response.py b/src/datadog_api_client/v2/model/users_response.py index 48c4df1edf..d6e20f0b6b 100644 --- a/src/datadog_api_client/v2/model/users_response.py +++ b/src/datadog_api_client/v2/model/users_response.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError def lazy_import(): @@ -60,7 +62,24 @@ class UsersResponse(ModelNormal): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,6 +112,85 @@ def discriminator(): _composed_schemas = {} + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """UsersResponse - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([User]): Array of returned users.. [optional] # noqa: E501 + included ([UserResponseIncludedItem]): Array of objects related to the users.. [optional] # noqa: E501 + meta (ResponseMetaAttributes): [optional] # noqa: E501 + """ + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): + # discard variable. + continue + setattr(self, var_name, var_value) + return self + required_properties = set( [ "_data_store", @@ -178,3 +276,8 @@ def __init__(self, *args, **kwargs): # noqa: E501 # discard variable. continue setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/src/datadog_api_client/v2/model/users_type.py b/src/datadog_api_client/v2/model/users_type.py index a1a920e528..f29057f1b8 100644 --- a/src/datadog_api_client/v2/model/users_type.py +++ b/src/datadog_api_client/v2/model/users_type.py @@ -20,6 +20,8 @@ none_type, validate_get_composed_info, ) +from ..model_utils import OpenApiModel +from datadog_api_client.v2.exceptions import ApiAttributeError class UsersType(ModelSimple): @@ -50,7 +52,23 @@ class UsersType(ModelSimple): validations = {} - additional_properties_type = None + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -74,6 +92,8 @@ def discriminator(): attribute_map = {} + read_only_vars = set() + _composed_schemas = None required_properties = set( @@ -173,3 +193,95 @@ def __init__(self, *args, **kwargs): path_to_item=_path_to_item, valid_classes=(self.__class__,), ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """UsersType - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Users resource type.. if omitted defaults to "users", must be one of ["users", ] # noqa: E501 + + Keyword Args: + value (str): Users resource type.. if omitted defaults to "users", must be one of ["users", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if "value" in kwargs: + value = kwargs.pop("value") + elif args: + args = list(args) + value = args.pop(0) + else: + value = "users" + + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/src/datadog_api_client/v2/model_utils.py b/src/datadog_api_client/v2/model_utils.py index 2a6247f0c3..ac439ecb51 100644 --- a/src/datadog_api_client/v2/model_utils.py +++ b/src/datadog_api_client/v2/model_utils.py @@ -24,9 +24,27 @@ file_type = io.IOBase +def convert_js_args_to_python_args(fn): + from functools import wraps + + @wraps(fn) + def wrapped_init(_self, *args, **kwargs): + """ + An attribute named `self` received from the api will conflicts with the reserved `self` + parameter of a class method. During generation, `self` attributes are mapped + to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. + """ + spec_property_naming = kwargs.get("_spec_property_naming", False) + if spec_property_naming: + kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) + return fn(_self, *args, **kwargs) + + return wrapped_init + + class cached_property(object): # this caches the result of the function call for fn with no inputs - # use this as a decorator on fuction methods that you want converted + # use this as a decorator on function methods that you want converted # into cached properties result_key = "_results" @@ -249,6 +267,109 @@ def __new__(cls, *args, **kwargs): new_inst.__init__(*args, **kwargs) return new_inst + @classmethod + @convert_js_args_to_python_args + def _new_from_openapi_data(cls, *args, **kwargs): + # this function uses the discriminator to + # pick a new schema/class to instantiate because a discriminator + # propertyName value was passed in + + if len(args) == 1: + arg = args[0] + if arg is None and is_type_nullable(cls): + # The input data is the 'null' value and the type is nullable. + return None + + if issubclass(cls, ModelComposed) and allows_single_value_input(cls): + model_kwargs = {} + oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + return oneof_instance + + visited_composed_classes = kwargs.get("_visited_composed_classes", ()) + if cls.discriminator is None or cls in visited_composed_classes: + # Use case 1: this openapi schema (cls) does not have a discriminator + # Use case 2: we have already visited this class before and are sure that we + # want to instantiate it this time. We have visited this class deserializing + # a payload with a discriminator. During that process we traveled through + # this class but did not make an instance of it. Now we are making an + # instance of a composed class which contains cls in it, so this time make an instance of cls. + # + # Here's an example of use case 2: If Animal has a discriminator + # petType and we pass in "Dog", and the class Dog + # allOf includes Animal, we move through Animal + # once using the discriminator, and pick Dog. + # Then in the composed schema dog Dog, we will make an instance of the + # Animal class (because Dal has allOf: Animal) but this time we won't travel + # through Animal's discriminator because we passed in + # _visited_composed_classes = (Animal,) + + return cls._from_openapi_data(*args, **kwargs) + + # Get the name and value of the discriminator property. + # The discriminator name is obtained from the discriminator meta-data + # and the discriminator value is obtained from the input data. + discr_propertyname_py = list(cls.discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if discr_propertyname_js in kwargs: + discr_value = kwargs[discr_propertyname_js] + elif discr_propertyname_py in kwargs: + discr_value = kwargs[discr_propertyname_py] + else: + # The input data does not contain the discriminator property. + path_to_item = kwargs.get("_path_to_item", ()) + raise ApiValueError( + "Cannot deserialize input data due to missing discriminator. " + "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) + ) + + # Implementation note: the last argument to get_discriminator_class + # is a list of visited classes. get_discriminator_class may recursively + # call itself and update the list of visited classes, and the initial + # value must be an empty list. Hence not using 'visited_composed_classes' + new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) + if new_cls is None: + path_to_item = kwargs.get("_path_to_item", ()) + disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) + raise ApiValueError( + "Cannot deserialize input data due to invalid discriminator " + "value. The OpenAPI document has no mapping for discriminator " + "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) + ) + + if new_cls in visited_composed_classes: + # if we are making an instance of a composed schema Descendent + # which allOf includes Ancestor, then Ancestor contains + # a discriminator that includes Descendent. + # So if we make an instance of Descendent, we have to make an + # instance of Ancestor to hold the allOf properties. + # This code detects that use case and makes the instance of Ancestor + # For example: + # When making an instance of Dog, _visited_composed_classes = (Dog,) + # then we make an instance of Animal to include in dog._composed_instances + # so when we are here, cls is Animal + # cls.discriminator != None + # cls not in _visited_composed_classes + # new_cls = Dog + # but we know we know that we already have Dog + # because it is in visited_composed_classes + # so make Animal here + return cls._from_openapi_data(*args, **kwargs) + + # Build a list containing all oneOf and anyOf descendants. + oneof_anyof_classes = None + if cls._composed_schemas is not None: + oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_child = new_cls in oneof_anyof_classes + kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) + + if cls._composed_schemas.get("allOf") and oneof_anyof_child: + # Validate that we can make self because when we make the + # new_cls it will not include the allOf validations in self + self_inst = cls._from_openapi_data(*args, **kwargs) + + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) + return new_inst + class ModelSimple(OpenApiModel): """the parent class of models whose type != object in their @@ -396,22 +517,42 @@ def __setitem__(self, name, value): self.__dict__[name] = value return - # set the attribute on the correct instance - model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) - if model_instances: - for model_instance in model_instances: - if model_instance == self: - self.set_attribute(name, value) - else: - setattr(model_instance, name, value) - if name not in self._var_name_to_model_instances: - # we assigned an additional property - self.__dict__["_var_name_to_model_instances"][name] = model_instance - return None - - raise ApiAttributeError( - "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] - ) + """ + Use cases: + 1. additional_properties_type is None (additionalProperties == False in spec) + Check for property presence in self.openapi_types + if not present then throw an error + if present set in self, set attribute + always set on composed schemas + 2. additional_properties_type exists + set attribute on self + always set on composed schemas + """ + if self.additional_properties_type is None: + """ + For an attribute to exist on a composed schema it must: + - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND + - fulfill schema_requirements in each oneOf/anyOf/allOf schemas + + schema_requirements: + For an attribute to exist on a schema it must: + - be present in properties at the schema OR + - have additionalProperties unset (defaults additionalProperties = any type) OR + - have additionalProperties set + """ + if name not in self.openapi_types: + raise ApiAttributeError( + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], + ) + # attribute must be set on self and composed instances + self.set_attribute(name, value) + for model_instance in self._composed_instances: + setattr(model_instance, name, value) + if name not in self._var_name_to_model_instances: + # we assigned an additional property + self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self] + return None __unset_attribute_value__ = object() @@ -421,12 +562,12 @@ def get(self, name, default=None): return self.__dict__[name] # get the attribute from the correct instance - model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name) values = [] - # A composed model stores child (oneof/anyOf/allOf) models under - # self._var_name_to_model_instances. A named property can exist in - # multiple child models. If the property is present in more than one - # child model, the value must be the same across all the child models. + # A composed model stores self and child (oneof/anyOf/allOf) models under + # self._var_name_to_model_instances. + # Any property must exist in self and all model instances + # The value stored in all model instances must be the same if model_instances: for model_instance in model_instances: if name in model_instance._data_store: @@ -1102,17 +1243,14 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, configu ) if issubclass(model_class, ModelSimple): - return model_class(model_data, **kw_args) + return model_class._new_from_openapi_data(model_data, **kw_args) elif isinstance(model_data, list): - if issubclass(model_class, ModelComposed) and allows_single_value_input(model_class): - return model_class(model_data, **kw_args) - else: - return model_class(*model_data, **kw_args) + return model_class._new_from_openapi_data(*model_data, **kw_args) if isinstance(model_data, dict): kw_args.update(model_data) - return model_class(**kw_args) + return model_class._new_from_openapi_data(**kw_args) elif isinstance(model_data, PRIMITIVE_TYPES): - return model_class(model_data, **kw_args) + return model_class._new_from_openapi_data(model_data, **kw_args) def deserialize_file(response_data, configuration, content_disposition=None): @@ -1405,20 +1543,34 @@ def model_to_dict(model_instance, serialize=True): model_instances = [model_instance] if model_instance._composed_schemas: model_instances.extend(model_instance._composed_instances) + seen_json_attribute_names = set() + used_fallback_python_attribute_names = set() + py_to_json_map = {} for model_instance in model_instances: for attr, value in model_instance._data_store.items(): if serialize: # we use get here because additional property key names do not # exist in attribute_map - attr = model_instance.attribute_map.get(attr, attr) + try: + attr = model_instance.attribute_map[attr] + py_to_json_map.update(model_instance.attribute_map) + seen_json_attribute_names.add(attr) + except KeyError: + used_fallback_python_attribute_names.add(attr) if isinstance(value, list): - if not value or isinstance(value[0], PRIMITIVE_TYPES): - # empty list or primitive types + if not value: + # empty list or None result[attr] = value - elif isinstance(value[0], ModelSimple): - result[attr] = [x.value for x in value] else: - result[attr] = [model_to_dict(x, serialize=serialize) if x is not None else None for x in value] + res = [] + for v in value: + if isinstance(v, PRIMITIVE_TYPES) or v is None: + res.append(v) + elif isinstance(v, ModelSimple): + res.append(v.value) + else: + res.append(model_to_dict(v, serialize=serialize)) + result[attr] = res elif isinstance(value, dict): result[attr] = dict( map( @@ -1434,6 +1586,16 @@ def model_to_dict(model_instance, serialize=True): result[attr] = model_to_dict(value, serialize=serialize) else: result[attr] = value + if serialize: + for python_key in used_fallback_python_attribute_names: + json_key = py_to_json_map.get(python_key) + if json_key is None: + continue + if python_key == json_key: + continue + json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names + if json_key_assigned_no_need_for_python_key: + del result[python_key] return result @@ -1472,27 +1634,19 @@ def get_valid_classes_phrase(input_classes): return "is one of [{0}]".format(", ".join(all_class_names)) -def convert_js_args_to_python_args(fn): - from functools import wraps - - @wraps(fn) - def wrapped_init(self, *args, **kwargs): - spec_property_naming = kwargs.get("_spec_property_naming", False) - if spec_property_naming: - kwargs = change_keys_js_to_python(kwargs, self.__class__) - return fn(self, *args, **kwargs) - - return wrapped_init - - def get_allof_instances(self, model_args, constant_args): """ Args: self: the class we are handling model_args (dict): var_name to var_value used to make instances - constant_args (dict): var_name to var_value - used to make instances + constant_args (dict): + metadata arguments: + _check_type + _path_to_item + _spec_property_naming + _configuration + _visited_composed_classes Returns composed_instances (list) @@ -1500,20 +1654,8 @@ def get_allof_instances(self, model_args, constant_args): composed_instances = [] for allof_class in self._composed_schemas["allOf"]: - # no need to handle changing js keys to python because - # for composed schemas, allof parameters are included in the - # composed schema and were changed to python keys in __new__ - # extract a dict of only required keys from fixed_model_args - kwargs = {} - var_names = set(allof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in model_args: - kwargs[var_name] = model_args[var_name] - - # and use it to make the instance - kwargs.update(constant_args) try: - allof_instance = allof_class(**kwargs) + allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) except Exception as ex: raise ApiValueError( @@ -1568,30 +1710,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): single_value_input = allows_single_value_input(oneof_class) - if not single_value_input: - # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_kwargs, oneof_class) - - # Extract a dict with the properties that are declared in the oneOf schema. - # Undeclared properties (e.g. properties that are allowed because of the - # additionalProperties attribute in the OAS document) are not added to - # the dict. - kwargs = {} - var_names = set(oneof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_kwargs) - try: if not single_value_input: - oneof_instance = oneof_class(**kwargs) + oneof_instance = oneof_class(**model_kwargs, **constant_kwargs) else: if issubclass(oneof_class, ModelSimple): oneof_instance = oneof_class(model_arg, **constant_kwargs) @@ -1646,24 +1767,8 @@ def get_anyof_instances(self, model_args, constant_args): # none_type deserialization is handled in the __new__ method continue - # transform js keys to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python(model_args, anyof_class) - - # extract a dict of only required keys from these_model_vars - kwargs = {} - var_names = set(anyof_class.openapi_types.keys()) - for var_name in var_names: - if var_name in fixed_model_args: - kwargs[var_name] = fixed_model_args[var_name] - - # do not try to make a model with no input args - if len(kwargs) == 0: - continue - - # and use it to make the instance - kwargs.update(constant_args) try: - anyof_instance = anyof_class(**kwargs) + anyof_instance = anyof_class(**model_args, **constant_args) anyof_instances.append(anyof_instance) except Exception: pass @@ -1675,46 +1780,34 @@ def get_anyof_instances(self, model_args, constant_args): return anyof_instances -def get_additional_properties_model_instances(composed_instances, self): - additional_properties_model_instances = [] - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - if instance.additional_properties_type is not None: - additional_properties_model_instances.append(instance) - return additional_properties_model_instances - - -def get_var_name_to_model_instances(self, composed_instances): - var_name_to_model_instances = {} - all_instances = [self] - all_instances.extend(composed_instances) - for instance in all_instances: - for var_name in instance.openapi_types: - if var_name not in var_name_to_model_instances: - var_name_to_model_instances[var_name] = [instance] - else: - var_name_to_model_instances[var_name].append(instance) - return var_name_to_model_instances - - -def get_unused_args(self, composed_instances, model_args): - unused_args = dict(model_args) - # arguments apssed to self were already converted to python names +def get_discarded_args(self, composed_instances, model_args): + """ + Gathers the args that were discarded by configuration.discard_unknown_keys + """ + model_arg_keys = model_args.keys() + discarded_args = set() + # arguments passed to self were already converted to python names # before __init__ was called - for var_name_py in self.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] for instance in composed_instances: if instance.__class__ in self._composed_schemas["allOf"]: - for var_name_py in instance.attribute_map: - if var_name_py in unused_args: - del unused_args[var_name_py] + try: + keys = instance.to_dict().keys() + discarded_keys = model_args - keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass else: - for var_name_js in instance.attribute_map.values(): - if var_name_js in unused_args: - del unused_args[var_name_js] - return unused_args + try: + all_keys = set(model_to_dict(instance, serialize=False).keys()) + js_keys = model_to_dict(instance, serialize=True).keys() + all_keys.update(js_keys) + discarded_keys = model_arg_keys - all_keys + discarded_args.update(discarded_keys) + except Exception: + # allOf integer schema will throw exception + pass + return discarded_args def validate_get_composed_info(constant_args, model_args, self): @@ -1758,29 +1851,37 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances.append(oneof_instance) anyof_instances = get_anyof_instances(self, model_args, constant_args) composed_instances.extend(anyof_instances) + """ + set additional_properties_model_instances + additional properties must be evaluated at the schema level + so self's additional properties are most important + If self is a composed schema with: + - no properties defined in self + - additionalProperties: False + Then for object payloads every property is an additional property + and they are not allowed, so only empty dict is allowed + + Properties must be set on all matching schemas + so when a property is assigned toa composed instance, it must be set on all + composed instances regardless of additionalProperties presence + keeping it to prevent breaking changes in v5.0.1 + TODO remove cls._additional_properties_model_instances in 6.0.0 + """ + additional_properties_model_instances = [] + if self.additional_properties_type is not None: + additional_properties_model_instances = [self] - # map variable names to composed_instances - var_name_to_model_instances = get_var_name_to_model_instances(self, composed_instances) - - # set additional_properties_model_instances - additional_properties_model_instances = get_additional_properties_model_instances(composed_instances, self) - - # set any remaining values - unused_args = get_unused_args(self, composed_instances, model_args) - if ( - len(unused_args) > 0 - and len(additional_properties_model_instances) == 0 - and (self._configuration is None or not self._configuration.discard_unknown_keys) - ): - raise ApiValueError( - "Invalid input arguments input when making an instance of " - "class %s. Not all inputs were used. The unused input data " - "is %s" % (self.__class__.__name__, unused_args) - ) + """ + no need to set properties on self in here, they will be set in __init__ + By here all composed schema oneOf/anyOf/allOf instances have their properties set using + model_args + """ + discarded_args = get_discarded_args(self, composed_instances, model_args) - # no need to add additional_properties to var_name_to_model_instances here - # because additional_properties_model_instances will direct us to that - # instance when we use getattr or setattr - # and we update var_name_to_model_instances in setattr + # map variable names to composed_instances + var_name_to_model_instances = {} + for prop_name in model_args: + if prop_name not in discarded_args: + var_name_to_model_instances[prop_name] = [self] + composed_instances - return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, unused_args] + return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, discarded_args] diff --git a/src/datadog_api_client/v2/rest.py b/src/datadog_api_client/v2/rest.py index b390a351eb..1646853b2e 100644 --- a/src/datadog_api_client/v2/rest.py +++ b/src/datadog_api_client/v2/rest.py @@ -140,15 +140,15 @@ def request( elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) - if "Content-Type" not in headers: - headers["Content-Type"] = "application/json" - try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests + if (method != "DELETE") and ("Content-Type" not in headers): + headers["Content-Type"] = "application/json" if query_params: url += "?" + urlencode(query_params) - if re.search("json", headers["Content-Type"], re.IGNORECASE): + if ("Content-Type" not in headers) or (re.search("json", headers["Content-Type"], re.IGNORECASE)): request_body = None if body is not None: request_body = json.dumps(body) diff --git a/tests/v1/features/synthetics.feature b/tests/v1/features/synthetics.feature index 8f0482cead..e7b33f09ca 100644 --- a/tests/v1/features/synthetics.feature +++ b/tests/v1/features/synthetics.feature @@ -15,7 +15,7 @@ Feature: Synthetics And a valid "appKeyAuth" key in the system And an instance of "Synthetics" API - @replay-only @skip-python @skip-typescript @skip-java @skip-ruby + @replay-only @skip-java @skip-python @skip-ruby @skip-typescript Scenario: Client is resilient to enum and oneOf deserialization errors Given new "ListTests" request When the request is sent