From 8246eba6245c6ffbb237b7a304407fb3bad69a20 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:49:13 +0000 Subject: [PATCH] Add app builder API spec (#2828) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 1691 +++++++++++++++++ api/datadog/configuration.go | 8 + api/datadogV2/api_app_deployment.go | 204 ++ api/datadogV2/api_apps.go | 684 +++++++ api/datadogV2/doc.go | 8 + api/datadogV2/model_app_builder_error.go | 102 + .../model_app_builder_error_errors_items.go | 146 ++ ...l_app_builder_error_errors_items_source.go | 137 ++ api/datadogV2/model_app_builder_event.go | 151 ++ api/datadogV2/model_app_builder_event_name.go | 82 + api/datadogV2/model_app_builder_event_type.go | 78 + api/datadogV2/model_app_meta.go | 417 ++++ api/datadogV2/model_apps_sort_field.go | 78 + api/datadogV2/model_component.go | 259 +++ api/datadogV2/model_component_grid.go | 248 +++ .../model_component_grid_properties.go | 176 ++ ...el_component_grid_properties_is_visible.go | 105 + api/datadogV2/model_component_grid_type.go | 64 + api/datadogV2/model_component_properties.go | 137 ++ .../model_component_properties_is_visible.go | 105 + api/datadogV2/model_component_type.go | 102 + api/datadogV2/model_create_app_request.go | 111 ++ .../model_create_app_request_data.go | 151 ++ ...odel_create_app_request_data_attributes.go | 356 ++++ .../model_create_app_request_data_type.go | 64 + api/datadogV2/model_create_app_response.go | 111 ++ .../model_create_app_response_data.go | 145 ++ .../model_create_app_response_data_type.go | 64 + api/datadogV2/model_custom_connection.go | 189 ++ .../model_custom_connection_attributes.go | 146 ++ ...om_connection_attributes_on_prem_runner.go | 137 ++ api/datadogV2/model_custom_connection_type.go | 64 + api/datadogV2/model_delete_app_response.go | 111 ++ .../model_delete_app_response_data.go | 145 ++ .../model_delete_app_response_data_type.go | 64 + api/datadogV2/model_delete_apps_request.go | 102 + .../model_delete_apps_request_data_items.go | 145 ++ ...del_delete_apps_request_data_items_type.go | 64 + api/datadogV2/model_delete_apps_response.go | 102 + .../model_delete_apps_response_data_items.go | 145 ++ ...el_delete_apps_response_data_items_type.go | 64 + api/datadogV2/model_deploy_app_response.go | 111 ++ .../model_deploy_app_response_data.go | 227 +++ ...del_deploy_app_response_data_attributes.go | 102 + .../model_deploy_app_response_data_type.go | 64 + api/datadogV2/model_deployment_included.go | 227 +++ .../model_deployment_included_attributes.go | 102 + .../model_deployment_included_meta.go | 207 ++ .../model_deployment_included_type.go | 64 + api/datadogV2/model_deployment_meta.go | 207 ++ .../model_deployment_relationship.go | 149 ++ .../model_deployment_relationship_data.go | 151 ++ ...model_deployment_relationship_data_type.go | 64 + .../model_deployment_relationship_meta.go | 207 ++ api/datadogV2/model_disable_app_response.go | 111 ++ .../model_disable_app_response_data.go | 227 +++ ...el_disable_app_response_data_attributes.go | 102 + .../model_disable_app_response_data_type.go | 64 + api/datadogV2/model_get_app_response.go | 222 +++ api/datadogV2/model_get_app_response_data.go | 180 ++ .../model_get_app_response_data_attributes.go | 391 ++++ .../model_get_app_response_data_type.go | 64 + .../model_get_app_response_relationship.go | 146 ++ api/datadogV2/model_input_schema.go | 111 ++ api/datadogV2/model_input_schema_data.go | 189 ++ .../model_input_schema_data_attributes.go | 102 + ...schema_data_attributes_parameters_items.go | 111 ++ ...a_data_attributes_parameters_items_data.go | 111 ++ ...ibutes_parameters_items_data_attributes.go | 277 +++ api/datadogV2/model_input_schema_data_type.go | 64 + api/datadogV2/model_list_apps_response.go | 181 ++ .../model_list_apps_response_data_items.go | 256 +++ ...ist_apps_response_data_items_attributes.go | 242 +++ ..._apps_response_data_items_relationships.go | 111 ++ ...odel_list_apps_response_data_items_type.go | 64 + .../model_list_apps_response_meta.go | 111 ++ .../model_list_apps_response_meta_page.go | 137 ++ api/datadogV2/model_query.go | 245 +++ api/datadogV2/model_query_type.go | 68 + api/datadogV2/model_script.go | 111 ++ api/datadogV2/model_script_data.go | 189 ++ api/datadogV2/model_script_data_attributes.go | 172 ++ api/datadogV2/model_script_data_type.go | 64 + api/datadogV2/model_update_app_request.go | 111 ++ .../model_update_app_request_data.go | 186 ++ ...odel_update_app_request_data_attributes.go | 356 ++++ .../model_update_app_request_data_type.go | 64 + api/datadogV2/model_update_app_response.go | 222 +++ .../model_update_app_response_data.go | 180 ++ ...del_update_app_response_data_attributes.go | 391 ++++ .../model_update_app_response_data_type.go | 64 + .../model_update_app_response_relationship.go | 146 ++ examples/v2/app-deployment/DeployApp.go | 33 + examples/v2/app-deployment/DisableApp.go | 33 + examples/v2/apps/CreateApp.go | 72 + examples/v2/apps/DeleteApp.go | 33 + examples/v2/apps/DeleteApps.go | 41 + examples/v2/apps/GetApp.go | 33 + examples/v2/apps/ListApps.go | 30 + examples/v2/apps/UpdateApp.go | 43 + tests/scenarios/api_mappings.go | 2 + ...oy_App_returns_Bad_Request_response.freeze | 1 + ...ploy_App_returns_Bad_Request_response.yaml | 19 + ...Deploy_App_returns_Created_response.freeze | 1 + ...o_Deploy_App_returns_Created_response.yaml | 56 + ...ploy_App_returns_Not_Found_response.freeze | 1 + ...Deploy_App_returns_Not_Found_response.yaml | 19 + ...le_App_returns_Bad_Request_response.freeze | 1 + ...able_App_returns_Bad_Request_response.yaml | 19 + ...able_App_returns_Not_Found_response.freeze | 1 + ...isable_App_returns_Not_Found_response.yaml | 19 + ...rio_Disable_App_returns_OK_response.freeze | 1 + ...nario_Disable_App_returns_OK_response.yaml | 56 + ...te_App_returns_App_Created_response.freeze | 1 + ...eate_App_returns_App_Created_response.yaml | 39 + ...te_App_returns_Bad_Request_response.freeze | 1 + ...eate_App_returns_Bad_Request_response.yaml | 22 + ...te_App_returns_Bad_Request_response.freeze | 1 + ...lete_App_returns_Bad_Request_response.yaml | 19 + ...lete_App_returns_Not_Found_response.freeze | 1 + ...Delete_App_returns_Not_Found_response.yaml | 19 + ...ario_Delete_App_returns_OK_response.freeze | 1 + ...enario_Delete_App_returns_OK_response.yaml | 56 + ...e_Apps_returns_Bad_Request_response.freeze | 1 + ...ple_Apps_returns_Bad_Request_response.yaml | 23 + ...ple_Apps_returns_Not_Found_response.freeze | 1 + ...tiple_Apps_returns_Not_Found_response.yaml | 22 + ...e_Multiple_Apps_returns_OK_response.freeze | 1 + ...ete_Multiple_Apps_returns_OK_response.yaml | 59 + ...et_App_returns_Bad_Request_response.freeze | 1 + ..._Get_App_returns_Bad_Request_response.yaml | 19 + ..._Get_App_returns_Not_Found_response.freeze | 1 + ...io_Get_App_returns_Not_Found_response.yaml | 19 + ...cenario_Get_App_returns_OK_response.freeze | 1 + .../Scenario_Get_App_returns_OK_response.yaml | 59 + ...nario_List_Apps_returns_OK_response.freeze | 1 + ...cenario_List_Apps_returns_OK_response.yaml | 20 + ...te_App_returns_Bad_Request_response.freeze | 1 + ...date_App_returns_Bad_Request_response.yaml | 59 + ...ario_Update_App_returns_OK_response.freeze | 1 + ...enario_Update_App_returns_OK_response.yaml | 62 + .../features/v2/app_deployment.feature | 58 + tests/scenarios/features/v2/apps.feature | 155 ++ tests/scenarios/features/v2/given.json | 12 + tests/scenarios/features/v2/undo.json | 55 + 146 files changed, 16796 insertions(+), 4 deletions(-) create mode 100644 api/datadogV2/api_app_deployment.go create mode 100644 api/datadogV2/api_apps.go create mode 100644 api/datadogV2/model_app_builder_error.go create mode 100644 api/datadogV2/model_app_builder_error_errors_items.go create mode 100644 api/datadogV2/model_app_builder_error_errors_items_source.go create mode 100644 api/datadogV2/model_app_builder_event.go create mode 100644 api/datadogV2/model_app_builder_event_name.go create mode 100644 api/datadogV2/model_app_builder_event_type.go create mode 100644 api/datadogV2/model_app_meta.go create mode 100644 api/datadogV2/model_apps_sort_field.go create mode 100644 api/datadogV2/model_component.go create mode 100644 api/datadogV2/model_component_grid.go create mode 100644 api/datadogV2/model_component_grid_properties.go create mode 100644 api/datadogV2/model_component_grid_properties_is_visible.go create mode 100644 api/datadogV2/model_component_grid_type.go create mode 100644 api/datadogV2/model_component_properties.go create mode 100644 api/datadogV2/model_component_properties_is_visible.go create mode 100644 api/datadogV2/model_component_type.go create mode 100644 api/datadogV2/model_create_app_request.go create mode 100644 api/datadogV2/model_create_app_request_data.go create mode 100644 api/datadogV2/model_create_app_request_data_attributes.go create mode 100644 api/datadogV2/model_create_app_request_data_type.go create mode 100644 api/datadogV2/model_create_app_response.go create mode 100644 api/datadogV2/model_create_app_response_data.go create mode 100644 api/datadogV2/model_create_app_response_data_type.go create mode 100644 api/datadogV2/model_custom_connection.go create mode 100644 api/datadogV2/model_custom_connection_attributes.go create mode 100644 api/datadogV2/model_custom_connection_attributes_on_prem_runner.go create mode 100644 api/datadogV2/model_custom_connection_type.go create mode 100644 api/datadogV2/model_delete_app_response.go create mode 100644 api/datadogV2/model_delete_app_response_data.go create mode 100644 api/datadogV2/model_delete_app_response_data_type.go create mode 100644 api/datadogV2/model_delete_apps_request.go create mode 100644 api/datadogV2/model_delete_apps_request_data_items.go create mode 100644 api/datadogV2/model_delete_apps_request_data_items_type.go create mode 100644 api/datadogV2/model_delete_apps_response.go create mode 100644 api/datadogV2/model_delete_apps_response_data_items.go create mode 100644 api/datadogV2/model_delete_apps_response_data_items_type.go create mode 100644 api/datadogV2/model_deploy_app_response.go create mode 100644 api/datadogV2/model_deploy_app_response_data.go create mode 100644 api/datadogV2/model_deploy_app_response_data_attributes.go create mode 100644 api/datadogV2/model_deploy_app_response_data_type.go create mode 100644 api/datadogV2/model_deployment_included.go create mode 100644 api/datadogV2/model_deployment_included_attributes.go create mode 100644 api/datadogV2/model_deployment_included_meta.go create mode 100644 api/datadogV2/model_deployment_included_type.go create mode 100644 api/datadogV2/model_deployment_meta.go create mode 100644 api/datadogV2/model_deployment_relationship.go create mode 100644 api/datadogV2/model_deployment_relationship_data.go create mode 100644 api/datadogV2/model_deployment_relationship_data_type.go create mode 100644 api/datadogV2/model_deployment_relationship_meta.go create mode 100644 api/datadogV2/model_disable_app_response.go create mode 100644 api/datadogV2/model_disable_app_response_data.go create mode 100644 api/datadogV2/model_disable_app_response_data_attributes.go create mode 100644 api/datadogV2/model_disable_app_response_data_type.go create mode 100644 api/datadogV2/model_get_app_response.go create mode 100644 api/datadogV2/model_get_app_response_data.go create mode 100644 api/datadogV2/model_get_app_response_data_attributes.go create mode 100644 api/datadogV2/model_get_app_response_data_type.go create mode 100644 api/datadogV2/model_get_app_response_relationship.go create mode 100644 api/datadogV2/model_input_schema.go create mode 100644 api/datadogV2/model_input_schema_data.go create mode 100644 api/datadogV2/model_input_schema_data_attributes.go create mode 100644 api/datadogV2/model_input_schema_data_attributes_parameters_items.go create mode 100644 api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go create mode 100644 api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go create mode 100644 api/datadogV2/model_input_schema_data_type.go create mode 100644 api/datadogV2/model_list_apps_response.go create mode 100644 api/datadogV2/model_list_apps_response_data_items.go create mode 100644 api/datadogV2/model_list_apps_response_data_items_attributes.go create mode 100644 api/datadogV2/model_list_apps_response_data_items_relationships.go create mode 100644 api/datadogV2/model_list_apps_response_data_items_type.go create mode 100644 api/datadogV2/model_list_apps_response_meta.go create mode 100644 api/datadogV2/model_list_apps_response_meta_page.go create mode 100644 api/datadogV2/model_query.go create mode 100644 api/datadogV2/model_query_type.go create mode 100644 api/datadogV2/model_script.go create mode 100644 api/datadogV2/model_script_data.go create mode 100644 api/datadogV2/model_script_data_attributes.go create mode 100644 api/datadogV2/model_script_data_type.go create mode 100644 api/datadogV2/model_update_app_request.go create mode 100644 api/datadogV2/model_update_app_request_data.go create mode 100644 api/datadogV2/model_update_app_request_data_attributes.go create mode 100644 api/datadogV2/model_update_app_request_data_type.go create mode 100644 api/datadogV2/model_update_app_response.go create mode 100644 api/datadogV2/model_update_app_response_data.go create mode 100644 api/datadogV2/model_update_app_response_data_attributes.go create mode 100644 api/datadogV2/model_update_app_response_data_type.go create mode 100644 api/datadogV2/model_update_app_response_relationship.go create mode 100644 examples/v2/app-deployment/DeployApp.go create mode 100644 examples/v2/app-deployment/DisableApp.go create mode 100644 examples/v2/apps/CreateApp.go create mode 100644 examples/v2/apps/DeleteApp.go create mode 100644 examples/v2/apps/DeleteApps.go create mode 100644 examples/v2/apps/GetApp.go create mode 100644 examples/v2/apps/ListApps.go create mode 100644 examples/v2/apps/UpdateApp.go create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze create mode 100644 tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml create mode 100644 tests/scenarios/features/v2/app_deployment.feature create mode 100644 tests/scenarios/features/v2/apps.feature diff --git a/.apigentools-info b/.apigentools-info index 1145726145d..d599b5420be 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-16 19:15:38.273335", - "spec_repo_commit": "162aece5" + "regenerated": "2024-12-17 15:50:58.956034", + "spec_repo_commit": "b82d3677" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-16 19:15:38.287814", - "spec_repo_commit": "162aece5" + "regenerated": "2024-12-17 15:50:58.973652", + "spec_repo_commit": "b82d3677" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5d4184e4f2e..c19d456f413 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1615,6 +1615,126 @@ components: type: string x-enum-varnames: - apm_retention_filter + AppBuilderError: + description: The definition of `AppBuilderError` object. + properties: + errors: + description: The `AppBuilderError` `errors`. + items: + $ref: '#/components/schemas/AppBuilderErrorErrorsItems' + type: array + type: object + AppBuilderErrorErrorsItems: + description: The definition of `AppBuilderErrorErrorsItems` object. + properties: + detail: + description: The `items` `detail`. + type: string + source: + $ref: '#/components/schemas/AppBuilderErrorErrorsItemsSource' + type: object + AppBuilderErrorErrorsItemsSource: + description: The definition of `AppBuilderErrorErrorsItemsSource` object. + properties: + parameter: + description: The `source` `parameter`. + type: string + pointer: + description: The `source` `pointer`. + type: string + type: object + AppBuilderEvent: + additionalProperties: {} + description: The definition of `AppBuilderEvent` object. + properties: + name: + $ref: '#/components/schemas/AppBuilderEventName' + type: + $ref: '#/components/schemas/AppBuilderEventType' + type: object + AppBuilderEventName: + description: The triggering action for the event. + enum: + - pageChange + - tableRowClick + - _tableRowButtonClick + - change + - submit + - click + - toggleOpen + - close + - open + - executionFinished + type: string + x-enum-varnames: + - PAGECHANGE + - TABLEROWCLICK + - TABLEROWBUTTONCLICK + - CHANGE + - SUBMIT + - CLICK + - TOGGLEOPEN + - CLOSE + - OPEN + - EXECUTIONFINISHED + AppBuilderEventType: + description: The response to the event. + enum: + - custom + - setComponentState + - triggerQuery + - openModal + - closeModal + - openUrl + - downloadFile + - setStateVariableValue + type: string + x-enum-varnames: + - CUSTOM + - SETCOMPONENTSTATE + - TRIGGERQUERY + - OPENMODAL + - CLOSEMODAL + - OPENURL + - DOWNLOADFILE + - SETSTATEVARIABLEVALUE + AppMeta: + description: The definition of `AppMeta` object. + properties: + created_at: + description: The `AppMeta` `created_at`. + type: string + deleted_at: + description: The `AppMeta` `deleted_at`. + type: string + org_id: + description: The `AppMeta` `org_id`. + format: int64 + type: integer + run_as_user: + description: The `AppMeta` `run_as_user`. + type: string + updated_at: + description: The `AppMeta` `updated_at`. + type: string + updated_since_deployment: + description: The `AppMeta` `updated_since_deployment`. + type: boolean + user_id: + description: The `AppMeta` `user_id`. + format: int64 + type: integer + user_name: + description: The `AppMeta` `user_name`. + type: string + user_uuid: + description: The `AppMeta` `user_uuid`. + type: string + version: + description: The `AppMeta` `version`. + format: int64 + type: integer + type: object ApplicationKeyCreateAttributes: description: Attributes used to create an application Key. properties: @@ -1766,6 +1886,27 @@ components: type: string x-enum-varnames: - APPLICATION_KEYS + AppsSortField: + description: The field and direction to sort apps by + enum: + - name + - created_at + - updated_at + - user_name + - -name + - -created_at + - -updated_at + - -user_name + type: string + x-enum-varnames: + - NAME + - CREATED_AT + - UPDATED_AT + - USER_NAME + - NAME_DESC + - CREATED_AT_DESC + - UPDATED_AT_DESC + - USER_NAME_DESC AuditLogsEvent: description: Object description of an Audit Logs event after it is processed and stored by Datadog. @@ -5528,6 +5669,150 @@ components: $ref: '#/components/schemas/CloudflareAccountResponseData' type: array type: object + Component: + description: The definition of `Component` object. + properties: + events: + description: The `Component` `events`. + items: + $ref: '#/components/schemas/AppBuilderEvent' + type: array + id: + description: The `Component` `id`. + nullable: true + type: string + name: + description: The `Component` `name`. + example: '' + type: string + properties: + $ref: '#/components/schemas/ComponentProperties' + type: + $ref: '#/components/schemas/ComponentType' + required: + - name + - type + - properties + type: object + ComponentGrid: + description: The definition of `ComponentGrid` object. + properties: + events: + description: The `ComponentGrid` `events`. + items: + $ref: '#/components/schemas/AppBuilderEvent' + type: array + id: + description: The `ComponentGrid` `id`. + type: string + name: + description: The `ComponentGrid` `name`. + example: '' + type: string + properties: + $ref: '#/components/schemas/ComponentGridProperties' + type: + $ref: '#/components/schemas/ComponentGridType' + required: + - name + - type + - properties + type: object + ComponentGridProperties: + description: The definition of `ComponentGridProperties` object. + properties: + backgroundColor: + default: default + description: The `ComponentGridProperties` `backgroundColor`. + type: string + children: + description: The `ComponentGridProperties` `children`. + items: + $ref: '#/components/schemas/Component' + type: array + isVisible: + $ref: '#/components/schemas/ComponentGridPropertiesIsVisible' + type: object + ComponentGridPropertiesIsVisible: + description: The definition of `ComponentGridPropertiesIsVisible` object. + oneOf: + - type: string + - default: true + type: boolean + ComponentGridType: + description: The definition of `ComponentGridType` object. + enum: + - grid + example: grid + type: string + x-enum-varnames: + - GRID + ComponentProperties: + additionalProperties: {} + description: The definition of `ComponentProperties` object. + properties: + children: + description: The `ComponentProperties` `children`. + items: + $ref: '#/components/schemas/Component' + type: array + isVisible: + $ref: '#/components/schemas/ComponentPropertiesIsVisible' + type: object + ComponentPropertiesIsVisible: + description: The definition of `ComponentPropertiesIsVisible` object. + oneOf: + - type: boolean + - description: If a string, it should be a valid JavaScript expression that + evaluates to a boolean. + example: ${true} + type: string + ComponentType: + description: The definition of `ComponentType` object. + enum: + - table + - textInput + - textArea + - button + - text + - select + - modal + - schemaForm + - checkbox + - tabs + - vegaChart + - radioButtons + - numberInput + - fileInput + - jsonInput + - gridCell + - dateRangePicker + - search + - container + - calloutValue + example: table + type: string + x-enum-varnames: + - TABLE + - TEXTINPUT + - TEXTAREA + - BUTTON + - TEXT + - SELECT + - MODAL + - SCHEMAFORM + - CHECKBOX + - TABS + - VEGACHART + - RADIOBUTTONS + - NUMBERINPUT + - FILEINPUT + - JSONINPUT + - GRIDCELL + - DATERANGEPICKER + - SEARCH + - CONTAINER + - CALLOUTVALUE ConfluentAccountCreateRequest: description: Payload schema when adding a Confluent account. properties: @@ -6529,6 +6814,132 @@ components: type: string x-enum-varnames: - COST_BY_ORG + CreateAppRequest: + description: The definition of `CreateAppRequest` object. + example: + data: + attributes: + components: + - events: [] + name: grid0 + properties: + children: + - events: [] + name: gridCell0 + properties: + children: + - events: [] + name: calloutValue0 + properties: + isDisabled: false + isLoading: false + isVisible: true + label: CPU Usage + size: sm + style: vivid_yellow + unit: kB + value: '42' + type: calloutValue + isVisible: 'true' + layout: + default: + height: 8 + width: 2 + x: 0 + y: 0 + type: gridCell + type: grid + description: This is a simple example app + embeddedQueries: [] + name: Example App + rootInstanceName: grid0 + type: appDefinitions + properties: + data: + $ref: '#/components/schemas/CreateAppRequestData' + type: object + CreateAppRequestData: + description: The definition of `CreateAppRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateAppRequestDataAttributes' + type: + $ref: '#/components/schemas/CreateAppRequestDataType' + required: + - type + type: object + CreateAppRequestDataAttributes: + description: The definition of `CreateAppRequestDataAttributes` object. + properties: + components: + description: The `attributes` `components`. + items: + $ref: '#/components/schemas/ComponentGrid' + type: array + description: + description: The `attributes` `description`. + type: string + embeddedQueries: + description: The `attributes` `embeddedQueries`. + items: + $ref: '#/components/schemas/Query' + type: array + inputSchema: + $ref: '#/components/schemas/InputSchema' + name: + description: The `attributes` `name`. + type: string + rootInstanceName: + description: The `attributes` `rootInstanceName`. + type: string + scripts: + description: The `attributes` `scripts`. + items: + $ref: '#/components/schemas/Script' + type: array + tags: + description: The `attributes` `tags`. + items: + type: string + type: array + type: object + CreateAppRequestDataType: + default: appDefinitions + description: The definition of `CreateAppRequestDataType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + CreateAppResponse: + description: The definition of `CreateAppResponse` object. + properties: + data: + $ref: '#/components/schemas/CreateAppResponseData' + type: object + CreateAppResponseData: + description: The definition of `CreateAppResponseData` object. + properties: + id: + description: The `data` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/CreateAppResponseDataType' + required: + - id + - type + type: object + CreateAppResponseDataType: + default: appDefinitions + description: The definition of `CreateAppResponseDataType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS CreateDataDeletionRequestBody: description: Object needed to create a data deletion request. properties: @@ -6748,6 +7159,44 @@ components: meta: $ref: '#/components/schemas/CSMAgentsMetadata' type: object + CustomConnection: + description: The definition of `CustomConnection` object. + properties: + attributes: + $ref: '#/components/schemas/CustomConnectionAttributes' + id: + description: The `CustomConnection` `id`. + type: string + type: + $ref: '#/components/schemas/CustomConnectionType' + type: object + CustomConnectionAttributes: + description: The definition of `CustomConnectionAttributes` object. + properties: + name: + description: The `attributes` `name`. + type: string + onPremRunner: + $ref: '#/components/schemas/CustomConnectionAttributesOnPremRunner' + type: object + CustomConnectionAttributesOnPremRunner: + description: The definition of `CustomConnectionAttributesOnPremRunner` object. + properties: + id: + description: The `onPremRunner` `id`. + type: string + url: + description: The `onPremRunner` `url`. + type: string + type: object + CustomConnectionType: + default: custom_connections + description: The definition of `CustomConnectionType` object. + enum: + - custom_connections + type: string + x-enum-varnames: + - CUSTOM_CONNECTIONS CustomCostGetResponseMeta: description: Meta for the response from the Get Custom Costs endpoints. properties: @@ -8129,6 +8578,270 @@ components: type: number type: array type: object + DeleteAppResponse: + description: The definition of `DeleteAppResponse` object. + properties: + data: + $ref: '#/components/schemas/DeleteAppResponseData' + type: object + DeleteAppResponseData: + description: The definition of `DeleteAppResponseData` object. + properties: + id: + description: The `data` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/DeleteAppResponseDataType' + required: + - id + - type + type: object + DeleteAppResponseDataType: + default: appDefinitions + description: The definition of `DeleteAppResponseDataType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + DeleteAppsRequest: + description: The definition of `DeleteAppsRequest` object. + example: + data: + - id: 29494ddd-ac13-46a7-8558-b05b050ee755 + type: appDefinitions + - id: 71c0d358-eac5-41e3-892d-a7467571b9b0 + type: appDefinitions + - id: 98e7e44d-1562-474a-90f7-3a94e739c006 + type: appDefinitions + properties: + data: + description: The `DeleteAppsRequest` `data`. + items: + $ref: '#/components/schemas/DeleteAppsRequestDataItems' + type: array + type: object + DeleteAppsRequestDataItems: + description: The definition of `DeleteAppsRequestDataItems` object. + properties: + id: + description: The `items` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/DeleteAppsRequestDataItemsType' + required: + - id + - type + type: object + DeleteAppsRequestDataItemsType: + default: appDefinitions + description: The definition of `DeleteAppsRequestDataItemsType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + DeleteAppsResponse: + description: The definition of `DeleteAppsResponse` object. + properties: + data: + description: The `DeleteAppsResponse` `data`. + items: + $ref: '#/components/schemas/DeleteAppsResponseDataItems' + type: array + type: object + DeleteAppsResponseDataItems: + description: The definition of `DeleteAppsResponseDataItems` object. + properties: + id: + description: The `items` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/DeleteAppsResponseDataItemsType' + required: + - id + - type + type: object + DeleteAppsResponseDataItemsType: + default: appDefinitions + description: The definition of `DeleteAppsResponseDataItemsType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + DeployAppResponse: + description: The definition of `DeployAppResponse` object. + properties: + data: + $ref: '#/components/schemas/DeployAppResponseData' + type: object + DeployAppResponseData: + description: The definition of `DeployAppResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/DeployAppResponseDataAttributes' + id: + description: The `data` `id`. + type: string + meta: + $ref: '#/components/schemas/DeploymentMeta' + type: + $ref: '#/components/schemas/DeployAppResponseDataType' + type: object + DeployAppResponseDataAttributes: + description: The definition of `DeployAppResponseDataAttributes` object. + properties: + app_version_id: + description: The `attributes` `app_version_id`. + type: string + type: object + DeployAppResponseDataType: + default: deployment + description: The definition of `DeployAppResponseDataType` object. + enum: + - deployment + type: string + x-enum-varnames: + - DEPLOYMENT + Deployment: + description: The definition of `Deployment` object. + properties: + attributes: + $ref: '#/components/schemas/DeploymentAttributes' + id: + description: The `Deployment` `id`. + type: string + meta: + $ref: '#/components/schemas/DeploymentMeta' + type: + $ref: '#/components/schemas/DeploymentType' + type: object + DeploymentAttributes: + description: The definition of `DeploymentAttributes` object. + properties: + app_version_id: + description: The `attributes` `app_version_id`. + type: string + type: object + DeploymentIncluded: + description: The definition of `DeploymentIncluded` object. + properties: + attributes: + $ref: '#/components/schemas/DeploymentIncludedAttributes' + id: + description: The `DeploymentIncluded` `id`. + type: string + meta: + $ref: '#/components/schemas/DeploymentIncludedMeta' + type: + $ref: '#/components/schemas/DeploymentIncludedType' + type: object + DeploymentIncludedAttributes: + description: The definition of `DeploymentIncludedAttributes` object. + properties: + app_version_id: + description: The `attributes` `app_version_id`. + type: string + type: object + DeploymentIncludedMeta: + description: The definition of `DeploymentIncludedMeta` object. + properties: + created_at: + description: The `meta` `created_at`. + type: string + user_id: + description: The `meta` `user_id`. + format: int64 + type: integer + user_name: + description: The `meta` `user_name`. + type: string + user_uuid: + description: The `meta` `user_uuid`. + type: string + type: object + DeploymentIncludedType: + default: deployment + description: The definition of `DeploymentIncludedType` object. + enum: + - deployment + type: string + x-enum-varnames: + - DEPLOYMENT + DeploymentMeta: + description: The definition of `DeploymentMeta` object. + properties: + created_at: + description: The `DeploymentMeta` `created_at`. + type: string + user_id: + description: The `DeploymentMeta` `user_id`. + format: int64 + type: integer + user_name: + description: The `DeploymentMeta` `user_name`. + type: string + user_uuid: + description: The `DeploymentMeta` `user_uuid`. + type: string + type: object + DeploymentRelationship: + description: The definition of `DeploymentRelationship` object. + properties: + data: + $ref: '#/components/schemas/DeploymentRelationshipData' + meta: + $ref: '#/components/schemas/DeploymentRelationshipMeta' + type: object + DeploymentRelationshipData: + description: The definition of `DeploymentRelationshipData` object. + properties: + id: + description: The `data` `id`. + type: string + type: + $ref: '#/components/schemas/DeploymentRelationshipDataType' + type: object + DeploymentRelationshipDataType: + default: deployment + description: The definition of `DeploymentRelationshipDataType` object. + enum: + - deployment + type: string + x-enum-varnames: + - DEPLOYMENT + DeploymentRelationshipMeta: + description: The definition of `DeploymentRelationshipMeta` object. + properties: + created_at: + description: The `meta` `created_at`. + type: string + user_id: + description: The `meta` `user_id`. + format: int64 + type: integer + user_name: + description: The `meta` `user_name`. + type: string + user_uuid: + description: The `meta` `user_uuid`. + type: string + type: object + DeploymentType: + default: deployment + description: The definition of `DeploymentType` object. + enum: + - deployment + type: string + x-enum-varnames: + - DEPLOYMENT DetailedFinding: description: A single finding with with message and resource configuration. properties: @@ -8312,6 +9025,40 @@ components: description: The type of the resource. The value should always be device. type: string type: object + DisableAppResponse: + description: The definition of `DisableAppResponse` object. + properties: + data: + $ref: '#/components/schemas/DisableAppResponseData' + type: object + DisableAppResponseData: + description: The definition of `DisableAppResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/DisableAppResponseDataAttributes' + id: + description: The `data` `id`. + type: string + meta: + $ref: '#/components/schemas/DeploymentMeta' + type: + $ref: '#/components/schemas/DisableAppResponseDataType' + type: object + DisableAppResponseDataAttributes: + description: The definition of `DisableAppResponseDataAttributes` object. + properties: + app_version_id: + description: The `attributes` `app_version_id`. + type: string + type: object + DisableAppResponseDataType: + default: deployment + description: The definition of `DisableAppResponseDataType` object. + enum: + - deployment + type: string + x-enum-varnames: + - DEPLOYMENT DomainAllowlist: description: The email domain allowlist for an org. properties: @@ -11092,6 +11839,95 @@ components: type: string x-enum-varnames: - GCP_SERVICE_ACCOUNT + GetAppResponse: + description: The definition of `GetAppResponse` object. + properties: + data: + $ref: '#/components/schemas/GetAppResponseData' + included: + description: The `GetAppResponse` `included`. + items: + $ref: '#/components/schemas/DeploymentIncluded' + type: array + meta: + $ref: '#/components/schemas/AppMeta' + relationship: + $ref: '#/components/schemas/GetAppResponseRelationship' + type: object + GetAppResponseData: + description: The definition of `GetAppResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/GetAppResponseDataAttributes' + id: + description: The `data` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/GetAppResponseDataType' + required: + - id + - type + - attributes + type: object + GetAppResponseDataAttributes: + description: The definition of `GetAppResponseDataAttributes` object. + properties: + components: + description: The `attributes` `components`. + items: + $ref: '#/components/schemas/ComponentGrid' + type: array + description: + description: The `attributes` `description`. + type: string + embeddedQueries: + description: The `attributes` `embeddedQueries`. + items: + $ref: '#/components/schemas/Query' + type: array + favorite: + description: The `attributes` `favorite`. + type: boolean + inputSchema: + $ref: '#/components/schemas/InputSchema' + name: + description: The `attributes` `name`. + type: string + rootInstanceName: + description: The `attributes` `rootInstanceName`. + type: string + scripts: + description: The `attributes` `scripts`. + items: + $ref: '#/components/schemas/Script' + type: array + tags: + description: The `attributes` `tags`. + items: + type: string + type: array + type: object + GetAppResponseDataType: + default: appDefinitions + description: The definition of `GetAppResponseDataType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + GetAppResponseRelationship: + description: The definition of `GetAppResponseRelationship` object. + properties: + connections: + description: The `relationship` `connections`. + items: + $ref: '#/components/schemas/CustomConnection' + type: array + deployment: + $ref: '#/components/schemas/DeploymentRelationship' + type: object GetDataDeletionsResponseBody: description: The response from the get data deletion requests endpoint. properties: @@ -13745,6 +14581,77 @@ components: - ONCALL - INCIDENT - RELATION + InputSchema: + description: The definition of `InputSchema` object. + properties: + data: + $ref: '#/components/schemas/InputSchemaData' + type: object + InputSchemaData: + description: The definition of `InputSchemaData` object. + properties: + attributes: + $ref: '#/components/schemas/InputSchemaDataAttributes' + id: + description: The `data` `id`. + type: string + type: + $ref: '#/components/schemas/InputSchemaDataType' + type: object + InputSchemaDataAttributes: + description: The definition of `InputSchemaDataAttributes` object. + properties: + parameters: + description: The `attributes` `parameters`. + items: + $ref: '#/components/schemas/InputSchemaDataAttributesParametersItems' + type: array + type: object + InputSchemaDataAttributesParametersItems: + description: The definition of `InputSchemaDataAttributesParametersItems` object. + properties: + data: + $ref: '#/components/schemas/InputSchemaDataAttributesParametersItemsData' + type: object + InputSchemaDataAttributesParametersItemsData: + description: The definition of `InputSchemaDataAttributesParametersItemsData` + object. + properties: + attributes: + $ref: '#/components/schemas/InputSchemaDataAttributesParametersItemsDataAttributes' + type: object + InputSchemaDataAttributesParametersItemsDataAttributes: + description: The definition of `InputSchemaDataAttributesParametersItemsDataAttributes` + object. + properties: + defaultValue: + description: The `attributes` `defaultValue`. + description: + description: The `attributes` `description`. + type: string + enum: + description: The `attributes` `enum`. + items: + type: string + type: array + label: + description: The `attributes` `label`. + type: string + name: + description: The `attributes` `name`. + type: string + type: + description: The `attributes` `type`. + type: string + type: object + InputSchemaDataType: + default: inputSchema + description: The definition of `InputSchemaDataType` object. + enum: + - inputSchema + type: string + x-enum-varnames: + - INPUTSCHEMA IntakePayloadAccepted: description: The payload accepted for intake. properties: @@ -14130,6 +15037,96 @@ components: meta: $ref: '#/components/schemas/ApplicationKeyResponseMeta' type: object + ListAppsResponse: + description: The definition of `ListAppsResponse` object. + properties: + data: + description: The `ListAppsResponse` `data`. + items: + $ref: '#/components/schemas/ListAppsResponseDataItems' + type: array + included: + description: The `ListAppsResponse` `included`. + items: + $ref: '#/components/schemas/DeploymentIncluded' + type: array + meta: + $ref: '#/components/schemas/ListAppsResponseMeta' + type: object + ListAppsResponseDataItems: + description: The definition of `ListAppsResponseDataItems` object. + properties: + attributes: + $ref: '#/components/schemas/ListAppsResponseDataItemsAttributes' + id: + description: The `items` `id`. + example: '' + type: string + meta: + $ref: '#/components/schemas/AppMeta' + relationships: + $ref: '#/components/schemas/ListAppsResponseDataItemsRelationships' + type: + $ref: '#/components/schemas/ListAppsResponseDataItemsType' + required: + - id + - type + - attributes + type: object + ListAppsResponseDataItemsAttributes: + description: The definition of `ListAppsResponseDataItemsAttributes` object. + properties: + description: + description: The `attributes` `description`. + type: string + favorite: + description: The `attributes` `favorite`. + type: boolean + name: + description: The `attributes` `name`. + type: string + selfService: + description: The `attributes` `selfService`. + type: boolean + tags: + description: The `attributes` `tags`. + items: + type: string + type: array + type: object + ListAppsResponseDataItemsRelationships: + description: The definition of `ListAppsResponseDataItemsRelationships` object. + properties: + deployment: + $ref: '#/components/schemas/DeploymentRelationship' + type: object + ListAppsResponseDataItemsType: + default: appDefinitions + description: The definition of `ListAppsResponseDataItemsType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + ListAppsResponseMeta: + description: The definition of `ListAppsResponseMeta` object. + properties: + page: + $ref: '#/components/schemas/ListAppsResponseMetaPage' + type: object + ListAppsResponseMetaPage: + description: The definition of `ListAppsResponseMetaPage` object. + properties: + totalCount: + description: The `page` `totalCount`. + format: int64 + type: integer + totalFilteredCount: + description: The `page` `totalFilteredCount`. + format: int64 + type: integer + type: object ListDevicesResponse: description: List devices response. properties: @@ -18908,6 +19905,31 @@ components: $ref: '#/components/schemas/Project' type: array type: object + Query: + description: The definition of `Query` object. + properties: + events: + description: The `Query` `events`. + items: + $ref: '#/components/schemas/AppBuilderEvent' + type: array + id: + description: The `Query` `id`. + example: '' + type: string + name: + description: The `Query` `name`. + example: '' + type: string + properties: + description: The `Query` `properties`. + type: + $ref: '#/components/schemas/QueryType' + required: + - id + - name + - type + type: object QueryFormula: description: A formula for calculation based on one or more queries. properties: @@ -18931,6 +19953,18 @@ components: x-enum-varnames: - ASC - DESC + QueryType: + description: The definition of `QueryType` object. + enum: + - action + - stateVariable + - dataTransform + example: action + type: string + x-enum-varnames: + - ACTION + - STATEVARIABLE + - DATATRANSFORM RUMAggregateBucketValue: description: A bucket value, can be either a timeseries or a single value. oneOf: @@ -21465,6 +22499,44 @@ components: type: string x-enum-varnames: - SCORECARD + Script: + description: The definition of `Script` object. + properties: + data: + $ref: '#/components/schemas/ScriptData' + type: object + ScriptData: + description: The definition of `ScriptData` object. + properties: + attributes: + $ref: '#/components/schemas/ScriptDataAttributes' + id: + description: The `data` `id`. + type: string + type: + $ref: '#/components/schemas/ScriptDataType' + type: object + ScriptDataAttributes: + description: The definition of `ScriptDataAttributes` object. + properties: + name: + description: The `attributes` `name`. + type: string + src: + description: The `attributes` `src`. + type: string + type: + description: The `attributes` `type`. + type: string + type: object + ScriptDataType: + default: scripts + description: The definition of `ScriptDataType` object. + enum: + - scripts + type: string + x-enum-varnames: + - SCRIPTS SecurityFilter: description: The security filter's properties. properties: @@ -27058,6 +28130,197 @@ components: example: min type: string type: object + UpdateAppRequest: + description: The definition of `UpdateAppRequest` object. + example: + data: + attributes: + components: + - events: [] + name: grid0 + properties: + children: + - events: [] + name: gridCell0 + properties: + children: + - events: [] + name: calloutValue0 + properties: + isDisabled: false + isLoading: false + isVisible: true + label: CPU Usage + size: sm + style: vivid_yellow + unit: kB + value: '42' + type: calloutValue + isVisible: 'true' + layout: + default: + height: 8 + width: 2 + x: 0 + y: 0 + type: gridCell + type: grid + description: This is a simple example app + embeddedQueries: [] + name: Example App + rootInstanceName: grid0 + id: 9e20cbaf-68da-45a6-9ccf-54193ac29fa5 + type: appDefinitions + properties: + data: + $ref: '#/components/schemas/UpdateAppRequestData' + type: object + UpdateAppRequestData: + description: The definition of `UpdateAppRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppRequestDataAttributes' + id: + description: The `data` `id`. + type: string + type: + $ref: '#/components/schemas/UpdateAppRequestDataType' + required: + - type + type: object + UpdateAppRequestDataAttributes: + description: The definition of `UpdateAppRequestDataAttributes` object. + properties: + components: + description: The `attributes` `components`. + items: + $ref: '#/components/schemas/ComponentGrid' + type: array + description: + description: The `attributes` `description`. + type: string + embeddedQueries: + description: The `attributes` `embeddedQueries`. + items: + $ref: '#/components/schemas/Query' + type: array + inputSchema: + $ref: '#/components/schemas/InputSchema' + name: + description: The `attributes` `name`. + type: string + rootInstanceName: + description: The `attributes` `rootInstanceName`. + type: string + scripts: + description: The `attributes` `scripts`. + items: + $ref: '#/components/schemas/Script' + type: array + tags: + description: The `attributes` `tags`. + items: + type: string + type: array + type: object + UpdateAppRequestDataType: + default: appDefinitions + description: The definition of `UpdateAppRequestDataType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + UpdateAppResponse: + description: The definition of `UpdateAppResponse` object. + properties: + data: + $ref: '#/components/schemas/UpdateAppResponseData' + included: + description: The `UpdateAppResponse` `included`. + items: + $ref: '#/components/schemas/DeploymentIncluded' + type: array + meta: + $ref: '#/components/schemas/AppMeta' + relationship: + $ref: '#/components/schemas/UpdateAppResponseRelationship' + type: object + UpdateAppResponseData: + description: The definition of `UpdateAppResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/UpdateAppResponseDataAttributes' + id: + description: The `data` `id`. + example: '' + type: string + type: + $ref: '#/components/schemas/UpdateAppResponseDataType' + required: + - id + - type + - attributes + type: object + UpdateAppResponseDataAttributes: + description: The definition of `UpdateAppResponseDataAttributes` object. + properties: + components: + description: The `attributes` `components`. + items: + $ref: '#/components/schemas/ComponentGrid' + type: array + description: + description: The `attributes` `description`. + type: string + embeddedQueries: + description: The `attributes` `embeddedQueries`. + items: + $ref: '#/components/schemas/Query' + type: array + favorite: + description: The `attributes` `favorite`. + type: boolean + inputSchema: + $ref: '#/components/schemas/InputSchema' + name: + description: The `attributes` `name`. + type: string + rootInstanceName: + description: The `attributes` `rootInstanceName`. + type: string + scripts: + description: The `attributes` `scripts`. + items: + $ref: '#/components/schemas/Script' + type: array + tags: + description: The `attributes` `tags`. + items: + type: string + type: array + type: object + UpdateAppResponseDataType: + default: appDefinitions + description: The definition of `UpdateAppResponseDataType` object. + enum: + - appDefinitions + example: appDefinitions + type: string + x-enum-varnames: + - APPDEFINITIONS + UpdateAppResponseRelationship: + description: The definition of `UpdateAppResponseRelationship` object. + properties: + connections: + description: The `relationship` `connections`. + items: + $ref: '#/components/schemas/CustomConnection' + type: array + deployment: + $ref: '#/components/schemas/DeploymentRelationship' + type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -28816,6 +30079,430 @@ paths: permissions: - apm_retention_filter_write - apm_pipelines_write + /api/v2/app-builder/apps: + delete: + description: Delete multiple apps by ID + operationId: DeleteApps + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden, e.g. missing permissions to delete one or more apps + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete Multiple Apps + tags: + - Apps + x-permission: + operator: OR + permissions: + - apps_write + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + get: + description: List all apps, with optional filters and sorting + operationId: ListApps + parameters: + - description: The number of apps to return per page + in: query + name: limit + required: false + schema: + format: int64 + type: integer + - description: The page number to return + in: query + name: page + required: false + schema: + format: int64 + type: integer + - description: The `AppsFilter` `user_name`. + in: query + name: filter[user_name] + required: false + schema: + type: string + - description: The `AppsFilter` `user_uuid`. + in: query + name: filter[user_uuid] + required: false + schema: + type: string + - description: The `AppsFilter` `name`. + in: query + name: filter[name] + required: false + schema: + type: string + - description: The `AppsFilter` `query`. + in: query + name: filter[query] + required: false + schema: + type: string + - description: The `AppsFilter` `deployed`. + in: query + name: filter[deployed] + required: false + schema: + type: boolean + - description: The `AppsFilter` `tags`. + in: query + name: filter[tags] + required: false + schema: + type: string + - description: The `AppsFilter` `favorite`. + in: query + name: filter[favorite] + required: false + schema: + type: boolean + - explode: false + in: query + name: sort + required: false + schema: + items: + $ref: '#/components/schemas/AppsSortField' + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListAppsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request, e.g. invalid sort parameter + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List Apps + tags: + - Apps + x-permission: + operator: OR + permissions: + - apps_run + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + post: + description: Create a new app, returning the app ID + operationId: CreateApp + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAppResponse' + description: App Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden, e.g. missing required permissions to a connection + or workflow used in the app + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create App + tags: + - Apps + x-permission: + operator: AND + permissions: + - apps_write + - connections_resolve + - workflows_run + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + /api/v2/app-builder/apps/{app_id}: + delete: + description: Delete an app by ID + operationId: DeleteApp + parameters: + - in: path + name: app_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteAppResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Not Found + '410': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Gone + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete App + tags: + - Apps + x-permission: + operator: OR + permissions: + - apps_write + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + get: + description: Get the full definition of an app by ID + operationId: GetApp + parameters: + - in: path + name: app_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetAppResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get App + tags: + - Apps + x-permission: + operator: AND + permissions: + - apps_run + - connections_read + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + patch: + description: Update an existing app by ID. Creates a new version of the app + operationId: UpdateApp + parameters: + - in: path + name: app_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAppRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAppResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden, e.g. missing required permissions to a connection + or workflow used in the app + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update App + tags: + - Apps + x-permission: + operator: AND + permissions: + - apps_write + - connections_resolve + - workflows_run + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + /api/v2/app-builder/apps/{app_id}/deployment: + delete: + description: Disable an app by ID + operationId: DisableApp + parameters: + - in: path + name: app_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DisableAppResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Disable App + tags: + - App Deployment + x-permission: + operator: OR + permissions: + - apps_write + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' + post: + description: Deploy (publish) an app by ID + operationId: DeployApp + parameters: + - in: path + name: app_id + required: true + schema: + type: string + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/DeployAppResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/AppBuilderError' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Deploy App + tags: + - App Deployment + x-permission: + operator: OR + permissions: + - apps_write + x-unstable: '**Note**: App Builder API endpoints are still under active development + and may change at any time.' /api/v2/application_keys: get: description: List all application keys available for your org @@ -44843,6 +46530,10 @@ tags: externalDocs: url: https://docs.datadoghq.com/integrations/amazon_web_services/#log-collection name: AWS Logs Integration +- description: Deploy and disable apps in App Builder. + name: App Deployment +- description: Create, read, update, and delete apps in App Builder. + name: Apps - description: Search your Audit Logs events over HTTP. name: Audit - description: '[The AuthN Mappings API](https://docs.datadoghq.com/account_management/authn_mapping/?tab=example) diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 4187a2db4e6..c844575acae 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -328,6 +328,14 @@ func NewConfiguration() *Configuration { "v2.GetOpenAPI": false, "v2.ListAPIs": false, "v2.UpdateOpenAPI": false, + "v2.CreateApp": false, + "v2.DeleteApp": false, + "v2.DeleteApps": false, + "v2.GetApp": false, + "v2.ListApps": false, + "v2.UpdateApp": false, + "v2.DeployApp": false, + "v2.DisableApp": false, "v2.GetActiveBillingDimensions": false, "v2.GetBillingDimensionMapping": false, "v2.GetMonthlyCostAttribution": false, diff --git a/api/datadogV2/api_app_deployment.go b/api/datadogV2/api_app_deployment.go new file mode 100644 index 00000000000..3249b9ac6b8 --- /dev/null +++ b/api/datadogV2/api_app_deployment.go @@ -0,0 +1,204 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + _context "context" + _fmt "fmt" + _log "log" + _nethttp "net/http" + _neturl "net/url" + "strings" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppDeploymentApi service type +type AppDeploymentApi datadog.Service + +// DeployApp Deploy App. +// Deploy (publish) an app by ID +func (a *AppDeploymentApi) DeployApp(ctx _context.Context, appId string) (DeployAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue DeployAppResponse + ) + + operationId := "v2.DeployApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppDeploymentApi.DeployApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// DisableApp Disable App. +// Disable an app by ID +func (a *AppDeploymentApi) DisableApp(ctx _context.Context, appId string) (DisableAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue DisableAppResponse + ) + + operationId := "v2.DisableApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppDeploymentApi.DisableApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}/deployment" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NewAppDeploymentApi Returns NewAppDeploymentApi. +func NewAppDeploymentApi(client *datadog.APIClient) *AppDeploymentApi { + return &AppDeploymentApi{ + Client: client, + } +} diff --git a/api/datadogV2/api_apps.go b/api/datadogV2/api_apps.go new file mode 100644 index 00000000000..4af20fc72a6 --- /dev/null +++ b/api/datadogV2/api_apps.go @@ -0,0 +1,684 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + _context "context" + _fmt "fmt" + _log "log" + _nethttp "net/http" + _neturl "net/url" + "strings" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppsApi service type +type AppsApi datadog.Service + +// CreateApp Create App. +// Create a new app, returning the app ID +func (a *AppsApi) CreateApp(ctx _context.Context, body CreateAppRequest) (CreateAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarReturnValue CreateAppResponse + ) + + operationId := "v2.CreateApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.CreateApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// DeleteApp Delete App. +// Delete an app by ID +func (a *AppsApi) DeleteApp(ctx _context.Context, appId string) (DeleteAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue DeleteAppResponse + ) + + operationId := "v2.DeleteApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.DeleteApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 410 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// DeleteApps Delete Multiple Apps. +// Delete multiple apps by ID +func (a *AppsApi) DeleteApps(ctx _context.Context, body DeleteAppsRequest) (DeleteAppsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarReturnValue DeleteAppsResponse + ) + + operationId := "v2.DeleteApps" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.DeleteApps") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetApp Get App. +// Get the full definition of an app by ID +func (a *AppsApi) GetApp(ctx _context.Context, appId string) (GetAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue GetAppResponse + ) + + operationId := "v2.GetApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.GetApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListAppsOptionalParameters holds optional parameters for ListApps. +type ListAppsOptionalParameters struct { + Limit *int64 + Page *int64 + FilterUserName *string + FilterUserUuid *string + FilterName *string + FilterQuery *string + FilterDeployed *bool + FilterTags *string + FilterFavorite *bool + Sort *[]AppsSortField +} + +// NewListAppsOptionalParameters creates an empty struct for parameters. +func NewListAppsOptionalParameters() *ListAppsOptionalParameters { + this := ListAppsOptionalParameters{} + return &this +} + +// WithLimit sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithLimit(limit int64) *ListAppsOptionalParameters { + r.Limit = &limit + return r +} + +// WithPage sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithPage(page int64) *ListAppsOptionalParameters { + r.Page = &page + return r +} + +// WithFilterUserName sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterUserName(filterUserName string) *ListAppsOptionalParameters { + r.FilterUserName = &filterUserName + return r +} + +// WithFilterUserUuid sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterUserUuid(filterUserUuid string) *ListAppsOptionalParameters { + r.FilterUserUuid = &filterUserUuid + return r +} + +// WithFilterName sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterName(filterName string) *ListAppsOptionalParameters { + r.FilterName = &filterName + return r +} + +// WithFilterQuery sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterQuery(filterQuery string) *ListAppsOptionalParameters { + r.FilterQuery = &filterQuery + return r +} + +// WithFilterDeployed sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterDeployed(filterDeployed bool) *ListAppsOptionalParameters { + r.FilterDeployed = &filterDeployed + return r +} + +// WithFilterTags sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterTags(filterTags string) *ListAppsOptionalParameters { + r.FilterTags = &filterTags + return r +} + +// WithFilterFavorite sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithFilterFavorite(filterFavorite bool) *ListAppsOptionalParameters { + r.FilterFavorite = &filterFavorite + return r +} + +// WithSort sets the corresponding parameter name and returns the struct. +func (r *ListAppsOptionalParameters) WithSort(sort []AppsSortField) *ListAppsOptionalParameters { + r.Sort = &sort + return r +} + +// ListApps List Apps. +// List all apps, with optional filters and sorting +func (a *AppsApi) ListApps(ctx _context.Context, o ...ListAppsOptionalParameters) (ListAppsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue ListAppsResponse + optionalParams ListAppsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListAppsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListApps" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.ListApps") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.Limit != nil { + localVarQueryParams.Add("limit", datadog.ParameterToString(*optionalParams.Limit, "")) + } + if optionalParams.Page != nil { + localVarQueryParams.Add("page", datadog.ParameterToString(*optionalParams.Page, "")) + } + if optionalParams.FilterUserName != nil { + localVarQueryParams.Add("filter[user_name]", datadog.ParameterToString(*optionalParams.FilterUserName, "")) + } + if optionalParams.FilterUserUuid != nil { + localVarQueryParams.Add("filter[user_uuid]", datadog.ParameterToString(*optionalParams.FilterUserUuid, "")) + } + if optionalParams.FilterName != nil { + localVarQueryParams.Add("filter[name]", datadog.ParameterToString(*optionalParams.FilterName, "")) + } + if optionalParams.FilterQuery != nil { + localVarQueryParams.Add("filter[query]", datadog.ParameterToString(*optionalParams.FilterQuery, "")) + } + if optionalParams.FilterDeployed != nil { + localVarQueryParams.Add("filter[deployed]", datadog.ParameterToString(*optionalParams.FilterDeployed, "")) + } + if optionalParams.FilterTags != nil { + localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(*optionalParams.FilterTags, "")) + } + if optionalParams.FilterFavorite != nil { + localVarQueryParams.Add("filter[favorite]", datadog.ParameterToString(*optionalParams.FilterFavorite, "")) + } + if optionalParams.Sort != nil { + localVarQueryParams.Add("sort", datadog.ParameterToString(*optionalParams.Sort, "csv")) + } + localVarHeaderParams["Accept"] = "application/json" + + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UpdateApp Update App. +// Update an existing app by ID. Creates a new version of the app +func (a *AppsApi) UpdateApp(ctx _context.Context, appId string, body UpdateAppRequest) (UpdateAppResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue UpdateAppResponse + ) + + operationId := "v2.UpdateApp" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.AppsApi.UpdateApp") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/app-builder/apps/{app_id}" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", _neturl.PathEscape(datadog.ParameterToString(appId, "")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 { + var v AppBuilderError + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// NewAppsApi Returns NewAppsApi. +func NewAppsApi(client *datadog.APIClient) *AppsApi { + return &AppsApi{ + Client: client, + } +} diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index 0de44773a98..72016bb2933 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -22,6 +22,14 @@ // - [AWSIntegrationApi.ListAWSNamespaces] // - [AWSIntegrationApi.UpdateAWSAccount] // - [AWSLogsIntegrationApi.ListAWSLogsServices] +// - [AppDeploymentApi.DeployApp] +// - [AppDeploymentApi.DisableApp] +// - [AppsApi.CreateApp] +// - [AppsApi.DeleteApp] +// - [AppsApi.DeleteApps] +// - [AppsApi.GetApp] +// - [AppsApi.ListApps] +// - [AppsApi.UpdateApp] // - [AuditApi.ListAuditLogs] // - [AuditApi.SearchAuditLogs] // - [AuthNMappingsApi.CreateAuthNMapping] diff --git a/api/datadogV2/model_app_builder_error.go b/api/datadogV2/model_app_builder_error.go new file mode 100644 index 00000000000..5103942e3a1 --- /dev/null +++ b/api/datadogV2/model_app_builder_error.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderError The definition of `AppBuilderError` object. +type AppBuilderError struct { + // The `AppBuilderError` `errors`. + Errors []AppBuilderErrorErrorsItems `json:"errors,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppBuilderError instantiates a new AppBuilderError object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppBuilderError() *AppBuilderError { + this := AppBuilderError{} + return &this +} + +// NewAppBuilderErrorWithDefaults instantiates a new AppBuilderError object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppBuilderErrorWithDefaults() *AppBuilderError { + this := AppBuilderError{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *AppBuilderError) GetErrors() []AppBuilderErrorErrorsItems { + if o == nil || o.Errors == nil { + var ret []AppBuilderErrorErrorsItems + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderError) GetErrorsOk() (*[]AppBuilderErrorErrorsItems, bool) { + if o == nil || o.Errors == nil { + return nil, false + } + return &o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *AppBuilderError) HasErrors() bool { + return o != nil && o.Errors != nil +} + +// SetErrors gets a reference to the given []AppBuilderErrorErrorsItems and assigns it to the Errors field. +func (o *AppBuilderError) SetErrors(v []AppBuilderErrorErrorsItems) { + o.Errors = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppBuilderError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppBuilderError) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Errors []AppBuilderErrorErrorsItems `json:"errors,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"errors"}) + } else { + return err + } + o.Errors = all.Errors + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_app_builder_error_errors_items.go b/api/datadogV2/model_app_builder_error_errors_items.go new file mode 100644 index 00000000000..5fb11314e74 --- /dev/null +++ b/api/datadogV2/model_app_builder_error_errors_items.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderErrorErrorsItems The definition of `AppBuilderErrorErrorsItems` object. +type AppBuilderErrorErrorsItems struct { + // The `items` `detail`. + Detail *string `json:"detail,omitempty"` + // The definition of `AppBuilderErrorErrorsItemsSource` object. + Source *AppBuilderErrorErrorsItemsSource `json:"source,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppBuilderErrorErrorsItems instantiates a new AppBuilderErrorErrorsItems object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppBuilderErrorErrorsItems() *AppBuilderErrorErrorsItems { + this := AppBuilderErrorErrorsItems{} + return &this +} + +// NewAppBuilderErrorErrorsItemsWithDefaults instantiates a new AppBuilderErrorErrorsItems object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppBuilderErrorErrorsItemsWithDefaults() *AppBuilderErrorErrorsItems { + this := AppBuilderErrorErrorsItems{} + return &this +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *AppBuilderErrorErrorsItems) GetDetail() string { + if o == nil || o.Detail == nil { + var ret string + return ret + } + return *o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderErrorErrorsItems) GetDetailOk() (*string, bool) { + if o == nil || o.Detail == nil { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *AppBuilderErrorErrorsItems) HasDetail() bool { + return o != nil && o.Detail != nil +} + +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *AppBuilderErrorErrorsItems) SetDetail(v string) { + o.Detail = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *AppBuilderErrorErrorsItems) GetSource() AppBuilderErrorErrorsItemsSource { + if o == nil || o.Source == nil { + var ret AppBuilderErrorErrorsItemsSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderErrorErrorsItems) GetSourceOk() (*AppBuilderErrorErrorsItemsSource, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *AppBuilderErrorErrorsItems) HasSource() bool { + return o != nil && o.Source != nil +} + +// SetSource gets a reference to the given AppBuilderErrorErrorsItemsSource and assigns it to the Source field. +func (o *AppBuilderErrorErrorsItems) SetSource(v AppBuilderErrorErrorsItemsSource) { + o.Source = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppBuilderErrorErrorsItems) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Detail != nil { + toSerialize["detail"] = o.Detail + } + if o.Source != nil { + toSerialize["source"] = o.Source + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppBuilderErrorErrorsItems) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Detail *string `json:"detail,omitempty"` + Source *AppBuilderErrorErrorsItemsSource `json:"source,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"detail", "source"}) + } else { + return err + } + + hasInvalidField := false + o.Detail = all.Detail + if all.Source != nil && all.Source.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Source = all.Source + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_app_builder_error_errors_items_source.go b/api/datadogV2/model_app_builder_error_errors_items_source.go new file mode 100644 index 00000000000..9551347ecdc --- /dev/null +++ b/api/datadogV2/model_app_builder_error_errors_items_source.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderErrorErrorsItemsSource The definition of `AppBuilderErrorErrorsItemsSource` object. +type AppBuilderErrorErrorsItemsSource struct { + // The `source` `parameter`. + Parameter *string `json:"parameter,omitempty"` + // The `source` `pointer`. + Pointer *string `json:"pointer,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppBuilderErrorErrorsItemsSource instantiates a new AppBuilderErrorErrorsItemsSource object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppBuilderErrorErrorsItemsSource() *AppBuilderErrorErrorsItemsSource { + this := AppBuilderErrorErrorsItemsSource{} + return &this +} + +// NewAppBuilderErrorErrorsItemsSourceWithDefaults instantiates a new AppBuilderErrorErrorsItemsSource object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppBuilderErrorErrorsItemsSourceWithDefaults() *AppBuilderErrorErrorsItemsSource { + this := AppBuilderErrorErrorsItemsSource{} + return &this +} + +// GetParameter returns the Parameter field value if set, zero value otherwise. +func (o *AppBuilderErrorErrorsItemsSource) GetParameter() string { + if o == nil || o.Parameter == nil { + var ret string + return ret + } + return *o.Parameter +} + +// GetParameterOk returns a tuple with the Parameter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderErrorErrorsItemsSource) GetParameterOk() (*string, bool) { + if o == nil || o.Parameter == nil { + return nil, false + } + return o.Parameter, true +} + +// HasParameter returns a boolean if a field has been set. +func (o *AppBuilderErrorErrorsItemsSource) HasParameter() bool { + return o != nil && o.Parameter != nil +} + +// SetParameter gets a reference to the given string and assigns it to the Parameter field. +func (o *AppBuilderErrorErrorsItemsSource) SetParameter(v string) { + o.Parameter = &v +} + +// GetPointer returns the Pointer field value if set, zero value otherwise. +func (o *AppBuilderErrorErrorsItemsSource) GetPointer() string { + if o == nil || o.Pointer == nil { + var ret string + return ret + } + return *o.Pointer +} + +// GetPointerOk returns a tuple with the Pointer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderErrorErrorsItemsSource) GetPointerOk() (*string, bool) { + if o == nil || o.Pointer == nil { + return nil, false + } + return o.Pointer, true +} + +// HasPointer returns a boolean if a field has been set. +func (o *AppBuilderErrorErrorsItemsSource) HasPointer() bool { + return o != nil && o.Pointer != nil +} + +// SetPointer gets a reference to the given string and assigns it to the Pointer field. +func (o *AppBuilderErrorErrorsItemsSource) SetPointer(v string) { + o.Pointer = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppBuilderErrorErrorsItemsSource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Parameter != nil { + toSerialize["parameter"] = o.Parameter + } + if o.Pointer != nil { + toSerialize["pointer"] = o.Pointer + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppBuilderErrorErrorsItemsSource) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Parameter *string `json:"parameter,omitempty"` + Pointer *string `json:"pointer,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"parameter", "pointer"}) + } else { + return err + } + o.Parameter = all.Parameter + o.Pointer = all.Pointer + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_app_builder_event.go b/api/datadogV2/model_app_builder_event.go new file mode 100644 index 00000000000..053db569091 --- /dev/null +++ b/api/datadogV2/model_app_builder_event.go @@ -0,0 +1,151 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderEvent The definition of `AppBuilderEvent` object. +type AppBuilderEvent struct { + // The triggering action for the event. + Name *AppBuilderEventName `json:"name,omitempty"` + // The response to the event. + Type *AppBuilderEventType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppBuilderEvent instantiates a new AppBuilderEvent object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppBuilderEvent() *AppBuilderEvent { + this := AppBuilderEvent{} + return &this +} + +// NewAppBuilderEventWithDefaults instantiates a new AppBuilderEvent object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppBuilderEventWithDefaults() *AppBuilderEvent { + this := AppBuilderEvent{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *AppBuilderEvent) GetName() AppBuilderEventName { + if o == nil || o.Name == nil { + var ret AppBuilderEventName + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderEvent) GetNameOk() (*AppBuilderEventName, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *AppBuilderEvent) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given AppBuilderEventName and assigns it to the Name field. +func (o *AppBuilderEvent) SetName(v AppBuilderEventName) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *AppBuilderEvent) GetType() AppBuilderEventType { + if o == nil || o.Type == nil { + var ret AppBuilderEventType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppBuilderEvent) GetTypeOk() (*AppBuilderEventType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *AppBuilderEvent) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given AppBuilderEventType and assigns it to the Type field. +func (o *AppBuilderEvent) SetType(v AppBuilderEventType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppBuilderEvent) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppBuilderEvent) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *AppBuilderEventName `json:"name,omitempty"` + Type *AppBuilderEventType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Name != nil && !all.Name.IsValid() { + hasInvalidField = true + } else { + o.Name = all.Name + } + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_app_builder_event_name.go b/api/datadogV2/model_app_builder_event_name.go new file mode 100644 index 00000000000..330baa1b22b --- /dev/null +++ b/api/datadogV2/model_app_builder_event_name.go @@ -0,0 +1,82 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderEventName The triggering action for the event. +type AppBuilderEventName string + +// List of AppBuilderEventName. +const ( + APPBUILDEREVENTNAME_PAGECHANGE AppBuilderEventName = "pageChange" + APPBUILDEREVENTNAME_TABLEROWCLICK AppBuilderEventName = "tableRowClick" + APPBUILDEREVENTNAME_TABLEROWBUTTONCLICK AppBuilderEventName = "_tableRowButtonClick" + APPBUILDEREVENTNAME_CHANGE AppBuilderEventName = "change" + APPBUILDEREVENTNAME_SUBMIT AppBuilderEventName = "submit" + APPBUILDEREVENTNAME_CLICK AppBuilderEventName = "click" + APPBUILDEREVENTNAME_TOGGLEOPEN AppBuilderEventName = "toggleOpen" + APPBUILDEREVENTNAME_CLOSE AppBuilderEventName = "close" + APPBUILDEREVENTNAME_OPEN AppBuilderEventName = "open" + APPBUILDEREVENTNAME_EXECUTIONFINISHED AppBuilderEventName = "executionFinished" +) + +var allowedAppBuilderEventNameEnumValues = []AppBuilderEventName{ + APPBUILDEREVENTNAME_PAGECHANGE, + APPBUILDEREVENTNAME_TABLEROWCLICK, + APPBUILDEREVENTNAME_TABLEROWBUTTONCLICK, + APPBUILDEREVENTNAME_CHANGE, + APPBUILDEREVENTNAME_SUBMIT, + APPBUILDEREVENTNAME_CLICK, + APPBUILDEREVENTNAME_TOGGLEOPEN, + APPBUILDEREVENTNAME_CLOSE, + APPBUILDEREVENTNAME_OPEN, + APPBUILDEREVENTNAME_EXECUTIONFINISHED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppBuilderEventName) GetAllowedValues() []AppBuilderEventName { + return allowedAppBuilderEventNameEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppBuilderEventName) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppBuilderEventName(value) + return nil +} + +// NewAppBuilderEventNameFromValue returns a pointer to a valid AppBuilderEventName +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppBuilderEventNameFromValue(v string) (*AppBuilderEventName, error) { + ev := AppBuilderEventName(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppBuilderEventName: valid values are %v", v, allowedAppBuilderEventNameEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppBuilderEventName) IsValid() bool { + for _, existing := range allowedAppBuilderEventNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppBuilderEventName value. +func (v AppBuilderEventName) Ptr() *AppBuilderEventName { + return &v +} diff --git a/api/datadogV2/model_app_builder_event_type.go b/api/datadogV2/model_app_builder_event_type.go new file mode 100644 index 00000000000..5c64646bc93 --- /dev/null +++ b/api/datadogV2/model_app_builder_event_type.go @@ -0,0 +1,78 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppBuilderEventType The response to the event. +type AppBuilderEventType string + +// List of AppBuilderEventType. +const ( + APPBUILDEREVENTTYPE_CUSTOM AppBuilderEventType = "custom" + APPBUILDEREVENTTYPE_SETCOMPONENTSTATE AppBuilderEventType = "setComponentState" + APPBUILDEREVENTTYPE_TRIGGERQUERY AppBuilderEventType = "triggerQuery" + APPBUILDEREVENTTYPE_OPENMODAL AppBuilderEventType = "openModal" + APPBUILDEREVENTTYPE_CLOSEMODAL AppBuilderEventType = "closeModal" + APPBUILDEREVENTTYPE_OPENURL AppBuilderEventType = "openUrl" + APPBUILDEREVENTTYPE_DOWNLOADFILE AppBuilderEventType = "downloadFile" + APPBUILDEREVENTTYPE_SETSTATEVARIABLEVALUE AppBuilderEventType = "setStateVariableValue" +) + +var allowedAppBuilderEventTypeEnumValues = []AppBuilderEventType{ + APPBUILDEREVENTTYPE_CUSTOM, + APPBUILDEREVENTTYPE_SETCOMPONENTSTATE, + APPBUILDEREVENTTYPE_TRIGGERQUERY, + APPBUILDEREVENTTYPE_OPENMODAL, + APPBUILDEREVENTTYPE_CLOSEMODAL, + APPBUILDEREVENTTYPE_OPENURL, + APPBUILDEREVENTTYPE_DOWNLOADFILE, + APPBUILDEREVENTTYPE_SETSTATEVARIABLEVALUE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppBuilderEventType) GetAllowedValues() []AppBuilderEventType { + return allowedAppBuilderEventTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppBuilderEventType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppBuilderEventType(value) + return nil +} + +// NewAppBuilderEventTypeFromValue returns a pointer to a valid AppBuilderEventType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppBuilderEventTypeFromValue(v string) (*AppBuilderEventType, error) { + ev := AppBuilderEventType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppBuilderEventType: valid values are %v", v, allowedAppBuilderEventTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppBuilderEventType) IsValid() bool { + for _, existing := range allowedAppBuilderEventTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppBuilderEventType value. +func (v AppBuilderEventType) Ptr() *AppBuilderEventType { + return &v +} diff --git a/api/datadogV2/model_app_meta.go b/api/datadogV2/model_app_meta.go new file mode 100644 index 00000000000..b5dc27adc68 --- /dev/null +++ b/api/datadogV2/model_app_meta.go @@ -0,0 +1,417 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppMeta The definition of `AppMeta` object. +type AppMeta struct { + // The `AppMeta` `created_at`. + CreatedAt *string `json:"created_at,omitempty"` + // The `AppMeta` `deleted_at`. + DeletedAt *string `json:"deleted_at,omitempty"` + // The `AppMeta` `org_id`. + OrgId *int64 `json:"org_id,omitempty"` + // The `AppMeta` `run_as_user`. + RunAsUser *string `json:"run_as_user,omitempty"` + // The `AppMeta` `updated_at`. + UpdatedAt *string `json:"updated_at,omitempty"` + // The `AppMeta` `updated_since_deployment`. + UpdatedSinceDeployment *bool `json:"updated_since_deployment,omitempty"` + // The `AppMeta` `user_id`. + UserId *int64 `json:"user_id,omitempty"` + // The `AppMeta` `user_name`. + UserName *string `json:"user_name,omitempty"` + // The `AppMeta` `user_uuid`. + UserUuid *string `json:"user_uuid,omitempty"` + // The `AppMeta` `version`. + Version *int64 `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewAppMeta instantiates a new AppMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewAppMeta() *AppMeta { + this := AppMeta{} + return &this +} + +// NewAppMetaWithDefaults instantiates a new AppMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewAppMetaWithDefaults() *AppMeta { + this := AppMeta{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AppMeta) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AppMeta) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *AppMeta) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise. +func (o *AppMeta) GetDeletedAt() string { + if o == nil || o.DeletedAt == nil { + var ret string + return ret + } + return *o.DeletedAt +} + +// GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetDeletedAtOk() (*string, bool) { + if o == nil || o.DeletedAt == nil { + return nil, false + } + return o.DeletedAt, true +} + +// HasDeletedAt returns a boolean if a field has been set. +func (o *AppMeta) HasDeletedAt() bool { + return o != nil && o.DeletedAt != nil +} + +// SetDeletedAt gets a reference to the given string and assigns it to the DeletedAt field. +func (o *AppMeta) SetDeletedAt(v string) { + o.DeletedAt = &v +} + +// GetOrgId returns the OrgId field value if set, zero value otherwise. +func (o *AppMeta) GetOrgId() int64 { + if o == nil || o.OrgId == nil { + var ret int64 + return ret + } + return *o.OrgId +} + +// GetOrgIdOk returns a tuple with the OrgId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetOrgIdOk() (*int64, bool) { + if o == nil || o.OrgId == nil { + return nil, false + } + return o.OrgId, true +} + +// HasOrgId returns a boolean if a field has been set. +func (o *AppMeta) HasOrgId() bool { + return o != nil && o.OrgId != nil +} + +// SetOrgId gets a reference to the given int64 and assigns it to the OrgId field. +func (o *AppMeta) SetOrgId(v int64) { + o.OrgId = &v +} + +// GetRunAsUser returns the RunAsUser field value if set, zero value otherwise. +func (o *AppMeta) GetRunAsUser() string { + if o == nil || o.RunAsUser == nil { + var ret string + return ret + } + return *o.RunAsUser +} + +// GetRunAsUserOk returns a tuple with the RunAsUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetRunAsUserOk() (*string, bool) { + if o == nil || o.RunAsUser == nil { + return nil, false + } + return o.RunAsUser, true +} + +// HasRunAsUser returns a boolean if a field has been set. +func (o *AppMeta) HasRunAsUser() bool { + return o != nil && o.RunAsUser != nil +} + +// SetRunAsUser gets a reference to the given string and assigns it to the RunAsUser field. +func (o *AppMeta) SetRunAsUser(v string) { + o.RunAsUser = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AppMeta) GetUpdatedAt() string { + if o == nil || o.UpdatedAt == nil { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetUpdatedAtOk() (*string, bool) { + if o == nil || o.UpdatedAt == nil { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AppMeta) HasUpdatedAt() bool { + return o != nil && o.UpdatedAt != nil +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *AppMeta) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +// GetUpdatedSinceDeployment returns the UpdatedSinceDeployment field value if set, zero value otherwise. +func (o *AppMeta) GetUpdatedSinceDeployment() bool { + if o == nil || o.UpdatedSinceDeployment == nil { + var ret bool + return ret + } + return *o.UpdatedSinceDeployment +} + +// GetUpdatedSinceDeploymentOk returns a tuple with the UpdatedSinceDeployment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetUpdatedSinceDeploymentOk() (*bool, bool) { + if o == nil || o.UpdatedSinceDeployment == nil { + return nil, false + } + return o.UpdatedSinceDeployment, true +} + +// HasUpdatedSinceDeployment returns a boolean if a field has been set. +func (o *AppMeta) HasUpdatedSinceDeployment() bool { + return o != nil && o.UpdatedSinceDeployment != nil +} + +// SetUpdatedSinceDeployment gets a reference to the given bool and assigns it to the UpdatedSinceDeployment field. +func (o *AppMeta) SetUpdatedSinceDeployment(v bool) { + o.UpdatedSinceDeployment = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *AppMeta) GetUserId() int64 { + if o == nil || o.UserId == nil { + var ret int64 + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetUserIdOk() (*int64, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *AppMeta) HasUserId() bool { + return o != nil && o.UserId != nil +} + +// SetUserId gets a reference to the given int64 and assigns it to the UserId field. +func (o *AppMeta) SetUserId(v int64) { + o.UserId = &v +} + +// GetUserName returns the UserName field value if set, zero value otherwise. +func (o *AppMeta) GetUserName() string { + if o == nil || o.UserName == nil { + var ret string + return ret + } + return *o.UserName +} + +// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetUserNameOk() (*string, bool) { + if o == nil || o.UserName == nil { + return nil, false + } + return o.UserName, true +} + +// HasUserName returns a boolean if a field has been set. +func (o *AppMeta) HasUserName() bool { + return o != nil && o.UserName != nil +} + +// SetUserName gets a reference to the given string and assigns it to the UserName field. +func (o *AppMeta) SetUserName(v string) { + o.UserName = &v +} + +// GetUserUuid returns the UserUuid field value if set, zero value otherwise. +func (o *AppMeta) GetUserUuid() string { + if o == nil || o.UserUuid == nil { + var ret string + return ret + } + return *o.UserUuid +} + +// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetUserUuidOk() (*string, bool) { + if o == nil || o.UserUuid == nil { + return nil, false + } + return o.UserUuid, true +} + +// HasUserUuid returns a boolean if a field has been set. +func (o *AppMeta) HasUserUuid() bool { + return o != nil && o.UserUuid != nil +} + +// SetUserUuid gets a reference to the given string and assigns it to the UserUuid field. +func (o *AppMeta) SetUserUuid(v string) { + o.UserUuid = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *AppMeta) GetVersion() int64 { + if o == nil || o.Version == nil { + var ret int64 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppMeta) GetVersionOk() (*int64, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *AppMeta) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given int64 and assigns it to the Version field. +func (o *AppMeta) SetVersion(v int64) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o AppMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.DeletedAt != nil { + toSerialize["deleted_at"] = o.DeletedAt + } + if o.OrgId != nil { + toSerialize["org_id"] = o.OrgId + } + if o.RunAsUser != nil { + toSerialize["run_as_user"] = o.RunAsUser + } + if o.UpdatedAt != nil { + toSerialize["updated_at"] = o.UpdatedAt + } + if o.UpdatedSinceDeployment != nil { + toSerialize["updated_since_deployment"] = o.UpdatedSinceDeployment + } + if o.UserId != nil { + toSerialize["user_id"] = o.UserId + } + if o.UserName != nil { + toSerialize["user_name"] = o.UserName + } + if o.UserUuid != nil { + toSerialize["user_uuid"] = o.UserUuid + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *AppMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *string `json:"created_at,omitempty"` + DeletedAt *string `json:"deleted_at,omitempty"` + OrgId *int64 `json:"org_id,omitempty"` + RunAsUser *string `json:"run_as_user,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` + UpdatedSinceDeployment *bool `json:"updated_since_deployment,omitempty"` + UserId *int64 `json:"user_id,omitempty"` + UserName *string `json:"user_name,omitempty"` + UserUuid *string `json:"user_uuid,omitempty"` + Version *int64 `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "deleted_at", "org_id", "run_as_user", "updated_at", "updated_since_deployment", "user_id", "user_name", "user_uuid", "version"}) + } else { + return err + } + o.CreatedAt = all.CreatedAt + o.DeletedAt = all.DeletedAt + o.OrgId = all.OrgId + o.RunAsUser = all.RunAsUser + o.UpdatedAt = all.UpdatedAt + o.UpdatedSinceDeployment = all.UpdatedSinceDeployment + o.UserId = all.UserId + o.UserName = all.UserName + o.UserUuid = all.UserUuid + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_apps_sort_field.go b/api/datadogV2/model_apps_sort_field.go new file mode 100644 index 00000000000..c701e0ad7b3 --- /dev/null +++ b/api/datadogV2/model_apps_sort_field.go @@ -0,0 +1,78 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// AppsSortField The field and direction to sort apps by +type AppsSortField string + +// List of AppsSortField. +const ( + APPSSORTFIELD_NAME AppsSortField = "name" + APPSSORTFIELD_CREATED_AT AppsSortField = "created_at" + APPSSORTFIELD_UPDATED_AT AppsSortField = "updated_at" + APPSSORTFIELD_USER_NAME AppsSortField = "user_name" + APPSSORTFIELD_NAME_DESC AppsSortField = "-name" + APPSSORTFIELD_CREATED_AT_DESC AppsSortField = "-created_at" + APPSSORTFIELD_UPDATED_AT_DESC AppsSortField = "-updated_at" + APPSSORTFIELD_USER_NAME_DESC AppsSortField = "-user_name" +) + +var allowedAppsSortFieldEnumValues = []AppsSortField{ + APPSSORTFIELD_NAME, + APPSSORTFIELD_CREATED_AT, + APPSSORTFIELD_UPDATED_AT, + APPSSORTFIELD_USER_NAME, + APPSSORTFIELD_NAME_DESC, + APPSSORTFIELD_CREATED_AT_DESC, + APPSSORTFIELD_UPDATED_AT_DESC, + APPSSORTFIELD_USER_NAME_DESC, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *AppsSortField) GetAllowedValues() []AppsSortField { + return allowedAppsSortFieldEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *AppsSortField) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = AppsSortField(value) + return nil +} + +// NewAppsSortFieldFromValue returns a pointer to a valid AppsSortField +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewAppsSortFieldFromValue(v string) (*AppsSortField, error) { + ev := AppsSortField(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for AppsSortField: valid values are %v", v, allowedAppsSortFieldEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v AppsSortField) IsValid() bool { + for _, existing := range allowedAppsSortFieldEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppsSortField value. +func (v AppsSortField) Ptr() *AppsSortField { + return &v +} diff --git a/api/datadogV2/model_component.go b/api/datadogV2/model_component.go new file mode 100644 index 00000000000..3d034f4d5e6 --- /dev/null +++ b/api/datadogV2/model_component.go @@ -0,0 +1,259 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// Component The definition of `Component` object. +type Component struct { + // The `Component` `events`. + Events []AppBuilderEvent `json:"events,omitempty"` + // The `Component` `id`. + Id datadog.NullableString `json:"id,omitempty"` + // The `Component` `name`. + Name string `json:"name"` + // The definition of `ComponentProperties` object. + Properties ComponentProperties `json:"properties"` + // The definition of `ComponentType` object. + Type ComponentType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewComponent instantiates a new Component object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewComponent(name string, properties ComponentProperties, typeVar ComponentType) *Component { + this := Component{} + this.Name = name + this.Properties = properties + this.Type = typeVar + return &this +} + +// NewComponentWithDefaults instantiates a new Component object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewComponentWithDefaults() *Component { + this := Component{} + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *Component) GetEvents() []AppBuilderEvent { + if o == nil || o.Events == nil { + var ret []AppBuilderEvent + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Component) GetEventsOk() (*[]AppBuilderEvent, bool) { + if o == nil || o.Events == nil { + return nil, false + } + return &o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *Component) HasEvents() bool { + return o != nil && o.Events != nil +} + +// SetEvents gets a reference to the given []AppBuilderEvent and assigns it to the Events field. +func (o *Component) SetEvents(v []AppBuilderEvent) { + o.Events = v +} + +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Component) GetId() string { + if o == nil || o.Id.Get() == nil { + var ret string + return ret + } + return *o.Id.Get() +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *Component) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id.Get(), o.Id.IsSet() +} + +// HasId returns a boolean if a field has been set. +func (o *Component) HasId() bool { + return o != nil && o.Id.IsSet() +} + +// SetId gets a reference to the given datadog.NullableString and assigns it to the Id field. +func (o *Component) SetId(v string) { + o.Id.Set(&v) +} + +// SetIdNil sets the value for Id to be an explicit nil. +func (o *Component) SetIdNil() { + o.Id.Set(nil) +} + +// UnsetId ensures that no value is present for Id, not even an explicit nil. +func (o *Component) UnsetId() { + o.Id.Unset() +} + +// GetName returns the Name field value. +func (o *Component) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Component) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *Component) SetName(v string) { + o.Name = v +} + +// GetProperties returns the Properties field value. +func (o *Component) GetProperties() ComponentProperties { + if o == nil { + var ret ComponentProperties + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +func (o *Component) GetPropertiesOk() (*ComponentProperties, bool) { + if o == nil { + return nil, false + } + return &o.Properties, true +} + +// SetProperties sets field value. +func (o *Component) SetProperties(v ComponentProperties) { + o.Properties = v +} + +// GetType returns the Type field value. +func (o *Component) GetType() ComponentType { + if o == nil { + var ret ComponentType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Component) GetTypeOk() (*ComponentType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *Component) SetType(v ComponentType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o Component) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Events != nil { + toSerialize["events"] = o.Events + } + if o.Id.IsSet() { + toSerialize["id"] = o.Id.Get() + } + toSerialize["name"] = o.Name + toSerialize["properties"] = o.Properties + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *Component) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Events []AppBuilderEvent `json:"events,omitempty"` + Id datadog.NullableString `json:"id,omitempty"` + Name *string `json:"name"` + Properties *ComponentProperties `json:"properties"` + Type *ComponentType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Properties == nil { + return fmt.Errorf("required field properties missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"events", "id", "name", "properties", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Events = all.Events + o.Id = all.Id + o.Name = *all.Name + if all.Properties.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Properties = *all.Properties + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_component_grid.go b/api/datadogV2/model_component_grid.go new file mode 100644 index 00000000000..cb1e38205e4 --- /dev/null +++ b/api/datadogV2/model_component_grid.go @@ -0,0 +1,248 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentGrid The definition of `ComponentGrid` object. +type ComponentGrid struct { + // The `ComponentGrid` `events`. + Events []AppBuilderEvent `json:"events,omitempty"` + // The `ComponentGrid` `id`. + Id *string `json:"id,omitempty"` + // The `ComponentGrid` `name`. + Name string `json:"name"` + // The definition of `ComponentGridProperties` object. + Properties ComponentGridProperties `json:"properties"` + // The definition of `ComponentGridType` object. + Type ComponentGridType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewComponentGrid instantiates a new ComponentGrid object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewComponentGrid(name string, properties ComponentGridProperties, typeVar ComponentGridType) *ComponentGrid { + this := ComponentGrid{} + this.Name = name + this.Properties = properties + this.Type = typeVar + return &this +} + +// NewComponentGridWithDefaults instantiates a new ComponentGrid object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewComponentGridWithDefaults() *ComponentGrid { + this := ComponentGrid{} + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *ComponentGrid) GetEvents() []AppBuilderEvent { + if o == nil || o.Events == nil { + var ret []AppBuilderEvent + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentGrid) GetEventsOk() (*[]AppBuilderEvent, bool) { + if o == nil || o.Events == nil { + return nil, false + } + return &o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *ComponentGrid) HasEvents() bool { + return o != nil && o.Events != nil +} + +// SetEvents gets a reference to the given []AppBuilderEvent and assigns it to the Events field. +func (o *ComponentGrid) SetEvents(v []AppBuilderEvent) { + o.Events = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ComponentGrid) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentGrid) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ComponentGrid) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ComponentGrid) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value. +func (o *ComponentGrid) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ComponentGrid) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *ComponentGrid) SetName(v string) { + o.Name = v +} + +// GetProperties returns the Properties field value. +func (o *ComponentGrid) GetProperties() ComponentGridProperties { + if o == nil { + var ret ComponentGridProperties + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value +// and a boolean to check if the value has been set. +func (o *ComponentGrid) GetPropertiesOk() (*ComponentGridProperties, bool) { + if o == nil { + return nil, false + } + return &o.Properties, true +} + +// SetProperties sets field value. +func (o *ComponentGrid) SetProperties(v ComponentGridProperties) { + o.Properties = v +} + +// GetType returns the Type field value. +func (o *ComponentGrid) GetType() ComponentGridType { + if o == nil { + var ret ComponentGridType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ComponentGrid) GetTypeOk() (*ComponentGridType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ComponentGrid) SetType(v ComponentGridType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ComponentGrid) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Events != nil { + toSerialize["events"] = o.Events + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + toSerialize["name"] = o.Name + toSerialize["properties"] = o.Properties + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ComponentGrid) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Events []AppBuilderEvent `json:"events,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name"` + Properties *ComponentGridProperties `json:"properties"` + Type *ComponentGridType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Properties == nil { + return fmt.Errorf("required field properties missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"events", "id", "name", "properties", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Events = all.Events + o.Id = all.Id + o.Name = *all.Name + if all.Properties.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Properties = *all.Properties + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_component_grid_properties.go b/api/datadogV2/model_component_grid_properties.go new file mode 100644 index 00000000000..2184f8e0881 --- /dev/null +++ b/api/datadogV2/model_component_grid_properties.go @@ -0,0 +1,176 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentGridProperties The definition of `ComponentGridProperties` object. +type ComponentGridProperties struct { + // The `ComponentGridProperties` `backgroundColor`. + BackgroundColor *string `json:"backgroundColor,omitempty"` + // The `ComponentGridProperties` `children`. + Children []Component `json:"children,omitempty"` + // The definition of `ComponentGridPropertiesIsVisible` object. + IsVisible *ComponentGridPropertiesIsVisible `json:"isVisible,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewComponentGridProperties instantiates a new ComponentGridProperties object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewComponentGridProperties() *ComponentGridProperties { + this := ComponentGridProperties{} + var backgroundColor string = "default" + this.BackgroundColor = &backgroundColor + return &this +} + +// NewComponentGridPropertiesWithDefaults instantiates a new ComponentGridProperties object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewComponentGridPropertiesWithDefaults() *ComponentGridProperties { + this := ComponentGridProperties{} + var backgroundColor string = "default" + this.BackgroundColor = &backgroundColor + return &this +} + +// GetBackgroundColor returns the BackgroundColor field value if set, zero value otherwise. +func (o *ComponentGridProperties) GetBackgroundColor() string { + if o == nil || o.BackgroundColor == nil { + var ret string + return ret + } + return *o.BackgroundColor +} + +// GetBackgroundColorOk returns a tuple with the BackgroundColor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentGridProperties) GetBackgroundColorOk() (*string, bool) { + if o == nil || o.BackgroundColor == nil { + return nil, false + } + return o.BackgroundColor, true +} + +// HasBackgroundColor returns a boolean if a field has been set. +func (o *ComponentGridProperties) HasBackgroundColor() bool { + return o != nil && o.BackgroundColor != nil +} + +// SetBackgroundColor gets a reference to the given string and assigns it to the BackgroundColor field. +func (o *ComponentGridProperties) SetBackgroundColor(v string) { + o.BackgroundColor = &v +} + +// GetChildren returns the Children field value if set, zero value otherwise. +func (o *ComponentGridProperties) GetChildren() []Component { + if o == nil || o.Children == nil { + var ret []Component + return ret + } + return o.Children +} + +// GetChildrenOk returns a tuple with the Children field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentGridProperties) GetChildrenOk() (*[]Component, bool) { + if o == nil || o.Children == nil { + return nil, false + } + return &o.Children, true +} + +// HasChildren returns a boolean if a field has been set. +func (o *ComponentGridProperties) HasChildren() bool { + return o != nil && o.Children != nil +} + +// SetChildren gets a reference to the given []Component and assigns it to the Children field. +func (o *ComponentGridProperties) SetChildren(v []Component) { + o.Children = v +} + +// GetIsVisible returns the IsVisible field value if set, zero value otherwise. +func (o *ComponentGridProperties) GetIsVisible() ComponentGridPropertiesIsVisible { + if o == nil || o.IsVisible == nil { + var ret ComponentGridPropertiesIsVisible + return ret + } + return *o.IsVisible +} + +// GetIsVisibleOk returns a tuple with the IsVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentGridProperties) GetIsVisibleOk() (*ComponentGridPropertiesIsVisible, bool) { + if o == nil || o.IsVisible == nil { + return nil, false + } + return o.IsVisible, true +} + +// HasIsVisible returns a boolean if a field has been set. +func (o *ComponentGridProperties) HasIsVisible() bool { + return o != nil && o.IsVisible != nil +} + +// SetIsVisible gets a reference to the given ComponentGridPropertiesIsVisible and assigns it to the IsVisible field. +func (o *ComponentGridProperties) SetIsVisible(v ComponentGridPropertiesIsVisible) { + o.IsVisible = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ComponentGridProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.BackgroundColor != nil { + toSerialize["backgroundColor"] = o.BackgroundColor + } + if o.Children != nil { + toSerialize["children"] = o.Children + } + if o.IsVisible != nil { + toSerialize["isVisible"] = o.IsVisible + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ComponentGridProperties) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BackgroundColor *string `json:"backgroundColor,omitempty"` + Children []Component `json:"children,omitempty"` + IsVisible *ComponentGridPropertiesIsVisible `json:"isVisible,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"backgroundColor", "children", "isVisible"}) + } else { + return err + } + o.BackgroundColor = all.BackgroundColor + o.Children = all.Children + o.IsVisible = all.IsVisible + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_component_grid_properties_is_visible.go b/api/datadogV2/model_component_grid_properties_is_visible.go new file mode 100644 index 00000000000..2430219301a --- /dev/null +++ b/api/datadogV2/model_component_grid_properties_is_visible.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentGridPropertiesIsVisible - The definition of `ComponentGridPropertiesIsVisible` object. +type ComponentGridPropertiesIsVisible struct { + String *string + Bool *bool + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// StringAsComponentGridPropertiesIsVisible is a convenience function that returns string wrapped in ComponentGridPropertiesIsVisible. +func StringAsComponentGridPropertiesIsVisible(v *string) ComponentGridPropertiesIsVisible { + return ComponentGridPropertiesIsVisible{String: v} +} + +// BoolAsComponentGridPropertiesIsVisible is a convenience function that returns bool wrapped in ComponentGridPropertiesIsVisible. +func BoolAsComponentGridPropertiesIsVisible(v *bool) ComponentGridPropertiesIsVisible { + return ComponentGridPropertiesIsVisible{Bool: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ComponentGridPropertiesIsVisible) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.String = nil + obj.Bool = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ComponentGridPropertiesIsVisible) MarshalJSON() ([]byte, error) { + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ComponentGridPropertiesIsVisible) GetActualInstance() interface{} { + if obj.String != nil { + return obj.String + } + + if obj.Bool != nil { + return obj.Bool + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_component_grid_type.go b/api/datadogV2/model_component_grid_type.go new file mode 100644 index 00000000000..71c704646ec --- /dev/null +++ b/api/datadogV2/model_component_grid_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentGridType The definition of `ComponentGridType` object. +type ComponentGridType string + +// List of ComponentGridType. +const ( + COMPONENTGRIDTYPE_GRID ComponentGridType = "grid" +) + +var allowedComponentGridTypeEnumValues = []ComponentGridType{ + COMPONENTGRIDTYPE_GRID, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ComponentGridType) GetAllowedValues() []ComponentGridType { + return allowedComponentGridTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ComponentGridType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ComponentGridType(value) + return nil +} + +// NewComponentGridTypeFromValue returns a pointer to a valid ComponentGridType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewComponentGridTypeFromValue(v string) (*ComponentGridType, error) { + ev := ComponentGridType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ComponentGridType: valid values are %v", v, allowedComponentGridTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ComponentGridType) IsValid() bool { + for _, existing := range allowedComponentGridTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ComponentGridType value. +func (v ComponentGridType) Ptr() *ComponentGridType { + return &v +} diff --git a/api/datadogV2/model_component_properties.go b/api/datadogV2/model_component_properties.go new file mode 100644 index 00000000000..698fe9e6f48 --- /dev/null +++ b/api/datadogV2/model_component_properties.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentProperties The definition of `ComponentProperties` object. +type ComponentProperties struct { + // The `ComponentProperties` `children`. + Children []Component `json:"children,omitempty"` + // The definition of `ComponentPropertiesIsVisible` object. + IsVisible *ComponentPropertiesIsVisible `json:"isVisible,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewComponentProperties instantiates a new ComponentProperties object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewComponentProperties() *ComponentProperties { + this := ComponentProperties{} + return &this +} + +// NewComponentPropertiesWithDefaults instantiates a new ComponentProperties object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewComponentPropertiesWithDefaults() *ComponentProperties { + this := ComponentProperties{} + return &this +} + +// GetChildren returns the Children field value if set, zero value otherwise. +func (o *ComponentProperties) GetChildren() []Component { + if o == nil || o.Children == nil { + var ret []Component + return ret + } + return o.Children +} + +// GetChildrenOk returns a tuple with the Children field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentProperties) GetChildrenOk() (*[]Component, bool) { + if o == nil || o.Children == nil { + return nil, false + } + return &o.Children, true +} + +// HasChildren returns a boolean if a field has been set. +func (o *ComponentProperties) HasChildren() bool { + return o != nil && o.Children != nil +} + +// SetChildren gets a reference to the given []Component and assigns it to the Children field. +func (o *ComponentProperties) SetChildren(v []Component) { + o.Children = v +} + +// GetIsVisible returns the IsVisible field value if set, zero value otherwise. +func (o *ComponentProperties) GetIsVisible() ComponentPropertiesIsVisible { + if o == nil || o.IsVisible == nil { + var ret ComponentPropertiesIsVisible + return ret + } + return *o.IsVisible +} + +// GetIsVisibleOk returns a tuple with the IsVisible field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComponentProperties) GetIsVisibleOk() (*ComponentPropertiesIsVisible, bool) { + if o == nil || o.IsVisible == nil { + return nil, false + } + return o.IsVisible, true +} + +// HasIsVisible returns a boolean if a field has been set. +func (o *ComponentProperties) HasIsVisible() bool { + return o != nil && o.IsVisible != nil +} + +// SetIsVisible gets a reference to the given ComponentPropertiesIsVisible and assigns it to the IsVisible field. +func (o *ComponentProperties) SetIsVisible(v ComponentPropertiesIsVisible) { + o.IsVisible = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ComponentProperties) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Children != nil { + toSerialize["children"] = o.Children + } + if o.IsVisible != nil { + toSerialize["isVisible"] = o.IsVisible + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ComponentProperties) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Children []Component `json:"children,omitempty"` + IsVisible *ComponentPropertiesIsVisible `json:"isVisible,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"children", "isVisible"}) + } else { + return err + } + o.Children = all.Children + o.IsVisible = all.IsVisible + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_component_properties_is_visible.go b/api/datadogV2/model_component_properties_is_visible.go new file mode 100644 index 00000000000..5cc7b416c17 --- /dev/null +++ b/api/datadogV2/model_component_properties_is_visible.go @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentPropertiesIsVisible - The definition of `ComponentPropertiesIsVisible` object. +type ComponentPropertiesIsVisible struct { + Bool *bool + String *string + + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject interface{} +} + +// BoolAsComponentPropertiesIsVisible is a convenience function that returns bool wrapped in ComponentPropertiesIsVisible. +func BoolAsComponentPropertiesIsVisible(v *bool) ComponentPropertiesIsVisible { + return ComponentPropertiesIsVisible{Bool: v} +} + +// StringAsComponentPropertiesIsVisible is a convenience function that returns string wrapped in ComponentPropertiesIsVisible. +func StringAsComponentPropertiesIsVisible(v *string) ComponentPropertiesIsVisible { + return ComponentPropertiesIsVisible{String: v} +} + +// UnmarshalJSON turns data into one of the pointers in the struct. +func (obj *ComponentPropertiesIsVisible) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Bool + err = datadog.Unmarshal(data, &obj.Bool) + if err == nil { + if obj.Bool != nil { + jsonBool, _ := datadog.Marshal(obj.Bool) + if string(jsonBool) == "{}" { // empty struct + obj.Bool = nil + } else { + match++ + } + } else { + obj.Bool = nil + } + } else { + obj.Bool = nil + } + + // try to unmarshal data into String + err = datadog.Unmarshal(data, &obj.String) + if err == nil { + if obj.String != nil { + jsonString, _ := datadog.Marshal(obj.String) + if string(jsonString) == "{}" { // empty struct + obj.String = nil + } else { + match++ + } + } else { + obj.String = nil + } + } else { + obj.String = nil + } + + if match != 1 { // more than 1 match + // reset to nil + obj.Bool = nil + obj.String = nil + return datadog.Unmarshal(data, &obj.UnparsedObject) + } + return nil // exactly one match +} + +// MarshalJSON turns data from the first non-nil pointers in the struct to JSON. +func (obj ComponentPropertiesIsVisible) MarshalJSON() ([]byte, error) { + if obj.Bool != nil { + return datadog.Marshal(&obj.Bool) + } + + if obj.String != nil { + return datadog.Marshal(&obj.String) + } + + if obj.UnparsedObject != nil { + return datadog.Marshal(obj.UnparsedObject) + } + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns the actual instance. +func (obj *ComponentPropertiesIsVisible) GetActualInstance() interface{} { + if obj.Bool != nil { + return obj.Bool + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} diff --git a/api/datadogV2/model_component_type.go b/api/datadogV2/model_component_type.go new file mode 100644 index 00000000000..858d5cce9ba --- /dev/null +++ b/api/datadogV2/model_component_type.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ComponentType The definition of `ComponentType` object. +type ComponentType string + +// List of ComponentType. +const ( + COMPONENTTYPE_TABLE ComponentType = "table" + COMPONENTTYPE_TEXTINPUT ComponentType = "textInput" + COMPONENTTYPE_TEXTAREA ComponentType = "textArea" + COMPONENTTYPE_BUTTON ComponentType = "button" + COMPONENTTYPE_TEXT ComponentType = "text" + COMPONENTTYPE_SELECT ComponentType = "select" + COMPONENTTYPE_MODAL ComponentType = "modal" + COMPONENTTYPE_SCHEMAFORM ComponentType = "schemaForm" + COMPONENTTYPE_CHECKBOX ComponentType = "checkbox" + COMPONENTTYPE_TABS ComponentType = "tabs" + COMPONENTTYPE_VEGACHART ComponentType = "vegaChart" + COMPONENTTYPE_RADIOBUTTONS ComponentType = "radioButtons" + COMPONENTTYPE_NUMBERINPUT ComponentType = "numberInput" + COMPONENTTYPE_FILEINPUT ComponentType = "fileInput" + COMPONENTTYPE_JSONINPUT ComponentType = "jsonInput" + COMPONENTTYPE_GRIDCELL ComponentType = "gridCell" + COMPONENTTYPE_DATERANGEPICKER ComponentType = "dateRangePicker" + COMPONENTTYPE_SEARCH ComponentType = "search" + COMPONENTTYPE_CONTAINER ComponentType = "container" + COMPONENTTYPE_CALLOUTVALUE ComponentType = "calloutValue" +) + +var allowedComponentTypeEnumValues = []ComponentType{ + COMPONENTTYPE_TABLE, + COMPONENTTYPE_TEXTINPUT, + COMPONENTTYPE_TEXTAREA, + COMPONENTTYPE_BUTTON, + COMPONENTTYPE_TEXT, + COMPONENTTYPE_SELECT, + COMPONENTTYPE_MODAL, + COMPONENTTYPE_SCHEMAFORM, + COMPONENTTYPE_CHECKBOX, + COMPONENTTYPE_TABS, + COMPONENTTYPE_VEGACHART, + COMPONENTTYPE_RADIOBUTTONS, + COMPONENTTYPE_NUMBERINPUT, + COMPONENTTYPE_FILEINPUT, + COMPONENTTYPE_JSONINPUT, + COMPONENTTYPE_GRIDCELL, + COMPONENTTYPE_DATERANGEPICKER, + COMPONENTTYPE_SEARCH, + COMPONENTTYPE_CONTAINER, + COMPONENTTYPE_CALLOUTVALUE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ComponentType) GetAllowedValues() []ComponentType { + return allowedComponentTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ComponentType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ComponentType(value) + return nil +} + +// NewComponentTypeFromValue returns a pointer to a valid ComponentType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewComponentTypeFromValue(v string) (*ComponentType, error) { + ev := ComponentType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ComponentType: valid values are %v", v, allowedComponentTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ComponentType) IsValid() bool { + for _, existing := range allowedComponentTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ComponentType value. +func (v ComponentType) Ptr() *ComponentType { + return &v +} diff --git a/api/datadogV2/model_create_app_request.go b/api/datadogV2/model_create_app_request.go new file mode 100644 index 00000000000..c58c2d161a0 --- /dev/null +++ b/api/datadogV2/model_create_app_request.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppRequest The definition of `CreateAppRequest` object. +type CreateAppRequest struct { + // The definition of `CreateAppRequestData` object. + Data *CreateAppRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreateAppRequest instantiates a new CreateAppRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreateAppRequest() *CreateAppRequest { + this := CreateAppRequest{} + return &this +} + +// NewCreateAppRequestWithDefaults instantiates a new CreateAppRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreateAppRequestWithDefaults() *CreateAppRequest { + this := CreateAppRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CreateAppRequest) GetData() CreateAppRequestData { + if o == nil || o.Data == nil { + var ret CreateAppRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequest) GetDataOk() (*CreateAppRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CreateAppRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CreateAppRequestData and assigns it to the Data field. +func (o *CreateAppRequest) SetData(v CreateAppRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreateAppRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreateAppRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CreateAppRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_app_request_data.go b/api/datadogV2/model_create_app_request_data.go new file mode 100644 index 00000000000..6833a45aa0b --- /dev/null +++ b/api/datadogV2/model_create_app_request_data.go @@ -0,0 +1,151 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppRequestData The definition of `CreateAppRequestData` object. +type CreateAppRequestData struct { + // The definition of `CreateAppRequestDataAttributes` object. + Attributes *CreateAppRequestDataAttributes `json:"attributes,omitempty"` + // The definition of `CreateAppRequestDataType` object. + Type CreateAppRequestDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreateAppRequestData instantiates a new CreateAppRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreateAppRequestData(typeVar CreateAppRequestDataType) *CreateAppRequestData { + this := CreateAppRequestData{} + this.Type = typeVar + return &this +} + +// NewCreateAppRequestDataWithDefaults instantiates a new CreateAppRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreateAppRequestDataWithDefaults() *CreateAppRequestData { + this := CreateAppRequestData{} + var typeVar CreateAppRequestDataType = CREATEAPPREQUESTDATATYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CreateAppRequestData) GetAttributes() CreateAppRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret CreateAppRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestData) GetAttributesOk() (*CreateAppRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CreateAppRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CreateAppRequestDataAttributes and assigns it to the Attributes field. +func (o *CreateAppRequestData) SetAttributes(v CreateAppRequestDataAttributes) { + o.Attributes = &v +} + +// GetType returns the Type field value. +func (o *CreateAppRequestData) GetType() CreateAppRequestDataType { + if o == nil { + var ret CreateAppRequestDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CreateAppRequestData) GetTypeOk() (*CreateAppRequestDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CreateAppRequestData) SetType(v CreateAppRequestDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreateAppRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreateAppRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CreateAppRequestDataAttributes `json:"attributes,omitempty"` + Type *CreateAppRequestDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_app_request_data_attributes.go b/api/datadogV2/model_create_app_request_data_attributes.go new file mode 100644 index 00000000000..de5264e085f --- /dev/null +++ b/api/datadogV2/model_create_app_request_data_attributes.go @@ -0,0 +1,356 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppRequestDataAttributes The definition of `CreateAppRequestDataAttributes` object. +type CreateAppRequestDataAttributes struct { + // The `attributes` `components`. + Components []ComponentGrid `json:"components,omitempty"` + // The `attributes` `description`. + Description *string `json:"description,omitempty"` + // The `attributes` `embeddedQueries`. + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + // The definition of `InputSchema` object. + InputSchema *InputSchema `json:"inputSchema,omitempty"` + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `rootInstanceName`. + RootInstanceName *string `json:"rootInstanceName,omitempty"` + // The `attributes` `scripts`. + Scripts []Script `json:"scripts,omitempty"` + // The `attributes` `tags`. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreateAppRequestDataAttributes instantiates a new CreateAppRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreateAppRequestDataAttributes() *CreateAppRequestDataAttributes { + this := CreateAppRequestDataAttributes{} + return &this +} + +// NewCreateAppRequestDataAttributesWithDefaults instantiates a new CreateAppRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreateAppRequestDataAttributesWithDefaults() *CreateAppRequestDataAttributes { + this := CreateAppRequestDataAttributes{} + return &this +} + +// GetComponents returns the Components field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetComponents() []ComponentGrid { + if o == nil || o.Components == nil { + var ret []ComponentGrid + return ret + } + return o.Components +} + +// GetComponentsOk returns a tuple with the Components field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetComponentsOk() (*[]ComponentGrid, bool) { + if o == nil || o.Components == nil { + return nil, false + } + return &o.Components, true +} + +// HasComponents returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasComponents() bool { + return o != nil && o.Components != nil +} + +// SetComponents gets a reference to the given []ComponentGrid and assigns it to the Components field. +func (o *CreateAppRequestDataAttributes) SetComponents(v []ComponentGrid) { + o.Components = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateAppRequestDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEmbeddedQueries returns the EmbeddedQueries field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetEmbeddedQueries() []Query { + if o == nil || o.EmbeddedQueries == nil { + var ret []Query + return ret + } + return o.EmbeddedQueries +} + +// GetEmbeddedQueriesOk returns a tuple with the EmbeddedQueries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetEmbeddedQueriesOk() (*[]Query, bool) { + if o == nil || o.EmbeddedQueries == nil { + return nil, false + } + return &o.EmbeddedQueries, true +} + +// HasEmbeddedQueries returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasEmbeddedQueries() bool { + return o != nil && o.EmbeddedQueries != nil +} + +// SetEmbeddedQueries gets a reference to the given []Query and assigns it to the EmbeddedQueries field. +func (o *CreateAppRequestDataAttributes) SetEmbeddedQueries(v []Query) { + o.EmbeddedQueries = v +} + +// GetInputSchema returns the InputSchema field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetInputSchema() InputSchema { + if o == nil || o.InputSchema == nil { + var ret InputSchema + return ret + } + return *o.InputSchema +} + +// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { + if o == nil || o.InputSchema == nil { + return nil, false + } + return o.InputSchema, true +} + +// HasInputSchema returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasInputSchema() bool { + return o != nil && o.InputSchema != nil +} + +// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. +func (o *CreateAppRequestDataAttributes) SetInputSchema(v InputSchema) { + o.InputSchema = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateAppRequestDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetRootInstanceName returns the RootInstanceName field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetRootInstanceName() string { + if o == nil || o.RootInstanceName == nil { + var ret string + return ret + } + return *o.RootInstanceName +} + +// GetRootInstanceNameOk returns a tuple with the RootInstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetRootInstanceNameOk() (*string, bool) { + if o == nil || o.RootInstanceName == nil { + return nil, false + } + return o.RootInstanceName, true +} + +// HasRootInstanceName returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasRootInstanceName() bool { + return o != nil && o.RootInstanceName != nil +} + +// SetRootInstanceName gets a reference to the given string and assigns it to the RootInstanceName field. +func (o *CreateAppRequestDataAttributes) SetRootInstanceName(v string) { + o.RootInstanceName = &v +} + +// GetScripts returns the Scripts field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetScripts() []Script { + if o == nil || o.Scripts == nil { + var ret []Script + return ret + } + return o.Scripts +} + +// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetScriptsOk() (*[]Script, bool) { + if o == nil || o.Scripts == nil { + return nil, false + } + return &o.Scripts, true +} + +// HasScripts returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasScripts() bool { + return o != nil && o.Scripts != nil +} + +// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. +func (o *CreateAppRequestDataAttributes) SetScripts(v []Script) { + o.Scripts = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *CreateAppRequestDataAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppRequestDataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *CreateAppRequestDataAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *CreateAppRequestDataAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreateAppRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Components != nil { + toSerialize["components"] = o.Components + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.EmbeddedQueries != nil { + toSerialize["embeddedQueries"] = o.EmbeddedQueries + } + if o.InputSchema != nil { + toSerialize["inputSchema"] = o.InputSchema + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.RootInstanceName != nil { + toSerialize["rootInstanceName"] = o.RootInstanceName + } + if o.Scripts != nil { + toSerialize["scripts"] = o.Scripts + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreateAppRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Components []ComponentGrid `json:"components,omitempty"` + Description *string `json:"description,omitempty"` + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + InputSchema *InputSchema `json:"inputSchema,omitempty"` + Name *string `json:"name,omitempty"` + RootInstanceName *string `json:"rootInstanceName,omitempty"` + Scripts []Script `json:"scripts,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + } else { + return err + } + + hasInvalidField := false + o.Components = all.Components + o.Description = all.Description + o.EmbeddedQueries = all.EmbeddedQueries + if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.InputSchema = all.InputSchema + o.Name = all.Name + o.RootInstanceName = all.RootInstanceName + o.Scripts = all.Scripts + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_app_request_data_type.go b/api/datadogV2/model_create_app_request_data_type.go new file mode 100644 index 00000000000..bd767d6429f --- /dev/null +++ b/api/datadogV2/model_create_app_request_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppRequestDataType The definition of `CreateAppRequestDataType` object. +type CreateAppRequestDataType string + +// List of CreateAppRequestDataType. +const ( + CREATEAPPREQUESTDATATYPE_APPDEFINITIONS CreateAppRequestDataType = "appDefinitions" +) + +var allowedCreateAppRequestDataTypeEnumValues = []CreateAppRequestDataType{ + CREATEAPPREQUESTDATATYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CreateAppRequestDataType) GetAllowedValues() []CreateAppRequestDataType { + return allowedCreateAppRequestDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CreateAppRequestDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CreateAppRequestDataType(value) + return nil +} + +// NewCreateAppRequestDataTypeFromValue returns a pointer to a valid CreateAppRequestDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCreateAppRequestDataTypeFromValue(v string) (*CreateAppRequestDataType, error) { + ev := CreateAppRequestDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CreateAppRequestDataType: valid values are %v", v, allowedCreateAppRequestDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CreateAppRequestDataType) IsValid() bool { + for _, existing := range allowedCreateAppRequestDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateAppRequestDataType value. +func (v CreateAppRequestDataType) Ptr() *CreateAppRequestDataType { + return &v +} diff --git a/api/datadogV2/model_create_app_response.go b/api/datadogV2/model_create_app_response.go new file mode 100644 index 00000000000..47777dd67a5 --- /dev/null +++ b/api/datadogV2/model_create_app_response.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppResponse The definition of `CreateAppResponse` object. +type CreateAppResponse struct { + // The definition of `CreateAppResponseData` object. + Data *CreateAppResponseData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreateAppResponse instantiates a new CreateAppResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreateAppResponse() *CreateAppResponse { + this := CreateAppResponse{} + return &this +} + +// NewCreateAppResponseWithDefaults instantiates a new CreateAppResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreateAppResponseWithDefaults() *CreateAppResponse { + this := CreateAppResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CreateAppResponse) GetData() CreateAppResponseData { + if o == nil || o.Data == nil { + var ret CreateAppResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAppResponse) GetDataOk() (*CreateAppResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CreateAppResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CreateAppResponseData and assigns it to the Data field. +func (o *CreateAppResponse) SetData(v CreateAppResponseData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreateAppResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreateAppResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CreateAppResponseData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_app_response_data.go b/api/datadogV2/model_create_app_response_data.go new file mode 100644 index 00000000000..a212c0315df --- /dev/null +++ b/api/datadogV2/model_create_app_response_data.go @@ -0,0 +1,145 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppResponseData The definition of `CreateAppResponseData` object. +type CreateAppResponseData struct { + // The `data` `id`. + Id string `json:"id"` + // The definition of `CreateAppResponseDataType` object. + Type CreateAppResponseDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCreateAppResponseData instantiates a new CreateAppResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCreateAppResponseData(id string, typeVar CreateAppResponseDataType) *CreateAppResponseData { + this := CreateAppResponseData{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewCreateAppResponseDataWithDefaults instantiates a new CreateAppResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCreateAppResponseDataWithDefaults() *CreateAppResponseData { + this := CreateAppResponseData{} + var typeVar CreateAppResponseDataType = CREATEAPPRESPONSEDATATYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *CreateAppResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CreateAppResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CreateAppResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CreateAppResponseData) GetType() CreateAppResponseDataType { + if o == nil { + var ret CreateAppResponseDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CreateAppResponseData) GetTypeOk() (*CreateAppResponseDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CreateAppResponseData) SetType(v CreateAppResponseDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CreateAppResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CreateAppResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *CreateAppResponseDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_create_app_response_data_type.go b/api/datadogV2/model_create_app_response_data_type.go new file mode 100644 index 00000000000..7501610a621 --- /dev/null +++ b/api/datadogV2/model_create_app_response_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CreateAppResponseDataType The definition of `CreateAppResponseDataType` object. +type CreateAppResponseDataType string + +// List of CreateAppResponseDataType. +const ( + CREATEAPPRESPONSEDATATYPE_APPDEFINITIONS CreateAppResponseDataType = "appDefinitions" +) + +var allowedCreateAppResponseDataTypeEnumValues = []CreateAppResponseDataType{ + CREATEAPPRESPONSEDATATYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CreateAppResponseDataType) GetAllowedValues() []CreateAppResponseDataType { + return allowedCreateAppResponseDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CreateAppResponseDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CreateAppResponseDataType(value) + return nil +} + +// NewCreateAppResponseDataTypeFromValue returns a pointer to a valid CreateAppResponseDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCreateAppResponseDataTypeFromValue(v string) (*CreateAppResponseDataType, error) { + ev := CreateAppResponseDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CreateAppResponseDataType: valid values are %v", v, allowedCreateAppResponseDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CreateAppResponseDataType) IsValid() bool { + for _, existing := range allowedCreateAppResponseDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CreateAppResponseDataType value. +func (v CreateAppResponseDataType) Ptr() *CreateAppResponseDataType { + return &v +} diff --git a/api/datadogV2/model_custom_connection.go b/api/datadogV2/model_custom_connection.go new file mode 100644 index 00000000000..e4cc8730299 --- /dev/null +++ b/api/datadogV2/model_custom_connection.go @@ -0,0 +1,189 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomConnection The definition of `CustomConnection` object. +type CustomConnection struct { + // The definition of `CustomConnectionAttributes` object. + Attributes *CustomConnectionAttributes `json:"attributes,omitempty"` + // The `CustomConnection` `id`. + Id *string `json:"id,omitempty"` + // The definition of `CustomConnectionType` object. + Type *CustomConnectionType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomConnection instantiates a new CustomConnection object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomConnection() *CustomConnection { + this := CustomConnection{} + var typeVar CustomConnectionType = CUSTOMCONNECTIONTYPE_CUSTOM_CONNECTIONS + this.Type = &typeVar + return &this +} + +// NewCustomConnectionWithDefaults instantiates a new CustomConnection object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomConnectionWithDefaults() *CustomConnection { + this := CustomConnection{} + var typeVar CustomConnectionType = CUSTOMCONNECTIONTYPE_CUSTOM_CONNECTIONS + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CustomConnection) GetAttributes() CustomConnectionAttributes { + if o == nil || o.Attributes == nil { + var ret CustomConnectionAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnection) GetAttributesOk() (*CustomConnectionAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CustomConnection) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CustomConnectionAttributes and assigns it to the Attributes field. +func (o *CustomConnection) SetAttributes(v CustomConnectionAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CustomConnection) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnection) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CustomConnection) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CustomConnection) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CustomConnection) GetType() CustomConnectionType { + if o == nil || o.Type == nil { + var ret CustomConnectionType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnection) GetTypeOk() (*CustomConnectionType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CustomConnection) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CustomConnectionType and assigns it to the Type field. +func (o *CustomConnection) SetType(v CustomConnectionType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomConnection) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomConnection) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomConnectionAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CustomConnectionType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_connection_attributes.go b/api/datadogV2/model_custom_connection_attributes.go new file mode 100644 index 00000000000..46e1b9ba2a6 --- /dev/null +++ b/api/datadogV2/model_custom_connection_attributes.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomConnectionAttributes The definition of `CustomConnectionAttributes` object. +type CustomConnectionAttributes struct { + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The definition of `CustomConnectionAttributesOnPremRunner` object. + OnPremRunner *CustomConnectionAttributesOnPremRunner `json:"onPremRunner,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomConnectionAttributes instantiates a new CustomConnectionAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomConnectionAttributes() *CustomConnectionAttributes { + this := CustomConnectionAttributes{} + return &this +} + +// NewCustomConnectionAttributesWithDefaults instantiates a new CustomConnectionAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomConnectionAttributesWithDefaults() *CustomConnectionAttributes { + this := CustomConnectionAttributes{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CustomConnectionAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnectionAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CustomConnectionAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CustomConnectionAttributes) SetName(v string) { + o.Name = &v +} + +// GetOnPremRunner returns the OnPremRunner field value if set, zero value otherwise. +func (o *CustomConnectionAttributes) GetOnPremRunner() CustomConnectionAttributesOnPremRunner { + if o == nil || o.OnPremRunner == nil { + var ret CustomConnectionAttributesOnPremRunner + return ret + } + return *o.OnPremRunner +} + +// GetOnPremRunnerOk returns a tuple with the OnPremRunner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnectionAttributes) GetOnPremRunnerOk() (*CustomConnectionAttributesOnPremRunner, bool) { + if o == nil || o.OnPremRunner == nil { + return nil, false + } + return o.OnPremRunner, true +} + +// HasOnPremRunner returns a boolean if a field has been set. +func (o *CustomConnectionAttributes) HasOnPremRunner() bool { + return o != nil && o.OnPremRunner != nil +} + +// SetOnPremRunner gets a reference to the given CustomConnectionAttributesOnPremRunner and assigns it to the OnPremRunner field. +func (o *CustomConnectionAttributes) SetOnPremRunner(v CustomConnectionAttributesOnPremRunner) { + o.OnPremRunner = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomConnectionAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.OnPremRunner != nil { + toSerialize["onPremRunner"] = o.OnPremRunner + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomConnectionAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + OnPremRunner *CustomConnectionAttributesOnPremRunner `json:"onPremRunner,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "onPremRunner"}) + } else { + return err + } + + hasInvalidField := false + o.Name = all.Name + if all.OnPremRunner != nil && all.OnPremRunner.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.OnPremRunner = all.OnPremRunner + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go b/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go new file mode 100644 index 00000000000..a8eea47e12a --- /dev/null +++ b/api/datadogV2/model_custom_connection_attributes_on_prem_runner.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomConnectionAttributesOnPremRunner The definition of `CustomConnectionAttributesOnPremRunner` object. +type CustomConnectionAttributesOnPremRunner struct { + // The `onPremRunner` `id`. + Id *string `json:"id,omitempty"` + // The `onPremRunner` `url`. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomConnectionAttributesOnPremRunner instantiates a new CustomConnectionAttributesOnPremRunner object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomConnectionAttributesOnPremRunner() *CustomConnectionAttributesOnPremRunner { + this := CustomConnectionAttributesOnPremRunner{} + return &this +} + +// NewCustomConnectionAttributesOnPremRunnerWithDefaults instantiates a new CustomConnectionAttributesOnPremRunner object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomConnectionAttributesOnPremRunnerWithDefaults() *CustomConnectionAttributesOnPremRunner { + this := CustomConnectionAttributesOnPremRunner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CustomConnectionAttributesOnPremRunner) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnectionAttributesOnPremRunner) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CustomConnectionAttributesOnPremRunner) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CustomConnectionAttributesOnPremRunner) SetId(v string) { + o.Id = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *CustomConnectionAttributesOnPremRunner) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomConnectionAttributesOnPremRunner) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *CustomConnectionAttributesOnPremRunner) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *CustomConnectionAttributesOnPremRunner) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomConnectionAttributesOnPremRunner) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomConnectionAttributesOnPremRunner) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "url"}) + } else { + return err + } + o.Id = all.Id + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_connection_type.go b/api/datadogV2/model_custom_connection_type.go new file mode 100644 index 00000000000..ce42ce033aa --- /dev/null +++ b/api/datadogV2/model_custom_connection_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomConnectionType The definition of `CustomConnectionType` object. +type CustomConnectionType string + +// List of CustomConnectionType. +const ( + CUSTOMCONNECTIONTYPE_CUSTOM_CONNECTIONS CustomConnectionType = "custom_connections" +) + +var allowedCustomConnectionTypeEnumValues = []CustomConnectionType{ + CUSTOMCONNECTIONTYPE_CUSTOM_CONNECTIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CustomConnectionType) GetAllowedValues() []CustomConnectionType { + return allowedCustomConnectionTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CustomConnectionType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CustomConnectionType(value) + return nil +} + +// NewCustomConnectionTypeFromValue returns a pointer to a valid CustomConnectionType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCustomConnectionTypeFromValue(v string) (*CustomConnectionType, error) { + ev := CustomConnectionType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CustomConnectionType: valid values are %v", v, allowedCustomConnectionTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CustomConnectionType) IsValid() bool { + for _, existing := range allowedCustomConnectionTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomConnectionType value. +func (v CustomConnectionType) Ptr() *CustomConnectionType { + return &v +} diff --git a/api/datadogV2/model_delete_app_response.go b/api/datadogV2/model_delete_app_response.go new file mode 100644 index 00000000000..5462fc55ca8 --- /dev/null +++ b/api/datadogV2/model_delete_app_response.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppResponse The definition of `DeleteAppResponse` object. +type DeleteAppResponse struct { + // The definition of `DeleteAppResponseData` object. + Data *DeleteAppResponseData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeleteAppResponse instantiates a new DeleteAppResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeleteAppResponse() *DeleteAppResponse { + this := DeleteAppResponse{} + return &this +} + +// NewDeleteAppResponseWithDefaults instantiates a new DeleteAppResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeleteAppResponseWithDefaults() *DeleteAppResponse { + this := DeleteAppResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DeleteAppResponse) GetData() DeleteAppResponseData { + if o == nil || o.Data == nil { + var ret DeleteAppResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteAppResponse) GetDataOk() (*DeleteAppResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DeleteAppResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given DeleteAppResponseData and assigns it to the Data field. +func (o *DeleteAppResponse) SetData(v DeleteAppResponseData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeleteAppResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeleteAppResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *DeleteAppResponseData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_delete_app_response_data.go b/api/datadogV2/model_delete_app_response_data.go new file mode 100644 index 00000000000..d5b8d561d30 --- /dev/null +++ b/api/datadogV2/model_delete_app_response_data.go @@ -0,0 +1,145 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppResponseData The definition of `DeleteAppResponseData` object. +type DeleteAppResponseData struct { + // The `data` `id`. + Id string `json:"id"` + // The definition of `DeleteAppResponseDataType` object. + Type DeleteAppResponseDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeleteAppResponseData instantiates a new DeleteAppResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeleteAppResponseData(id string, typeVar DeleteAppResponseDataType) *DeleteAppResponseData { + this := DeleteAppResponseData{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewDeleteAppResponseDataWithDefaults instantiates a new DeleteAppResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeleteAppResponseDataWithDefaults() *DeleteAppResponseData { + this := DeleteAppResponseData{} + var typeVar DeleteAppResponseDataType = DELETEAPPRESPONSEDATATYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *DeleteAppResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeleteAppResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *DeleteAppResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *DeleteAppResponseData) GetType() DeleteAppResponseDataType { + if o == nil { + var ret DeleteAppResponseDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DeleteAppResponseData) GetTypeOk() (*DeleteAppResponseDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *DeleteAppResponseData) SetType(v DeleteAppResponseDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeleteAppResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeleteAppResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *DeleteAppResponseDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_delete_app_response_data_type.go b/api/datadogV2/model_delete_app_response_data_type.go new file mode 100644 index 00000000000..365392b8b72 --- /dev/null +++ b/api/datadogV2/model_delete_app_response_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppResponseDataType The definition of `DeleteAppResponseDataType` object. +type DeleteAppResponseDataType string + +// List of DeleteAppResponseDataType. +const ( + DELETEAPPRESPONSEDATATYPE_APPDEFINITIONS DeleteAppResponseDataType = "appDefinitions" +) + +var allowedDeleteAppResponseDataTypeEnumValues = []DeleteAppResponseDataType{ + DELETEAPPRESPONSEDATATYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DeleteAppResponseDataType) GetAllowedValues() []DeleteAppResponseDataType { + return allowedDeleteAppResponseDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DeleteAppResponseDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DeleteAppResponseDataType(value) + return nil +} + +// NewDeleteAppResponseDataTypeFromValue returns a pointer to a valid DeleteAppResponseDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDeleteAppResponseDataTypeFromValue(v string) (*DeleteAppResponseDataType, error) { + ev := DeleteAppResponseDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DeleteAppResponseDataType: valid values are %v", v, allowedDeleteAppResponseDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DeleteAppResponseDataType) IsValid() bool { + for _, existing := range allowedDeleteAppResponseDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteAppResponseDataType value. +func (v DeleteAppResponseDataType) Ptr() *DeleteAppResponseDataType { + return &v +} diff --git a/api/datadogV2/model_delete_apps_request.go b/api/datadogV2/model_delete_apps_request.go new file mode 100644 index 00000000000..733f3ae23a1 --- /dev/null +++ b/api/datadogV2/model_delete_apps_request.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppsRequest The definition of `DeleteAppsRequest` object. +type DeleteAppsRequest struct { + // The `DeleteAppsRequest` `data`. + Data []DeleteAppsRequestDataItems `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeleteAppsRequest instantiates a new DeleteAppsRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeleteAppsRequest() *DeleteAppsRequest { + this := DeleteAppsRequest{} + return &this +} + +// NewDeleteAppsRequestWithDefaults instantiates a new DeleteAppsRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeleteAppsRequestWithDefaults() *DeleteAppsRequest { + this := DeleteAppsRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DeleteAppsRequest) GetData() []DeleteAppsRequestDataItems { + if o == nil || o.Data == nil { + var ret []DeleteAppsRequestDataItems + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteAppsRequest) GetDataOk() (*[]DeleteAppsRequestDataItems, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DeleteAppsRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []DeleteAppsRequestDataItems and assigns it to the Data field. +func (o *DeleteAppsRequest) SetData(v []DeleteAppsRequestDataItems) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeleteAppsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeleteAppsRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []DeleteAppsRequestDataItems `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_delete_apps_request_data_items.go b/api/datadogV2/model_delete_apps_request_data_items.go new file mode 100644 index 00000000000..c34a1bf5454 --- /dev/null +++ b/api/datadogV2/model_delete_apps_request_data_items.go @@ -0,0 +1,145 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppsRequestDataItems The definition of `DeleteAppsRequestDataItems` object. +type DeleteAppsRequestDataItems struct { + // The `items` `id`. + Id string `json:"id"` + // The definition of `DeleteAppsRequestDataItemsType` object. + Type DeleteAppsRequestDataItemsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeleteAppsRequestDataItems instantiates a new DeleteAppsRequestDataItems object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeleteAppsRequestDataItems(id string, typeVar DeleteAppsRequestDataItemsType) *DeleteAppsRequestDataItems { + this := DeleteAppsRequestDataItems{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewDeleteAppsRequestDataItemsWithDefaults instantiates a new DeleteAppsRequestDataItems object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeleteAppsRequestDataItemsWithDefaults() *DeleteAppsRequestDataItems { + this := DeleteAppsRequestDataItems{} + var typeVar DeleteAppsRequestDataItemsType = DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *DeleteAppsRequestDataItems) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeleteAppsRequestDataItems) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *DeleteAppsRequestDataItems) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *DeleteAppsRequestDataItems) GetType() DeleteAppsRequestDataItemsType { + if o == nil { + var ret DeleteAppsRequestDataItemsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DeleteAppsRequestDataItems) GetTypeOk() (*DeleteAppsRequestDataItemsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *DeleteAppsRequestDataItems) SetType(v DeleteAppsRequestDataItemsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeleteAppsRequestDataItems) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeleteAppsRequestDataItems) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *DeleteAppsRequestDataItemsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_delete_apps_request_data_items_type.go b/api/datadogV2/model_delete_apps_request_data_items_type.go new file mode 100644 index 00000000000..63327e4ee58 --- /dev/null +++ b/api/datadogV2/model_delete_apps_request_data_items_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppsRequestDataItemsType The definition of `DeleteAppsRequestDataItemsType` object. +type DeleteAppsRequestDataItemsType string + +// List of DeleteAppsRequestDataItemsType. +const ( + DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS DeleteAppsRequestDataItemsType = "appDefinitions" +) + +var allowedDeleteAppsRequestDataItemsTypeEnumValues = []DeleteAppsRequestDataItemsType{ + DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DeleteAppsRequestDataItemsType) GetAllowedValues() []DeleteAppsRequestDataItemsType { + return allowedDeleteAppsRequestDataItemsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DeleteAppsRequestDataItemsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DeleteAppsRequestDataItemsType(value) + return nil +} + +// NewDeleteAppsRequestDataItemsTypeFromValue returns a pointer to a valid DeleteAppsRequestDataItemsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDeleteAppsRequestDataItemsTypeFromValue(v string) (*DeleteAppsRequestDataItemsType, error) { + ev := DeleteAppsRequestDataItemsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DeleteAppsRequestDataItemsType: valid values are %v", v, allowedDeleteAppsRequestDataItemsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DeleteAppsRequestDataItemsType) IsValid() bool { + for _, existing := range allowedDeleteAppsRequestDataItemsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteAppsRequestDataItemsType value. +func (v DeleteAppsRequestDataItemsType) Ptr() *DeleteAppsRequestDataItemsType { + return &v +} diff --git a/api/datadogV2/model_delete_apps_response.go b/api/datadogV2/model_delete_apps_response.go new file mode 100644 index 00000000000..be06445fa66 --- /dev/null +++ b/api/datadogV2/model_delete_apps_response.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppsResponse The definition of `DeleteAppsResponse` object. +type DeleteAppsResponse struct { + // The `DeleteAppsResponse` `data`. + Data []DeleteAppsResponseDataItems `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeleteAppsResponse instantiates a new DeleteAppsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeleteAppsResponse() *DeleteAppsResponse { + this := DeleteAppsResponse{} + return &this +} + +// NewDeleteAppsResponseWithDefaults instantiates a new DeleteAppsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeleteAppsResponseWithDefaults() *DeleteAppsResponse { + this := DeleteAppsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DeleteAppsResponse) GetData() []DeleteAppsResponseDataItems { + if o == nil || o.Data == nil { + var ret []DeleteAppsResponseDataItems + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteAppsResponse) GetDataOk() (*[]DeleteAppsResponseDataItems, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DeleteAppsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []DeleteAppsResponseDataItems and assigns it to the Data field. +func (o *DeleteAppsResponse) SetData(v []DeleteAppsResponseDataItems) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeleteAppsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeleteAppsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []DeleteAppsResponseDataItems `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_delete_apps_response_data_items.go b/api/datadogV2/model_delete_apps_response_data_items.go new file mode 100644 index 00000000000..02d379c5a43 --- /dev/null +++ b/api/datadogV2/model_delete_apps_response_data_items.go @@ -0,0 +1,145 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppsResponseDataItems The definition of `DeleteAppsResponseDataItems` object. +type DeleteAppsResponseDataItems struct { + // The `items` `id`. + Id string `json:"id"` + // The definition of `DeleteAppsResponseDataItemsType` object. + Type DeleteAppsResponseDataItemsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeleteAppsResponseDataItems instantiates a new DeleteAppsResponseDataItems object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeleteAppsResponseDataItems(id string, typeVar DeleteAppsResponseDataItemsType) *DeleteAppsResponseDataItems { + this := DeleteAppsResponseDataItems{} + this.Id = id + this.Type = typeVar + return &this +} + +// NewDeleteAppsResponseDataItemsWithDefaults instantiates a new DeleteAppsResponseDataItems object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeleteAppsResponseDataItemsWithDefaults() *DeleteAppsResponseDataItems { + this := DeleteAppsResponseDataItems{} + var typeVar DeleteAppsResponseDataItemsType = DELETEAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetId returns the Id field value. +func (o *DeleteAppsResponseDataItems) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeleteAppsResponseDataItems) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *DeleteAppsResponseDataItems) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *DeleteAppsResponseDataItems) GetType() DeleteAppsResponseDataItemsType { + if o == nil { + var ret DeleteAppsResponseDataItemsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DeleteAppsResponseDataItems) GetTypeOk() (*DeleteAppsResponseDataItemsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *DeleteAppsResponseDataItems) SetType(v DeleteAppsResponseDataItemsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeleteAppsResponseDataItems) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeleteAppsResponseDataItems) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id"` + Type *DeleteAppsResponseDataItemsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_delete_apps_response_data_items_type.go b/api/datadogV2/model_delete_apps_response_data_items_type.go new file mode 100644 index 00000000000..a165d9c834c --- /dev/null +++ b/api/datadogV2/model_delete_apps_response_data_items_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeleteAppsResponseDataItemsType The definition of `DeleteAppsResponseDataItemsType` object. +type DeleteAppsResponseDataItemsType string + +// List of DeleteAppsResponseDataItemsType. +const ( + DELETEAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS DeleteAppsResponseDataItemsType = "appDefinitions" +) + +var allowedDeleteAppsResponseDataItemsTypeEnumValues = []DeleteAppsResponseDataItemsType{ + DELETEAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DeleteAppsResponseDataItemsType) GetAllowedValues() []DeleteAppsResponseDataItemsType { + return allowedDeleteAppsResponseDataItemsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DeleteAppsResponseDataItemsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DeleteAppsResponseDataItemsType(value) + return nil +} + +// NewDeleteAppsResponseDataItemsTypeFromValue returns a pointer to a valid DeleteAppsResponseDataItemsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDeleteAppsResponseDataItemsTypeFromValue(v string) (*DeleteAppsResponseDataItemsType, error) { + ev := DeleteAppsResponseDataItemsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DeleteAppsResponseDataItemsType: valid values are %v", v, allowedDeleteAppsResponseDataItemsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DeleteAppsResponseDataItemsType) IsValid() bool { + for _, existing := range allowedDeleteAppsResponseDataItemsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeleteAppsResponseDataItemsType value. +func (v DeleteAppsResponseDataItemsType) Ptr() *DeleteAppsResponseDataItemsType { + return &v +} diff --git a/api/datadogV2/model_deploy_app_response.go b/api/datadogV2/model_deploy_app_response.go new file mode 100644 index 00000000000..307ef711ac2 --- /dev/null +++ b/api/datadogV2/model_deploy_app_response.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeployAppResponse The definition of `DeployAppResponse` object. +type DeployAppResponse struct { + // The definition of `DeployAppResponseData` object. + Data *DeployAppResponseData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeployAppResponse instantiates a new DeployAppResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeployAppResponse() *DeployAppResponse { + this := DeployAppResponse{} + return &this +} + +// NewDeployAppResponseWithDefaults instantiates a new DeployAppResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeployAppResponseWithDefaults() *DeployAppResponse { + this := DeployAppResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DeployAppResponse) GetData() DeployAppResponseData { + if o == nil || o.Data == nil { + var ret DeployAppResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployAppResponse) GetDataOk() (*DeployAppResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DeployAppResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given DeployAppResponseData and assigns it to the Data field. +func (o *DeployAppResponse) SetData(v DeployAppResponseData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeployAppResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeployAppResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *DeployAppResponseData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_deploy_app_response_data.go b/api/datadogV2/model_deploy_app_response_data.go new file mode 100644 index 00000000000..348b537c622 --- /dev/null +++ b/api/datadogV2/model_deploy_app_response_data.go @@ -0,0 +1,227 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeployAppResponseData The definition of `DeployAppResponseData` object. +type DeployAppResponseData struct { + // The definition of `DeployAppResponseDataAttributes` object. + Attributes *DeployAppResponseDataAttributes `json:"attributes,omitempty"` + // The `data` `id`. + Id *string `json:"id,omitempty"` + // The definition of `DeploymentMeta` object. + Meta *DeploymentMeta `json:"meta,omitempty"` + // The definition of `DeployAppResponseDataType` object. + Type *DeployAppResponseDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeployAppResponseData instantiates a new DeployAppResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeployAppResponseData() *DeployAppResponseData { + this := DeployAppResponseData{} + var typeVar DeployAppResponseDataType = DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// NewDeployAppResponseDataWithDefaults instantiates a new DeployAppResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeployAppResponseDataWithDefaults() *DeployAppResponseData { + this := DeployAppResponseData{} + var typeVar DeployAppResponseDataType = DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *DeployAppResponseData) GetAttributes() DeployAppResponseDataAttributes { + if o == nil || o.Attributes == nil { + var ret DeployAppResponseDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployAppResponseData) GetAttributesOk() (*DeployAppResponseDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *DeployAppResponseData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given DeployAppResponseDataAttributes and assigns it to the Attributes field. +func (o *DeployAppResponseData) SetAttributes(v DeployAppResponseDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DeployAppResponseData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployAppResponseData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DeployAppResponseData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DeployAppResponseData) SetId(v string) { + o.Id = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *DeployAppResponseData) GetMeta() DeploymentMeta { + if o == nil || o.Meta == nil { + var ret DeploymentMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployAppResponseData) GetMetaOk() (*DeploymentMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *DeployAppResponseData) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given DeploymentMeta and assigns it to the Meta field. +func (o *DeployAppResponseData) SetMeta(v DeploymentMeta) { + o.Meta = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DeployAppResponseData) GetType() DeployAppResponseDataType { + if o == nil || o.Type == nil { + var ret DeployAppResponseDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployAppResponseData) GetTypeOk() (*DeployAppResponseDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DeployAppResponseData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given DeployAppResponseDataType and assigns it to the Type field. +func (o *DeployAppResponseData) SetType(v DeployAppResponseDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeployAppResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeployAppResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *DeployAppResponseDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Meta *DeploymentMeta `json:"meta,omitempty"` + Type *DeployAppResponseDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_deploy_app_response_data_attributes.go b/api/datadogV2/model_deploy_app_response_data_attributes.go new file mode 100644 index 00000000000..bf2fbd7df0e --- /dev/null +++ b/api/datadogV2/model_deploy_app_response_data_attributes.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeployAppResponseDataAttributes The definition of `DeployAppResponseDataAttributes` object. +type DeployAppResponseDataAttributes struct { + // The `attributes` `app_version_id`. + AppVersionId *string `json:"app_version_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeployAppResponseDataAttributes instantiates a new DeployAppResponseDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeployAppResponseDataAttributes() *DeployAppResponseDataAttributes { + this := DeployAppResponseDataAttributes{} + return &this +} + +// NewDeployAppResponseDataAttributesWithDefaults instantiates a new DeployAppResponseDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeployAppResponseDataAttributesWithDefaults() *DeployAppResponseDataAttributes { + this := DeployAppResponseDataAttributes{} + return &this +} + +// GetAppVersionId returns the AppVersionId field value if set, zero value otherwise. +func (o *DeployAppResponseDataAttributes) GetAppVersionId() string { + if o == nil || o.AppVersionId == nil { + var ret string + return ret + } + return *o.AppVersionId +} + +// GetAppVersionIdOk returns a tuple with the AppVersionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeployAppResponseDataAttributes) GetAppVersionIdOk() (*string, bool) { + if o == nil || o.AppVersionId == nil { + return nil, false + } + return o.AppVersionId, true +} + +// HasAppVersionId returns a boolean if a field has been set. +func (o *DeployAppResponseDataAttributes) HasAppVersionId() bool { + return o != nil && o.AppVersionId != nil +} + +// SetAppVersionId gets a reference to the given string and assigns it to the AppVersionId field. +func (o *DeployAppResponseDataAttributes) SetAppVersionId(v string) { + o.AppVersionId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeployAppResponseDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AppVersionId != nil { + toSerialize["app_version_id"] = o.AppVersionId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeployAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AppVersionId *string `json:"app_version_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"app_version_id"}) + } else { + return err + } + o.AppVersionId = all.AppVersionId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_deploy_app_response_data_type.go b/api/datadogV2/model_deploy_app_response_data_type.go new file mode 100644 index 00000000000..d9b00fda85e --- /dev/null +++ b/api/datadogV2/model_deploy_app_response_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeployAppResponseDataType The definition of `DeployAppResponseDataType` object. +type DeployAppResponseDataType string + +// List of DeployAppResponseDataType. +const ( + DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT DeployAppResponseDataType = "deployment" +) + +var allowedDeployAppResponseDataTypeEnumValues = []DeployAppResponseDataType{ + DEPLOYAPPRESPONSEDATATYPE_DEPLOYMENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DeployAppResponseDataType) GetAllowedValues() []DeployAppResponseDataType { + return allowedDeployAppResponseDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DeployAppResponseDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DeployAppResponseDataType(value) + return nil +} + +// NewDeployAppResponseDataTypeFromValue returns a pointer to a valid DeployAppResponseDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDeployAppResponseDataTypeFromValue(v string) (*DeployAppResponseDataType, error) { + ev := DeployAppResponseDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DeployAppResponseDataType: valid values are %v", v, allowedDeployAppResponseDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DeployAppResponseDataType) IsValid() bool { + for _, existing := range allowedDeployAppResponseDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeployAppResponseDataType value. +func (v DeployAppResponseDataType) Ptr() *DeployAppResponseDataType { + return &v +} diff --git a/api/datadogV2/model_deployment_included.go b/api/datadogV2/model_deployment_included.go new file mode 100644 index 00000000000..0c353fe6866 --- /dev/null +++ b/api/datadogV2/model_deployment_included.go @@ -0,0 +1,227 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentIncluded The definition of `DeploymentIncluded` object. +type DeploymentIncluded struct { + // The definition of `DeploymentIncludedAttributes` object. + Attributes *DeploymentIncludedAttributes `json:"attributes,omitempty"` + // The `DeploymentIncluded` `id`. + Id *string `json:"id,omitempty"` + // The definition of `DeploymentIncludedMeta` object. + Meta *DeploymentIncludedMeta `json:"meta,omitempty"` + // The definition of `DeploymentIncludedType` object. + Type *DeploymentIncludedType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentIncluded instantiates a new DeploymentIncluded object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentIncluded() *DeploymentIncluded { + this := DeploymentIncluded{} + var typeVar DeploymentIncludedType = DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// NewDeploymentIncludedWithDefaults instantiates a new DeploymentIncluded object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentIncludedWithDefaults() *DeploymentIncluded { + this := DeploymentIncluded{} + var typeVar DeploymentIncludedType = DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *DeploymentIncluded) GetAttributes() DeploymentIncludedAttributes { + if o == nil || o.Attributes == nil { + var ret DeploymentIncludedAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncluded) GetAttributesOk() (*DeploymentIncludedAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *DeploymentIncluded) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given DeploymentIncludedAttributes and assigns it to the Attributes field. +func (o *DeploymentIncluded) SetAttributes(v DeploymentIncludedAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DeploymentIncluded) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncluded) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DeploymentIncluded) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DeploymentIncluded) SetId(v string) { + o.Id = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *DeploymentIncluded) GetMeta() DeploymentIncludedMeta { + if o == nil || o.Meta == nil { + var ret DeploymentIncludedMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncluded) GetMetaOk() (*DeploymentIncludedMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *DeploymentIncluded) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given DeploymentIncludedMeta and assigns it to the Meta field. +func (o *DeploymentIncluded) SetMeta(v DeploymentIncludedMeta) { + o.Meta = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DeploymentIncluded) GetType() DeploymentIncludedType { + if o == nil || o.Type == nil { + var ret DeploymentIncludedType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncluded) GetTypeOk() (*DeploymentIncludedType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DeploymentIncluded) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given DeploymentIncludedType and assigns it to the Type field. +func (o *DeploymentIncluded) SetType(v DeploymentIncludedType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentIncluded) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentIncluded) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *DeploymentIncludedAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Meta *DeploymentIncludedMeta `json:"meta,omitempty"` + Type *DeploymentIncludedType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_deployment_included_attributes.go b/api/datadogV2/model_deployment_included_attributes.go new file mode 100644 index 00000000000..77f08f2ca80 --- /dev/null +++ b/api/datadogV2/model_deployment_included_attributes.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentIncludedAttributes The definition of `DeploymentIncludedAttributes` object. +type DeploymentIncludedAttributes struct { + // The `attributes` `app_version_id`. + AppVersionId *string `json:"app_version_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentIncludedAttributes instantiates a new DeploymentIncludedAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentIncludedAttributes() *DeploymentIncludedAttributes { + this := DeploymentIncludedAttributes{} + return &this +} + +// NewDeploymentIncludedAttributesWithDefaults instantiates a new DeploymentIncludedAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentIncludedAttributesWithDefaults() *DeploymentIncludedAttributes { + this := DeploymentIncludedAttributes{} + return &this +} + +// GetAppVersionId returns the AppVersionId field value if set, zero value otherwise. +func (o *DeploymentIncludedAttributes) GetAppVersionId() string { + if o == nil || o.AppVersionId == nil { + var ret string + return ret + } + return *o.AppVersionId +} + +// GetAppVersionIdOk returns a tuple with the AppVersionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncludedAttributes) GetAppVersionIdOk() (*string, bool) { + if o == nil || o.AppVersionId == nil { + return nil, false + } + return o.AppVersionId, true +} + +// HasAppVersionId returns a boolean if a field has been set. +func (o *DeploymentIncludedAttributes) HasAppVersionId() bool { + return o != nil && o.AppVersionId != nil +} + +// SetAppVersionId gets a reference to the given string and assigns it to the AppVersionId field. +func (o *DeploymentIncludedAttributes) SetAppVersionId(v string) { + o.AppVersionId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentIncludedAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AppVersionId != nil { + toSerialize["app_version_id"] = o.AppVersionId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentIncludedAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AppVersionId *string `json:"app_version_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"app_version_id"}) + } else { + return err + } + o.AppVersionId = all.AppVersionId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_deployment_included_meta.go b/api/datadogV2/model_deployment_included_meta.go new file mode 100644 index 00000000000..9d35f13e0e6 --- /dev/null +++ b/api/datadogV2/model_deployment_included_meta.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentIncludedMeta The definition of `DeploymentIncludedMeta` object. +type DeploymentIncludedMeta struct { + // The `meta` `created_at`. + CreatedAt *string `json:"created_at,omitempty"` + // The `meta` `user_id`. + UserId *int64 `json:"user_id,omitempty"` + // The `meta` `user_name`. + UserName *string `json:"user_name,omitempty"` + // The `meta` `user_uuid`. + UserUuid *string `json:"user_uuid,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentIncludedMeta instantiates a new DeploymentIncludedMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentIncludedMeta() *DeploymentIncludedMeta { + this := DeploymentIncludedMeta{} + return &this +} + +// NewDeploymentIncludedMetaWithDefaults instantiates a new DeploymentIncludedMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentIncludedMetaWithDefaults() *DeploymentIncludedMeta { + this := DeploymentIncludedMeta{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DeploymentIncludedMeta) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncludedMeta) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DeploymentIncludedMeta) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *DeploymentIncludedMeta) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *DeploymentIncludedMeta) GetUserId() int64 { + if o == nil || o.UserId == nil { + var ret int64 + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncludedMeta) GetUserIdOk() (*int64, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *DeploymentIncludedMeta) HasUserId() bool { + return o != nil && o.UserId != nil +} + +// SetUserId gets a reference to the given int64 and assigns it to the UserId field. +func (o *DeploymentIncludedMeta) SetUserId(v int64) { + o.UserId = &v +} + +// GetUserName returns the UserName field value if set, zero value otherwise. +func (o *DeploymentIncludedMeta) GetUserName() string { + if o == nil || o.UserName == nil { + var ret string + return ret + } + return *o.UserName +} + +// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncludedMeta) GetUserNameOk() (*string, bool) { + if o == nil || o.UserName == nil { + return nil, false + } + return o.UserName, true +} + +// HasUserName returns a boolean if a field has been set. +func (o *DeploymentIncludedMeta) HasUserName() bool { + return o != nil && o.UserName != nil +} + +// SetUserName gets a reference to the given string and assigns it to the UserName field. +func (o *DeploymentIncludedMeta) SetUserName(v string) { + o.UserName = &v +} + +// GetUserUuid returns the UserUuid field value if set, zero value otherwise. +func (o *DeploymentIncludedMeta) GetUserUuid() string { + if o == nil || o.UserUuid == nil { + var ret string + return ret + } + return *o.UserUuid +} + +// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentIncludedMeta) GetUserUuidOk() (*string, bool) { + if o == nil || o.UserUuid == nil { + return nil, false + } + return o.UserUuid, true +} + +// HasUserUuid returns a boolean if a field has been set. +func (o *DeploymentIncludedMeta) HasUserUuid() bool { + return o != nil && o.UserUuid != nil +} + +// SetUserUuid gets a reference to the given string and assigns it to the UserUuid field. +func (o *DeploymentIncludedMeta) SetUserUuid(v string) { + o.UserUuid = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentIncludedMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.UserId != nil { + toSerialize["user_id"] = o.UserId + } + if o.UserName != nil { + toSerialize["user_name"] = o.UserName + } + if o.UserUuid != nil { + toSerialize["user_uuid"] = o.UserUuid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentIncludedMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *string `json:"created_at,omitempty"` + UserId *int64 `json:"user_id,omitempty"` + UserName *string `json:"user_name,omitempty"` + UserUuid *string `json:"user_uuid,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "user_id", "user_name", "user_uuid"}) + } else { + return err + } + o.CreatedAt = all.CreatedAt + o.UserId = all.UserId + o.UserName = all.UserName + o.UserUuid = all.UserUuid + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_deployment_included_type.go b/api/datadogV2/model_deployment_included_type.go new file mode 100644 index 00000000000..18814099227 --- /dev/null +++ b/api/datadogV2/model_deployment_included_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentIncludedType The definition of `DeploymentIncludedType` object. +type DeploymentIncludedType string + +// List of DeploymentIncludedType. +const ( + DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT DeploymentIncludedType = "deployment" +) + +var allowedDeploymentIncludedTypeEnumValues = []DeploymentIncludedType{ + DEPLOYMENTINCLUDEDTYPE_DEPLOYMENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DeploymentIncludedType) GetAllowedValues() []DeploymentIncludedType { + return allowedDeploymentIncludedTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DeploymentIncludedType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DeploymentIncludedType(value) + return nil +} + +// NewDeploymentIncludedTypeFromValue returns a pointer to a valid DeploymentIncludedType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDeploymentIncludedTypeFromValue(v string) (*DeploymentIncludedType, error) { + ev := DeploymentIncludedType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DeploymentIncludedType: valid values are %v", v, allowedDeploymentIncludedTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DeploymentIncludedType) IsValid() bool { + for _, existing := range allowedDeploymentIncludedTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeploymentIncludedType value. +func (v DeploymentIncludedType) Ptr() *DeploymentIncludedType { + return &v +} diff --git a/api/datadogV2/model_deployment_meta.go b/api/datadogV2/model_deployment_meta.go new file mode 100644 index 00000000000..0cda692ccd1 --- /dev/null +++ b/api/datadogV2/model_deployment_meta.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentMeta The definition of `DeploymentMeta` object. +type DeploymentMeta struct { + // The `DeploymentMeta` `created_at`. + CreatedAt *string `json:"created_at,omitempty"` + // The `DeploymentMeta` `user_id`. + UserId *int64 `json:"user_id,omitempty"` + // The `DeploymentMeta` `user_name`. + UserName *string `json:"user_name,omitempty"` + // The `DeploymentMeta` `user_uuid`. + UserUuid *string `json:"user_uuid,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentMeta instantiates a new DeploymentMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentMeta() *DeploymentMeta { + this := DeploymentMeta{} + return &this +} + +// NewDeploymentMetaWithDefaults instantiates a new DeploymentMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentMetaWithDefaults() *DeploymentMeta { + this := DeploymentMeta{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DeploymentMeta) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentMeta) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DeploymentMeta) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *DeploymentMeta) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *DeploymentMeta) GetUserId() int64 { + if o == nil || o.UserId == nil { + var ret int64 + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentMeta) GetUserIdOk() (*int64, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *DeploymentMeta) HasUserId() bool { + return o != nil && o.UserId != nil +} + +// SetUserId gets a reference to the given int64 and assigns it to the UserId field. +func (o *DeploymentMeta) SetUserId(v int64) { + o.UserId = &v +} + +// GetUserName returns the UserName field value if set, zero value otherwise. +func (o *DeploymentMeta) GetUserName() string { + if o == nil || o.UserName == nil { + var ret string + return ret + } + return *o.UserName +} + +// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentMeta) GetUserNameOk() (*string, bool) { + if o == nil || o.UserName == nil { + return nil, false + } + return o.UserName, true +} + +// HasUserName returns a boolean if a field has been set. +func (o *DeploymentMeta) HasUserName() bool { + return o != nil && o.UserName != nil +} + +// SetUserName gets a reference to the given string and assigns it to the UserName field. +func (o *DeploymentMeta) SetUserName(v string) { + o.UserName = &v +} + +// GetUserUuid returns the UserUuid field value if set, zero value otherwise. +func (o *DeploymentMeta) GetUserUuid() string { + if o == nil || o.UserUuid == nil { + var ret string + return ret + } + return *o.UserUuid +} + +// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentMeta) GetUserUuidOk() (*string, bool) { + if o == nil || o.UserUuid == nil { + return nil, false + } + return o.UserUuid, true +} + +// HasUserUuid returns a boolean if a field has been set. +func (o *DeploymentMeta) HasUserUuid() bool { + return o != nil && o.UserUuid != nil +} + +// SetUserUuid gets a reference to the given string and assigns it to the UserUuid field. +func (o *DeploymentMeta) SetUserUuid(v string) { + o.UserUuid = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.UserId != nil { + toSerialize["user_id"] = o.UserId + } + if o.UserName != nil { + toSerialize["user_name"] = o.UserName + } + if o.UserUuid != nil { + toSerialize["user_uuid"] = o.UserUuid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *string `json:"created_at,omitempty"` + UserId *int64 `json:"user_id,omitempty"` + UserName *string `json:"user_name,omitempty"` + UserUuid *string `json:"user_uuid,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "user_id", "user_name", "user_uuid"}) + } else { + return err + } + o.CreatedAt = all.CreatedAt + o.UserId = all.UserId + o.UserName = all.UserName + o.UserUuid = all.UserUuid + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_deployment_relationship.go b/api/datadogV2/model_deployment_relationship.go new file mode 100644 index 00000000000..1c57379dc0a --- /dev/null +++ b/api/datadogV2/model_deployment_relationship.go @@ -0,0 +1,149 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentRelationship The definition of `DeploymentRelationship` object. +type DeploymentRelationship struct { + // The definition of `DeploymentRelationshipData` object. + Data *DeploymentRelationshipData `json:"data,omitempty"` + // The definition of `DeploymentRelationshipMeta` object. + Meta *DeploymentRelationshipMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentRelationship instantiates a new DeploymentRelationship object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentRelationship() *DeploymentRelationship { + this := DeploymentRelationship{} + return &this +} + +// NewDeploymentRelationshipWithDefaults instantiates a new DeploymentRelationship object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentRelationshipWithDefaults() *DeploymentRelationship { + this := DeploymentRelationship{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DeploymentRelationship) GetData() DeploymentRelationshipData { + if o == nil || o.Data == nil { + var ret DeploymentRelationshipData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationship) GetDataOk() (*DeploymentRelationshipData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DeploymentRelationship) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given DeploymentRelationshipData and assigns it to the Data field. +func (o *DeploymentRelationship) SetData(v DeploymentRelationshipData) { + o.Data = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *DeploymentRelationship) GetMeta() DeploymentRelationshipMeta { + if o == nil || o.Meta == nil { + var ret DeploymentRelationshipMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationship) GetMetaOk() (*DeploymentRelationshipMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *DeploymentRelationship) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given DeploymentRelationshipMeta and assigns it to the Meta field. +func (o *DeploymentRelationship) SetMeta(v DeploymentRelationshipMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentRelationship) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentRelationship) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *DeploymentRelationshipData `json:"data,omitempty"` + Meta *DeploymentRelationshipMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "meta"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_deployment_relationship_data.go b/api/datadogV2/model_deployment_relationship_data.go new file mode 100644 index 00000000000..ca66e1a6b04 --- /dev/null +++ b/api/datadogV2/model_deployment_relationship_data.go @@ -0,0 +1,151 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentRelationshipData The definition of `DeploymentRelationshipData` object. +type DeploymentRelationshipData struct { + // The `data` `id`. + Id *string `json:"id,omitempty"` + // The definition of `DeploymentRelationshipDataType` object. + Type *DeploymentRelationshipDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentRelationshipData instantiates a new DeploymentRelationshipData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentRelationshipData() *DeploymentRelationshipData { + this := DeploymentRelationshipData{} + var typeVar DeploymentRelationshipDataType = DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// NewDeploymentRelationshipDataWithDefaults instantiates a new DeploymentRelationshipData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentRelationshipDataWithDefaults() *DeploymentRelationshipData { + this := DeploymentRelationshipData{} + var typeVar DeploymentRelationshipDataType = DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DeploymentRelationshipData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationshipData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DeploymentRelationshipData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DeploymentRelationshipData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DeploymentRelationshipData) GetType() DeploymentRelationshipDataType { + if o == nil || o.Type == nil { + var ret DeploymentRelationshipDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationshipData) GetTypeOk() (*DeploymentRelationshipDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DeploymentRelationshipData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given DeploymentRelationshipDataType and assigns it to the Type field. +func (o *DeploymentRelationshipData) SetType(v DeploymentRelationshipDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentRelationshipData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentRelationshipData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + Type *DeploymentRelationshipDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_deployment_relationship_data_type.go b/api/datadogV2/model_deployment_relationship_data_type.go new file mode 100644 index 00000000000..18f939befbc --- /dev/null +++ b/api/datadogV2/model_deployment_relationship_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentRelationshipDataType The definition of `DeploymentRelationshipDataType` object. +type DeploymentRelationshipDataType string + +// List of DeploymentRelationshipDataType. +const ( + DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT DeploymentRelationshipDataType = "deployment" +) + +var allowedDeploymentRelationshipDataTypeEnumValues = []DeploymentRelationshipDataType{ + DEPLOYMENTRELATIONSHIPDATATYPE_DEPLOYMENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DeploymentRelationshipDataType) GetAllowedValues() []DeploymentRelationshipDataType { + return allowedDeploymentRelationshipDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DeploymentRelationshipDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DeploymentRelationshipDataType(value) + return nil +} + +// NewDeploymentRelationshipDataTypeFromValue returns a pointer to a valid DeploymentRelationshipDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDeploymentRelationshipDataTypeFromValue(v string) (*DeploymentRelationshipDataType, error) { + ev := DeploymentRelationshipDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DeploymentRelationshipDataType: valid values are %v", v, allowedDeploymentRelationshipDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DeploymentRelationshipDataType) IsValid() bool { + for _, existing := range allowedDeploymentRelationshipDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeploymentRelationshipDataType value. +func (v DeploymentRelationshipDataType) Ptr() *DeploymentRelationshipDataType { + return &v +} diff --git a/api/datadogV2/model_deployment_relationship_meta.go b/api/datadogV2/model_deployment_relationship_meta.go new file mode 100644 index 00000000000..3da30facef5 --- /dev/null +++ b/api/datadogV2/model_deployment_relationship_meta.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DeploymentRelationshipMeta The definition of `DeploymentRelationshipMeta` object. +type DeploymentRelationshipMeta struct { + // The `meta` `created_at`. + CreatedAt *string `json:"created_at,omitempty"` + // The `meta` `user_id`. + UserId *int64 `json:"user_id,omitempty"` + // The `meta` `user_name`. + UserName *string `json:"user_name,omitempty"` + // The `meta` `user_uuid`. + UserUuid *string `json:"user_uuid,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDeploymentRelationshipMeta instantiates a new DeploymentRelationshipMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDeploymentRelationshipMeta() *DeploymentRelationshipMeta { + this := DeploymentRelationshipMeta{} + return &this +} + +// NewDeploymentRelationshipMetaWithDefaults instantiates a new DeploymentRelationshipMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDeploymentRelationshipMetaWithDefaults() *DeploymentRelationshipMeta { + this := DeploymentRelationshipMeta{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DeploymentRelationshipMeta) GetCreatedAt() string { + if o == nil || o.CreatedAt == nil { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationshipMeta) GetCreatedAtOk() (*string, bool) { + if o == nil || o.CreatedAt == nil { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DeploymentRelationshipMeta) HasCreatedAt() bool { + return o != nil && o.CreatedAt != nil +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *DeploymentRelationshipMeta) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetUserId returns the UserId field value if set, zero value otherwise. +func (o *DeploymentRelationshipMeta) GetUserId() int64 { + if o == nil || o.UserId == nil { + var ret int64 + return ret + } + return *o.UserId +} + +// GetUserIdOk returns a tuple with the UserId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationshipMeta) GetUserIdOk() (*int64, bool) { + if o == nil || o.UserId == nil { + return nil, false + } + return o.UserId, true +} + +// HasUserId returns a boolean if a field has been set. +func (o *DeploymentRelationshipMeta) HasUserId() bool { + return o != nil && o.UserId != nil +} + +// SetUserId gets a reference to the given int64 and assigns it to the UserId field. +func (o *DeploymentRelationshipMeta) SetUserId(v int64) { + o.UserId = &v +} + +// GetUserName returns the UserName field value if set, zero value otherwise. +func (o *DeploymentRelationshipMeta) GetUserName() string { + if o == nil || o.UserName == nil { + var ret string + return ret + } + return *o.UserName +} + +// GetUserNameOk returns a tuple with the UserName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationshipMeta) GetUserNameOk() (*string, bool) { + if o == nil || o.UserName == nil { + return nil, false + } + return o.UserName, true +} + +// HasUserName returns a boolean if a field has been set. +func (o *DeploymentRelationshipMeta) HasUserName() bool { + return o != nil && o.UserName != nil +} + +// SetUserName gets a reference to the given string and assigns it to the UserName field. +func (o *DeploymentRelationshipMeta) SetUserName(v string) { + o.UserName = &v +} + +// GetUserUuid returns the UserUuid field value if set, zero value otherwise. +func (o *DeploymentRelationshipMeta) GetUserUuid() string { + if o == nil || o.UserUuid == nil { + var ret string + return ret + } + return *o.UserUuid +} + +// GetUserUuidOk returns a tuple with the UserUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeploymentRelationshipMeta) GetUserUuidOk() (*string, bool) { + if o == nil || o.UserUuid == nil { + return nil, false + } + return o.UserUuid, true +} + +// HasUserUuid returns a boolean if a field has been set. +func (o *DeploymentRelationshipMeta) HasUserUuid() bool { + return o != nil && o.UserUuid != nil +} + +// SetUserUuid gets a reference to the given string and assigns it to the UserUuid field. +func (o *DeploymentRelationshipMeta) SetUserUuid(v string) { + o.UserUuid = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DeploymentRelationshipMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt != nil { + toSerialize["created_at"] = o.CreatedAt + } + if o.UserId != nil { + toSerialize["user_id"] = o.UserId + } + if o.UserName != nil { + toSerialize["user_name"] = o.UserName + } + if o.UserUuid != nil { + toSerialize["user_uuid"] = o.UserUuid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DeploymentRelationshipMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *string `json:"created_at,omitempty"` + UserId *int64 `json:"user_id,omitempty"` + UserName *string `json:"user_name,omitempty"` + UserUuid *string `json:"user_uuid,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "user_id", "user_name", "user_uuid"}) + } else { + return err + } + o.CreatedAt = all.CreatedAt + o.UserId = all.UserId + o.UserName = all.UserName + o.UserUuid = all.UserUuid + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_disable_app_response.go b/api/datadogV2/model_disable_app_response.go new file mode 100644 index 00000000000..c8c454762b5 --- /dev/null +++ b/api/datadogV2/model_disable_app_response.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DisableAppResponse The definition of `DisableAppResponse` object. +type DisableAppResponse struct { + // The definition of `DisableAppResponseData` object. + Data *DisableAppResponseData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDisableAppResponse instantiates a new DisableAppResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDisableAppResponse() *DisableAppResponse { + this := DisableAppResponse{} + return &this +} + +// NewDisableAppResponseWithDefaults instantiates a new DisableAppResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDisableAppResponseWithDefaults() *DisableAppResponse { + this := DisableAppResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *DisableAppResponse) GetData() DisableAppResponseData { + if o == nil || o.Data == nil { + var ret DisableAppResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DisableAppResponse) GetDataOk() (*DisableAppResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *DisableAppResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given DisableAppResponseData and assigns it to the Data field. +func (o *DisableAppResponse) SetData(v DisableAppResponseData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DisableAppResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DisableAppResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *DisableAppResponseData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_disable_app_response_data.go b/api/datadogV2/model_disable_app_response_data.go new file mode 100644 index 00000000000..65c94ea3ab3 --- /dev/null +++ b/api/datadogV2/model_disable_app_response_data.go @@ -0,0 +1,227 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DisableAppResponseData The definition of `DisableAppResponseData` object. +type DisableAppResponseData struct { + // The definition of `DisableAppResponseDataAttributes` object. + Attributes *DisableAppResponseDataAttributes `json:"attributes,omitempty"` + // The `data` `id`. + Id *string `json:"id,omitempty"` + // The definition of `DeploymentMeta` object. + Meta *DeploymentMeta `json:"meta,omitempty"` + // The definition of `DisableAppResponseDataType` object. + Type *DisableAppResponseDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDisableAppResponseData instantiates a new DisableAppResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDisableAppResponseData() *DisableAppResponseData { + this := DisableAppResponseData{} + var typeVar DisableAppResponseDataType = DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// NewDisableAppResponseDataWithDefaults instantiates a new DisableAppResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDisableAppResponseDataWithDefaults() *DisableAppResponseData { + this := DisableAppResponseData{} + var typeVar DisableAppResponseDataType = DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *DisableAppResponseData) GetAttributes() DisableAppResponseDataAttributes { + if o == nil || o.Attributes == nil { + var ret DisableAppResponseDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DisableAppResponseData) GetAttributesOk() (*DisableAppResponseDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *DisableAppResponseData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given DisableAppResponseDataAttributes and assigns it to the Attributes field. +func (o *DisableAppResponseData) SetAttributes(v DisableAppResponseDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DisableAppResponseData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DisableAppResponseData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DisableAppResponseData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DisableAppResponseData) SetId(v string) { + o.Id = &v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *DisableAppResponseData) GetMeta() DeploymentMeta { + if o == nil || o.Meta == nil { + var ret DeploymentMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DisableAppResponseData) GetMetaOk() (*DeploymentMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *DisableAppResponseData) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given DeploymentMeta and assigns it to the Meta field. +func (o *DisableAppResponseData) SetMeta(v DeploymentMeta) { + o.Meta = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *DisableAppResponseData) GetType() DisableAppResponseDataType { + if o == nil || o.Type == nil { + var ret DisableAppResponseDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DisableAppResponseData) GetTypeOk() (*DisableAppResponseDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *DisableAppResponseData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given DisableAppResponseDataType and assigns it to the Type field. +func (o *DisableAppResponseData) SetType(v DisableAppResponseDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DisableAppResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DisableAppResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *DisableAppResponseDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Meta *DeploymentMeta `json:"meta,omitempty"` + Type *DisableAppResponseDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_disable_app_response_data_attributes.go b/api/datadogV2/model_disable_app_response_data_attributes.go new file mode 100644 index 00000000000..fb06539a7b9 --- /dev/null +++ b/api/datadogV2/model_disable_app_response_data_attributes.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DisableAppResponseDataAttributes The definition of `DisableAppResponseDataAttributes` object. +type DisableAppResponseDataAttributes struct { + // The `attributes` `app_version_id`. + AppVersionId *string `json:"app_version_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewDisableAppResponseDataAttributes instantiates a new DisableAppResponseDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewDisableAppResponseDataAttributes() *DisableAppResponseDataAttributes { + this := DisableAppResponseDataAttributes{} + return &this +} + +// NewDisableAppResponseDataAttributesWithDefaults instantiates a new DisableAppResponseDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewDisableAppResponseDataAttributesWithDefaults() *DisableAppResponseDataAttributes { + this := DisableAppResponseDataAttributes{} + return &this +} + +// GetAppVersionId returns the AppVersionId field value if set, zero value otherwise. +func (o *DisableAppResponseDataAttributes) GetAppVersionId() string { + if o == nil || o.AppVersionId == nil { + var ret string + return ret + } + return *o.AppVersionId +} + +// GetAppVersionIdOk returns a tuple with the AppVersionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DisableAppResponseDataAttributes) GetAppVersionIdOk() (*string, bool) { + if o == nil || o.AppVersionId == nil { + return nil, false + } + return o.AppVersionId, true +} + +// HasAppVersionId returns a boolean if a field has been set. +func (o *DisableAppResponseDataAttributes) HasAppVersionId() bool { + return o != nil && o.AppVersionId != nil +} + +// SetAppVersionId gets a reference to the given string and assigns it to the AppVersionId field. +func (o *DisableAppResponseDataAttributes) SetAppVersionId(v string) { + o.AppVersionId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o DisableAppResponseDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AppVersionId != nil { + toSerialize["app_version_id"] = o.AppVersionId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *DisableAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AppVersionId *string `json:"app_version_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"app_version_id"}) + } else { + return err + } + o.AppVersionId = all.AppVersionId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_disable_app_response_data_type.go b/api/datadogV2/model_disable_app_response_data_type.go new file mode 100644 index 00000000000..70ff1e74b62 --- /dev/null +++ b/api/datadogV2/model_disable_app_response_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// DisableAppResponseDataType The definition of `DisableAppResponseDataType` object. +type DisableAppResponseDataType string + +// List of DisableAppResponseDataType. +const ( + DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT DisableAppResponseDataType = "deployment" +) + +var allowedDisableAppResponseDataTypeEnumValues = []DisableAppResponseDataType{ + DISABLEAPPRESPONSEDATATYPE_DEPLOYMENT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *DisableAppResponseDataType) GetAllowedValues() []DisableAppResponseDataType { + return allowedDisableAppResponseDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *DisableAppResponseDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = DisableAppResponseDataType(value) + return nil +} + +// NewDisableAppResponseDataTypeFromValue returns a pointer to a valid DisableAppResponseDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewDisableAppResponseDataTypeFromValue(v string) (*DisableAppResponseDataType, error) { + ev := DisableAppResponseDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for DisableAppResponseDataType: valid values are %v", v, allowedDisableAppResponseDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v DisableAppResponseDataType) IsValid() bool { + for _, existing := range allowedDisableAppResponseDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DisableAppResponseDataType value. +func (v DisableAppResponseDataType) Ptr() *DisableAppResponseDataType { + return &v +} diff --git a/api/datadogV2/model_get_app_response.go b/api/datadogV2/model_get_app_response.go new file mode 100644 index 00000000000..576843f04de --- /dev/null +++ b/api/datadogV2/model_get_app_response.go @@ -0,0 +1,222 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// GetAppResponse The definition of `GetAppResponse` object. +type GetAppResponse struct { + // The definition of `GetAppResponseData` object. + Data *GetAppResponseData `json:"data,omitempty"` + // The `GetAppResponse` `included`. + Included []DeploymentIncluded `json:"included,omitempty"` + // The definition of `AppMeta` object. + Meta *AppMeta `json:"meta,omitempty"` + // The definition of `GetAppResponseRelationship` object. + Relationship *GetAppResponseRelationship `json:"relationship,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewGetAppResponse instantiates a new GetAppResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewGetAppResponse() *GetAppResponse { + this := GetAppResponse{} + return &this +} + +// NewGetAppResponseWithDefaults instantiates a new GetAppResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewGetAppResponseWithDefaults() *GetAppResponse { + this := GetAppResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetAppResponse) GetData() GetAppResponseData { + if o == nil || o.Data == nil { + var ret GetAppResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponse) GetDataOk() (*GetAppResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *GetAppResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given GetAppResponseData and assigns it to the Data field. +func (o *GetAppResponse) SetData(v GetAppResponseData) { + o.Data = &v +} + +// GetIncluded returns the Included field value if set, zero value otherwise. +func (o *GetAppResponse) GetIncluded() []DeploymentIncluded { + if o == nil || o.Included == nil { + var ret []DeploymentIncluded + return ret + } + return o.Included +} + +// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponse) GetIncludedOk() (*[]DeploymentIncluded, bool) { + if o == nil || o.Included == nil { + return nil, false + } + return &o.Included, true +} + +// HasIncluded returns a boolean if a field has been set. +func (o *GetAppResponse) HasIncluded() bool { + return o != nil && o.Included != nil +} + +// SetIncluded gets a reference to the given []DeploymentIncluded and assigns it to the Included field. +func (o *GetAppResponse) SetIncluded(v []DeploymentIncluded) { + o.Included = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *GetAppResponse) GetMeta() AppMeta { + if o == nil || o.Meta == nil { + var ret AppMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponse) GetMetaOk() (*AppMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *GetAppResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given AppMeta and assigns it to the Meta field. +func (o *GetAppResponse) SetMeta(v AppMeta) { + o.Meta = &v +} + +// GetRelationship returns the Relationship field value if set, zero value otherwise. +func (o *GetAppResponse) GetRelationship() GetAppResponseRelationship { + if o == nil || o.Relationship == nil { + var ret GetAppResponseRelationship + return ret + } + return *o.Relationship +} + +// GetRelationshipOk returns a tuple with the Relationship field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponse) GetRelationshipOk() (*GetAppResponseRelationship, bool) { + if o == nil || o.Relationship == nil { + return nil, false + } + return o.Relationship, true +} + +// HasRelationship returns a boolean if a field has been set. +func (o *GetAppResponse) HasRelationship() bool { + return o != nil && o.Relationship != nil +} + +// SetRelationship gets a reference to the given GetAppResponseRelationship and assigns it to the Relationship field. +func (o *GetAppResponse) SetRelationship(v GetAppResponseRelationship) { + o.Relationship = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o GetAppResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Included != nil { + toSerialize["included"] = o.Included + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Relationship != nil { + toSerialize["relationship"] = o.Relationship + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *GetAppResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *GetAppResponseData `json:"data,omitempty"` + Included []DeploymentIncluded `json:"included,omitempty"` + Meta *AppMeta `json:"meta,omitempty"` + Relationship *GetAppResponseRelationship `json:"relationship,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included", "meta", "relationship"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + o.Included = all.Included + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + if all.Relationship != nil && all.Relationship.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationship = all.Relationship + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_get_app_response_data.go b/api/datadogV2/model_get_app_response_data.go new file mode 100644 index 00000000000..f80cbb380b2 --- /dev/null +++ b/api/datadogV2/model_get_app_response_data.go @@ -0,0 +1,180 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// GetAppResponseData The definition of `GetAppResponseData` object. +type GetAppResponseData struct { + // The definition of `GetAppResponseDataAttributes` object. + Attributes GetAppResponseDataAttributes `json:"attributes"` + // The `data` `id`. + Id string `json:"id"` + // The definition of `GetAppResponseDataType` object. + Type GetAppResponseDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewGetAppResponseData instantiates a new GetAppResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewGetAppResponseData(attributes GetAppResponseDataAttributes, id string, typeVar GetAppResponseDataType) *GetAppResponseData { + this := GetAppResponseData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewGetAppResponseDataWithDefaults instantiates a new GetAppResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewGetAppResponseDataWithDefaults() *GetAppResponseData { + this := GetAppResponseData{} + var typeVar GetAppResponseDataType = GETAPPRESPONSEDATATYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *GetAppResponseData) GetAttributes() GetAppResponseDataAttributes { + if o == nil { + var ret GetAppResponseDataAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *GetAppResponseData) GetAttributesOk() (*GetAppResponseDataAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *GetAppResponseData) SetAttributes(v GetAppResponseDataAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *GetAppResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetAppResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *GetAppResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *GetAppResponseData) GetType() GetAppResponseDataType { + if o == nil { + var ret GetAppResponseDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetAppResponseData) GetTypeOk() (*GetAppResponseDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *GetAppResponseData) SetType(v GetAppResponseDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o GetAppResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *GetAppResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *GetAppResponseDataAttributes `json:"attributes"` + Id *string `json:"id"` + Type *GetAppResponseDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_get_app_response_data_attributes.go b/api/datadogV2/model_get_app_response_data_attributes.go new file mode 100644 index 00000000000..62c13b900cb --- /dev/null +++ b/api/datadogV2/model_get_app_response_data_attributes.go @@ -0,0 +1,391 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// GetAppResponseDataAttributes The definition of `GetAppResponseDataAttributes` object. +type GetAppResponseDataAttributes struct { + // The `attributes` `components`. + Components []ComponentGrid `json:"components,omitempty"` + // The `attributes` `description`. + Description *string `json:"description,omitempty"` + // The `attributes` `embeddedQueries`. + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + // The `attributes` `favorite`. + Favorite *bool `json:"favorite,omitempty"` + // The definition of `InputSchema` object. + InputSchema *InputSchema `json:"inputSchema,omitempty"` + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `rootInstanceName`. + RootInstanceName *string `json:"rootInstanceName,omitempty"` + // The `attributes` `scripts`. + Scripts []Script `json:"scripts,omitempty"` + // The `attributes` `tags`. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewGetAppResponseDataAttributes instantiates a new GetAppResponseDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewGetAppResponseDataAttributes() *GetAppResponseDataAttributes { + this := GetAppResponseDataAttributes{} + return &this +} + +// NewGetAppResponseDataAttributesWithDefaults instantiates a new GetAppResponseDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewGetAppResponseDataAttributesWithDefaults() *GetAppResponseDataAttributes { + this := GetAppResponseDataAttributes{} + return &this +} + +// GetComponents returns the Components field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetComponents() []ComponentGrid { + if o == nil || o.Components == nil { + var ret []ComponentGrid + return ret + } + return o.Components +} + +// GetComponentsOk returns a tuple with the Components field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetComponentsOk() (*[]ComponentGrid, bool) { + if o == nil || o.Components == nil { + return nil, false + } + return &o.Components, true +} + +// HasComponents returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasComponents() bool { + return o != nil && o.Components != nil +} + +// SetComponents gets a reference to the given []ComponentGrid and assigns it to the Components field. +func (o *GetAppResponseDataAttributes) SetComponents(v []ComponentGrid) { + o.Components = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *GetAppResponseDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEmbeddedQueries returns the EmbeddedQueries field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetEmbeddedQueries() []Query { + if o == nil || o.EmbeddedQueries == nil { + var ret []Query + return ret + } + return o.EmbeddedQueries +} + +// GetEmbeddedQueriesOk returns a tuple with the EmbeddedQueries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetEmbeddedQueriesOk() (*[]Query, bool) { + if o == nil || o.EmbeddedQueries == nil { + return nil, false + } + return &o.EmbeddedQueries, true +} + +// HasEmbeddedQueries returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasEmbeddedQueries() bool { + return o != nil && o.EmbeddedQueries != nil +} + +// SetEmbeddedQueries gets a reference to the given []Query and assigns it to the EmbeddedQueries field. +func (o *GetAppResponseDataAttributes) SetEmbeddedQueries(v []Query) { + o.EmbeddedQueries = v +} + +// GetFavorite returns the Favorite field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetFavorite() bool { + if o == nil || o.Favorite == nil { + var ret bool + return ret + } + return *o.Favorite +} + +// GetFavoriteOk returns a tuple with the Favorite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetFavoriteOk() (*bool, bool) { + if o == nil || o.Favorite == nil { + return nil, false + } + return o.Favorite, true +} + +// HasFavorite returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasFavorite() bool { + return o != nil && o.Favorite != nil +} + +// SetFavorite gets a reference to the given bool and assigns it to the Favorite field. +func (o *GetAppResponseDataAttributes) SetFavorite(v bool) { + o.Favorite = &v +} + +// GetInputSchema returns the InputSchema field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetInputSchema() InputSchema { + if o == nil || o.InputSchema == nil { + var ret InputSchema + return ret + } + return *o.InputSchema +} + +// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { + if o == nil || o.InputSchema == nil { + return nil, false + } + return o.InputSchema, true +} + +// HasInputSchema returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasInputSchema() bool { + return o != nil && o.InputSchema != nil +} + +// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. +func (o *GetAppResponseDataAttributes) SetInputSchema(v InputSchema) { + o.InputSchema = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *GetAppResponseDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetRootInstanceName returns the RootInstanceName field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetRootInstanceName() string { + if o == nil || o.RootInstanceName == nil { + var ret string + return ret + } + return *o.RootInstanceName +} + +// GetRootInstanceNameOk returns a tuple with the RootInstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetRootInstanceNameOk() (*string, bool) { + if o == nil || o.RootInstanceName == nil { + return nil, false + } + return o.RootInstanceName, true +} + +// HasRootInstanceName returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasRootInstanceName() bool { + return o != nil && o.RootInstanceName != nil +} + +// SetRootInstanceName gets a reference to the given string and assigns it to the RootInstanceName field. +func (o *GetAppResponseDataAttributes) SetRootInstanceName(v string) { + o.RootInstanceName = &v +} + +// GetScripts returns the Scripts field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetScripts() []Script { + if o == nil || o.Scripts == nil { + var ret []Script + return ret + } + return o.Scripts +} + +// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetScriptsOk() (*[]Script, bool) { + if o == nil || o.Scripts == nil { + return nil, false + } + return &o.Scripts, true +} + +// HasScripts returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasScripts() bool { + return o != nil && o.Scripts != nil +} + +// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. +func (o *GetAppResponseDataAttributes) SetScripts(v []Script) { + o.Scripts = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *GetAppResponseDataAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseDataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *GetAppResponseDataAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *GetAppResponseDataAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o GetAppResponseDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Components != nil { + toSerialize["components"] = o.Components + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.EmbeddedQueries != nil { + toSerialize["embeddedQueries"] = o.EmbeddedQueries + } + if o.Favorite != nil { + toSerialize["favorite"] = o.Favorite + } + if o.InputSchema != nil { + toSerialize["inputSchema"] = o.InputSchema + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.RootInstanceName != nil { + toSerialize["rootInstanceName"] = o.RootInstanceName + } + if o.Scripts != nil { + toSerialize["scripts"] = o.Scripts + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *GetAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Components []ComponentGrid `json:"components,omitempty"` + Description *string `json:"description,omitempty"` + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + Favorite *bool `json:"favorite,omitempty"` + InputSchema *InputSchema `json:"inputSchema,omitempty"` + Name *string `json:"name,omitempty"` + RootInstanceName *string `json:"rootInstanceName,omitempty"` + Scripts []Script `json:"scripts,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "favorite", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + } else { + return err + } + + hasInvalidField := false + o.Components = all.Components + o.Description = all.Description + o.EmbeddedQueries = all.EmbeddedQueries + o.Favorite = all.Favorite + if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.InputSchema = all.InputSchema + o.Name = all.Name + o.RootInstanceName = all.RootInstanceName + o.Scripts = all.Scripts + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_get_app_response_data_type.go b/api/datadogV2/model_get_app_response_data_type.go new file mode 100644 index 00000000000..d1e8aafd18e --- /dev/null +++ b/api/datadogV2/model_get_app_response_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// GetAppResponseDataType The definition of `GetAppResponseDataType` object. +type GetAppResponseDataType string + +// List of GetAppResponseDataType. +const ( + GETAPPRESPONSEDATATYPE_APPDEFINITIONS GetAppResponseDataType = "appDefinitions" +) + +var allowedGetAppResponseDataTypeEnumValues = []GetAppResponseDataType{ + GETAPPRESPONSEDATATYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *GetAppResponseDataType) GetAllowedValues() []GetAppResponseDataType { + return allowedGetAppResponseDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *GetAppResponseDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = GetAppResponseDataType(value) + return nil +} + +// NewGetAppResponseDataTypeFromValue returns a pointer to a valid GetAppResponseDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewGetAppResponseDataTypeFromValue(v string) (*GetAppResponseDataType, error) { + ev := GetAppResponseDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for GetAppResponseDataType: valid values are %v", v, allowedGetAppResponseDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v GetAppResponseDataType) IsValid() bool { + for _, existing := range allowedGetAppResponseDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GetAppResponseDataType value. +func (v GetAppResponseDataType) Ptr() *GetAppResponseDataType { + return &v +} diff --git a/api/datadogV2/model_get_app_response_relationship.go b/api/datadogV2/model_get_app_response_relationship.go new file mode 100644 index 00000000000..00a2330e33e --- /dev/null +++ b/api/datadogV2/model_get_app_response_relationship.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// GetAppResponseRelationship The definition of `GetAppResponseRelationship` object. +type GetAppResponseRelationship struct { + // The `relationship` `connections`. + Connections []CustomConnection `json:"connections,omitempty"` + // The definition of `DeploymentRelationship` object. + Deployment *DeploymentRelationship `json:"deployment,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewGetAppResponseRelationship instantiates a new GetAppResponseRelationship object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewGetAppResponseRelationship() *GetAppResponseRelationship { + this := GetAppResponseRelationship{} + return &this +} + +// NewGetAppResponseRelationshipWithDefaults instantiates a new GetAppResponseRelationship object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewGetAppResponseRelationshipWithDefaults() *GetAppResponseRelationship { + this := GetAppResponseRelationship{} + return &this +} + +// GetConnections returns the Connections field value if set, zero value otherwise. +func (o *GetAppResponseRelationship) GetConnections() []CustomConnection { + if o == nil || o.Connections == nil { + var ret []CustomConnection + return ret + } + return o.Connections +} + +// GetConnectionsOk returns a tuple with the Connections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseRelationship) GetConnectionsOk() (*[]CustomConnection, bool) { + if o == nil || o.Connections == nil { + return nil, false + } + return &o.Connections, true +} + +// HasConnections returns a boolean if a field has been set. +func (o *GetAppResponseRelationship) HasConnections() bool { + return o != nil && o.Connections != nil +} + +// SetConnections gets a reference to the given []CustomConnection and assigns it to the Connections field. +func (o *GetAppResponseRelationship) SetConnections(v []CustomConnection) { + o.Connections = v +} + +// GetDeployment returns the Deployment field value if set, zero value otherwise. +func (o *GetAppResponseRelationship) GetDeployment() DeploymentRelationship { + if o == nil || o.Deployment == nil { + var ret DeploymentRelationship + return ret + } + return *o.Deployment +} + +// GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetAppResponseRelationship) GetDeploymentOk() (*DeploymentRelationship, bool) { + if o == nil || o.Deployment == nil { + return nil, false + } + return o.Deployment, true +} + +// HasDeployment returns a boolean if a field has been set. +func (o *GetAppResponseRelationship) HasDeployment() bool { + return o != nil && o.Deployment != nil +} + +// SetDeployment gets a reference to the given DeploymentRelationship and assigns it to the Deployment field. +func (o *GetAppResponseRelationship) SetDeployment(v DeploymentRelationship) { + o.Deployment = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o GetAppResponseRelationship) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Connections != nil { + toSerialize["connections"] = o.Connections + } + if o.Deployment != nil { + toSerialize["deployment"] = o.Deployment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *GetAppResponseRelationship) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Connections []CustomConnection `json:"connections,omitempty"` + Deployment *DeploymentRelationship `json:"deployment,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"connections", "deployment"}) + } else { + return err + } + + hasInvalidField := false + o.Connections = all.Connections + if all.Deployment != nil && all.Deployment.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Deployment = all.Deployment + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_input_schema.go b/api/datadogV2/model_input_schema.go new file mode 100644 index 00000000000..18b108661ed --- /dev/null +++ b/api/datadogV2/model_input_schema.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchema The definition of `InputSchema` object. +type InputSchema struct { + // The definition of `InputSchemaData` object. + Data *InputSchemaData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewInputSchema instantiates a new InputSchema object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewInputSchema() *InputSchema { + this := InputSchema{} + return &this +} + +// NewInputSchemaWithDefaults instantiates a new InputSchema object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewInputSchemaWithDefaults() *InputSchema { + this := InputSchema{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InputSchema) GetData() InputSchemaData { + if o == nil || o.Data == nil { + var ret InputSchemaData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchema) GetDataOk() (*InputSchemaData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InputSchema) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given InputSchemaData and assigns it to the Data field. +func (o *InputSchema) SetData(v InputSchemaData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o InputSchema) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *InputSchema) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *InputSchemaData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_input_schema_data.go b/api/datadogV2/model_input_schema_data.go new file mode 100644 index 00000000000..f970df66849 --- /dev/null +++ b/api/datadogV2/model_input_schema_data.go @@ -0,0 +1,189 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchemaData The definition of `InputSchemaData` object. +type InputSchemaData struct { + // The definition of `InputSchemaDataAttributes` object. + Attributes *InputSchemaDataAttributes `json:"attributes,omitempty"` + // The `data` `id`. + Id *string `json:"id,omitempty"` + // The definition of `InputSchemaDataType` object. + Type *InputSchemaDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewInputSchemaData instantiates a new InputSchemaData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewInputSchemaData() *InputSchemaData { + this := InputSchemaData{} + var typeVar InputSchemaDataType = INPUTSCHEMADATATYPE_INPUTSCHEMA + this.Type = &typeVar + return &this +} + +// NewInputSchemaDataWithDefaults instantiates a new InputSchemaData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewInputSchemaDataWithDefaults() *InputSchemaData { + this := InputSchemaData{} + var typeVar InputSchemaDataType = INPUTSCHEMADATATYPE_INPUTSCHEMA + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *InputSchemaData) GetAttributes() InputSchemaDataAttributes { + if o == nil || o.Attributes == nil { + var ret InputSchemaDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaData) GetAttributesOk() (*InputSchemaDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *InputSchemaData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given InputSchemaDataAttributes and assigns it to the Attributes field. +func (o *InputSchemaData) SetAttributes(v InputSchemaDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *InputSchemaData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *InputSchemaData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *InputSchemaData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InputSchemaData) GetType() InputSchemaDataType { + if o == nil || o.Type == nil { + var ret InputSchemaDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaData) GetTypeOk() (*InputSchemaDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *InputSchemaData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given InputSchemaDataType and assigns it to the Type field. +func (o *InputSchemaData) SetType(v InputSchemaDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o InputSchemaData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *InputSchemaData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *InputSchemaDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *InputSchemaDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_input_schema_data_attributes.go b/api/datadogV2/model_input_schema_data_attributes.go new file mode 100644 index 00000000000..9ef41a2872b --- /dev/null +++ b/api/datadogV2/model_input_schema_data_attributes.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchemaDataAttributes The definition of `InputSchemaDataAttributes` object. +type InputSchemaDataAttributes struct { + // The `attributes` `parameters`. + Parameters []InputSchemaDataAttributesParametersItems `json:"parameters,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewInputSchemaDataAttributes instantiates a new InputSchemaDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewInputSchemaDataAttributes() *InputSchemaDataAttributes { + this := InputSchemaDataAttributes{} + return &this +} + +// NewInputSchemaDataAttributesWithDefaults instantiates a new InputSchemaDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewInputSchemaDataAttributesWithDefaults() *InputSchemaDataAttributes { + this := InputSchemaDataAttributes{} + return &this +} + +// GetParameters returns the Parameters field value if set, zero value otherwise. +func (o *InputSchemaDataAttributes) GetParameters() []InputSchemaDataAttributesParametersItems { + if o == nil || o.Parameters == nil { + var ret []InputSchemaDataAttributesParametersItems + return ret + } + return o.Parameters +} + +// GetParametersOk returns a tuple with the Parameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributes) GetParametersOk() (*[]InputSchemaDataAttributesParametersItems, bool) { + if o == nil || o.Parameters == nil { + return nil, false + } + return &o.Parameters, true +} + +// HasParameters returns a boolean if a field has been set. +func (o *InputSchemaDataAttributes) HasParameters() bool { + return o != nil && o.Parameters != nil +} + +// SetParameters gets a reference to the given []InputSchemaDataAttributesParametersItems and assigns it to the Parameters field. +func (o *InputSchemaDataAttributes) SetParameters(v []InputSchemaDataAttributesParametersItems) { + o.Parameters = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o InputSchemaDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Parameters != nil { + toSerialize["parameters"] = o.Parameters + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *InputSchemaDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Parameters []InputSchemaDataAttributesParametersItems `json:"parameters,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"parameters"}) + } else { + return err + } + o.Parameters = all.Parameters + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_input_schema_data_attributes_parameters_items.go b/api/datadogV2/model_input_schema_data_attributes_parameters_items.go new file mode 100644 index 00000000000..7db82b0662e --- /dev/null +++ b/api/datadogV2/model_input_schema_data_attributes_parameters_items.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchemaDataAttributesParametersItems The definition of `InputSchemaDataAttributesParametersItems` object. +type InputSchemaDataAttributesParametersItems struct { + // The definition of `InputSchemaDataAttributesParametersItemsData` object. + Data *InputSchemaDataAttributesParametersItemsData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewInputSchemaDataAttributesParametersItems instantiates a new InputSchemaDataAttributesParametersItems object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewInputSchemaDataAttributesParametersItems() *InputSchemaDataAttributesParametersItems { + this := InputSchemaDataAttributesParametersItems{} + return &this +} + +// NewInputSchemaDataAttributesParametersItemsWithDefaults instantiates a new InputSchemaDataAttributesParametersItems object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewInputSchemaDataAttributesParametersItemsWithDefaults() *InputSchemaDataAttributesParametersItems { + this := InputSchemaDataAttributesParametersItems{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItems) GetData() InputSchemaDataAttributesParametersItemsData { + if o == nil || o.Data == nil { + var ret InputSchemaDataAttributesParametersItemsData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItems) GetDataOk() (*InputSchemaDataAttributesParametersItemsData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItems) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given InputSchemaDataAttributesParametersItemsData and assigns it to the Data field. +func (o *InputSchemaDataAttributesParametersItems) SetData(v InputSchemaDataAttributesParametersItemsData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o InputSchemaDataAttributesParametersItems) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *InputSchemaDataAttributesParametersItems) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *InputSchemaDataAttributesParametersItemsData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go b/api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go new file mode 100644 index 00000000000..7528f20dd7a --- /dev/null +++ b/api/datadogV2/model_input_schema_data_attributes_parameters_items_data.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchemaDataAttributesParametersItemsData The definition of `InputSchemaDataAttributesParametersItemsData` object. +type InputSchemaDataAttributesParametersItemsData struct { + // The definition of `InputSchemaDataAttributesParametersItemsDataAttributes` object. + Attributes *InputSchemaDataAttributesParametersItemsDataAttributes `json:"attributes,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewInputSchemaDataAttributesParametersItemsData instantiates a new InputSchemaDataAttributesParametersItemsData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewInputSchemaDataAttributesParametersItemsData() *InputSchemaDataAttributesParametersItemsData { + this := InputSchemaDataAttributesParametersItemsData{} + return &this +} + +// NewInputSchemaDataAttributesParametersItemsDataWithDefaults instantiates a new InputSchemaDataAttributesParametersItemsData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewInputSchemaDataAttributesParametersItemsDataWithDefaults() *InputSchemaDataAttributesParametersItemsData { + this := InputSchemaDataAttributesParametersItemsData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsData) GetAttributes() InputSchemaDataAttributesParametersItemsDataAttributes { + if o == nil || o.Attributes == nil { + var ret InputSchemaDataAttributesParametersItemsDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsData) GetAttributesOk() (*InputSchemaDataAttributesParametersItemsDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given InputSchemaDataAttributesParametersItemsDataAttributes and assigns it to the Attributes field. +func (o *InputSchemaDataAttributesParametersItemsData) SetAttributes(v InputSchemaDataAttributesParametersItemsDataAttributes) { + o.Attributes = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o InputSchemaDataAttributesParametersItemsData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *InputSchemaDataAttributesParametersItemsData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *InputSchemaDataAttributesParametersItemsDataAttributes `json:"attributes,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go b/api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go new file mode 100644 index 00000000000..d65dbc3734c --- /dev/null +++ b/api/datadogV2/model_input_schema_data_attributes_parameters_items_data_attributes.go @@ -0,0 +1,277 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchemaDataAttributesParametersItemsDataAttributes The definition of `InputSchemaDataAttributesParametersItemsDataAttributes` object. +type InputSchemaDataAttributesParametersItemsDataAttributes struct { + // The `attributes` `defaultValue`. + DefaultValue interface{} `json:"defaultValue,omitempty"` + // The `attributes` `description`. + Description *string `json:"description,omitempty"` + // The `attributes` `enum`. + Enum []string `json:"enum,omitempty"` + // The `attributes` `label`. + Label *string `json:"label,omitempty"` + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `type`. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewInputSchemaDataAttributesParametersItemsDataAttributes instantiates a new InputSchemaDataAttributesParametersItemsDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewInputSchemaDataAttributesParametersItemsDataAttributes() *InputSchemaDataAttributesParametersItemsDataAttributes { + this := InputSchemaDataAttributesParametersItemsDataAttributes{} + return &this +} + +// NewInputSchemaDataAttributesParametersItemsDataAttributesWithDefaults instantiates a new InputSchemaDataAttributesParametersItemsDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewInputSchemaDataAttributesParametersItemsDataAttributesWithDefaults() *InputSchemaDataAttributesParametersItemsDataAttributes { + this := InputSchemaDataAttributesParametersItemsDataAttributes{} + return &this +} + +// GetDefaultValue returns the DefaultValue field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDefaultValue() interface{} { + if o == nil || o.DefaultValue == nil { + var ret interface{} + return ret + } + return o.DefaultValue +} + +// GetDefaultValueOk returns a tuple with the DefaultValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDefaultValueOk() (*interface{}, bool) { + if o == nil || o.DefaultValue == nil { + return nil, false + } + return &o.DefaultValue, true +} + +// HasDefaultValue returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasDefaultValue() bool { + return o != nil && o.DefaultValue != nil +} + +// SetDefaultValue gets a reference to the given interface{} and assigns it to the DefaultValue field. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetDefaultValue(v interface{}) { + o.DefaultValue = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEnum returns the Enum field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetEnum() []string { + if o == nil || o.Enum == nil { + var ret []string + return ret + } + return o.Enum +} + +// GetEnumOk returns a tuple with the Enum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetEnumOk() (*[]string, bool) { + if o == nil || o.Enum == nil { + return nil, false + } + return &o.Enum, true +} + +// HasEnum returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasEnum() bool { + return o != nil && o.Enum != nil +} + +// SetEnum gets a reference to the given []string and assigns it to the Enum field. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetEnum(v []string) { + o.Enum = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetLabel() string { + if o == nil || o.Label == nil { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetLabelOk() (*string, bool) { + if o == nil || o.Label == nil { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasLabel() bool { + return o != nil && o.Label != nil +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetLabel(v string) { + o.Label = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o InputSchemaDataAttributesParametersItemsDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.DefaultValue != nil { + toSerialize["defaultValue"] = o.DefaultValue + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Enum != nil { + toSerialize["enum"] = o.Enum + } + if o.Label != nil { + toSerialize["label"] = o.Label + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *InputSchemaDataAttributesParametersItemsDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + DefaultValue interface{} `json:"defaultValue,omitempty"` + Description *string `json:"description,omitempty"` + Enum []string `json:"enum,omitempty"` + Label *string `json:"label,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"defaultValue", "description", "enum", "label", "name", "type"}) + } else { + return err + } + o.DefaultValue = all.DefaultValue + o.Description = all.Description + o.Enum = all.Enum + o.Label = all.Label + o.Name = all.Name + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_input_schema_data_type.go b/api/datadogV2/model_input_schema_data_type.go new file mode 100644 index 00000000000..273fecbcf45 --- /dev/null +++ b/api/datadogV2/model_input_schema_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// InputSchemaDataType The definition of `InputSchemaDataType` object. +type InputSchemaDataType string + +// List of InputSchemaDataType. +const ( + INPUTSCHEMADATATYPE_INPUTSCHEMA InputSchemaDataType = "inputSchema" +) + +var allowedInputSchemaDataTypeEnumValues = []InputSchemaDataType{ + INPUTSCHEMADATATYPE_INPUTSCHEMA, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *InputSchemaDataType) GetAllowedValues() []InputSchemaDataType { + return allowedInputSchemaDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *InputSchemaDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = InputSchemaDataType(value) + return nil +} + +// NewInputSchemaDataTypeFromValue returns a pointer to a valid InputSchemaDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewInputSchemaDataTypeFromValue(v string) (*InputSchemaDataType, error) { + ev := InputSchemaDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for InputSchemaDataType: valid values are %v", v, allowedInputSchemaDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v InputSchemaDataType) IsValid() bool { + for _, existing := range allowedInputSchemaDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InputSchemaDataType value. +func (v InputSchemaDataType) Ptr() *InputSchemaDataType { + return &v +} diff --git a/api/datadogV2/model_list_apps_response.go b/api/datadogV2/model_list_apps_response.go new file mode 100644 index 00000000000..1f2cf51e53d --- /dev/null +++ b/api/datadogV2/model_list_apps_response.go @@ -0,0 +1,181 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponse The definition of `ListAppsResponse` object. +type ListAppsResponse struct { + // The `ListAppsResponse` `data`. + Data []ListAppsResponseDataItems `json:"data,omitempty"` + // The `ListAppsResponse` `included`. + Included []DeploymentIncluded `json:"included,omitempty"` + // The definition of `ListAppsResponseMeta` object. + Meta *ListAppsResponseMeta `json:"meta,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppsResponse instantiates a new ListAppsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppsResponse() *ListAppsResponse { + this := ListAppsResponse{} + return &this +} + +// NewListAppsResponseWithDefaults instantiates a new ListAppsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppsResponseWithDefaults() *ListAppsResponse { + this := ListAppsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ListAppsResponse) GetData() []ListAppsResponseDataItems { + if o == nil || o.Data == nil { + var ret []ListAppsResponseDataItems + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponse) GetDataOk() (*[]ListAppsResponseDataItems, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ListAppsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []ListAppsResponseDataItems and assigns it to the Data field. +func (o *ListAppsResponse) SetData(v []ListAppsResponseDataItems) { + o.Data = v +} + +// GetIncluded returns the Included field value if set, zero value otherwise. +func (o *ListAppsResponse) GetIncluded() []DeploymentIncluded { + if o == nil || o.Included == nil { + var ret []DeploymentIncluded + return ret + } + return o.Included +} + +// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponse) GetIncludedOk() (*[]DeploymentIncluded, bool) { + if o == nil || o.Included == nil { + return nil, false + } + return &o.Included, true +} + +// HasIncluded returns a boolean if a field has been set. +func (o *ListAppsResponse) HasIncluded() bool { + return o != nil && o.Included != nil +} + +// SetIncluded gets a reference to the given []DeploymentIncluded and assigns it to the Included field. +func (o *ListAppsResponse) SetIncluded(v []DeploymentIncluded) { + o.Included = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *ListAppsResponse) GetMeta() ListAppsResponseMeta { + if o == nil || o.Meta == nil { + var ret ListAppsResponseMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponse) GetMetaOk() (*ListAppsResponseMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *ListAppsResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given ListAppsResponseMeta and assigns it to the Meta field. +func (o *ListAppsResponse) SetMeta(v ListAppsResponseMeta) { + o.Meta = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Included != nil { + toSerialize["included"] = o.Included + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []ListAppsResponseDataItems `json:"data,omitempty"` + Included []DeploymentIncluded `json:"included,omitempty"` + Meta *ListAppsResponseMeta `json:"meta,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included", "meta"}) + } else { + return err + } + + hasInvalidField := false + o.Data = all.Data + o.Included = all.Included + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_apps_response_data_items.go b/api/datadogV2/model_list_apps_response_data_items.go new file mode 100644 index 00000000000..dd1078b6625 --- /dev/null +++ b/api/datadogV2/model_list_apps_response_data_items.go @@ -0,0 +1,256 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponseDataItems The definition of `ListAppsResponseDataItems` object. +type ListAppsResponseDataItems struct { + // The definition of `ListAppsResponseDataItemsAttributes` object. + Attributes ListAppsResponseDataItemsAttributes `json:"attributes"` + // The `items` `id`. + Id string `json:"id"` + // The definition of `AppMeta` object. + Meta *AppMeta `json:"meta,omitempty"` + // The definition of `ListAppsResponseDataItemsRelationships` object. + Relationships *ListAppsResponseDataItemsRelationships `json:"relationships,omitempty"` + // The definition of `ListAppsResponseDataItemsType` object. + Type ListAppsResponseDataItemsType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppsResponseDataItems instantiates a new ListAppsResponseDataItems object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppsResponseDataItems(attributes ListAppsResponseDataItemsAttributes, id string, typeVar ListAppsResponseDataItemsType) *ListAppsResponseDataItems { + this := ListAppsResponseDataItems{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewListAppsResponseDataItemsWithDefaults instantiates a new ListAppsResponseDataItems object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppsResponseDataItemsWithDefaults() *ListAppsResponseDataItems { + this := ListAppsResponseDataItems{} + var typeVar ListAppsResponseDataItemsType = LISTAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *ListAppsResponseDataItems) GetAttributes() ListAppsResponseDataItemsAttributes { + if o == nil { + var ret ListAppsResponseDataItemsAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItems) GetAttributesOk() (*ListAppsResponseDataItemsAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *ListAppsResponseDataItems) SetAttributes(v ListAppsResponseDataItemsAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *ListAppsResponseDataItems) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItems) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *ListAppsResponseDataItems) SetId(v string) { + o.Id = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *ListAppsResponseDataItems) GetMeta() AppMeta { + if o == nil || o.Meta == nil { + var ret AppMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItems) GetMetaOk() (*AppMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *ListAppsResponseDataItems) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given AppMeta and assigns it to the Meta field. +func (o *ListAppsResponseDataItems) SetMeta(v AppMeta) { + o.Meta = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *ListAppsResponseDataItems) GetRelationships() ListAppsResponseDataItemsRelationships { + if o == nil || o.Relationships == nil { + var ret ListAppsResponseDataItemsRelationships + return ret + } + return *o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItems) GetRelationshipsOk() (*ListAppsResponseDataItemsRelationships, bool) { + if o == nil || o.Relationships == nil { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *ListAppsResponseDataItems) HasRelationships() bool { + return o != nil && o.Relationships != nil +} + +// SetRelationships gets a reference to the given ListAppsResponseDataItemsRelationships and assigns it to the Relationships field. +func (o *ListAppsResponseDataItems) SetRelationships(v ListAppsResponseDataItemsRelationships) { + o.Relationships = &v +} + +// GetType returns the Type field value. +func (o *ListAppsResponseDataItems) GetType() ListAppsResponseDataItemsType { + if o == nil { + var ret ListAppsResponseDataItemsType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItems) GetTypeOk() (*ListAppsResponseDataItemsType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *ListAppsResponseDataItems) SetType(v ListAppsResponseDataItemsType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppsResponseDataItems) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Relationships != nil { + toSerialize["relationships"] = o.Relationships + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppsResponseDataItems) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ListAppsResponseDataItemsAttributes `json:"attributes"` + Id *string `json:"id"` + Meta *AppMeta `json:"meta,omitempty"` + Relationships *ListAppsResponseDataItemsRelationships `json:"relationships,omitempty"` + Type *ListAppsResponseDataItemsType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "meta", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = all.Relationships + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_apps_response_data_items_attributes.go b/api/datadogV2/model_list_apps_response_data_items_attributes.go new file mode 100644 index 00000000000..a7edcbe6ff0 --- /dev/null +++ b/api/datadogV2/model_list_apps_response_data_items_attributes.go @@ -0,0 +1,242 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponseDataItemsAttributes The definition of `ListAppsResponseDataItemsAttributes` object. +type ListAppsResponseDataItemsAttributes struct { + // The `attributes` `description`. + Description *string `json:"description,omitempty"` + // The `attributes` `favorite`. + Favorite *bool `json:"favorite,omitempty"` + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `selfService`. + SelfService *bool `json:"selfService,omitempty"` + // The `attributes` `tags`. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppsResponseDataItemsAttributes instantiates a new ListAppsResponseDataItemsAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppsResponseDataItemsAttributes() *ListAppsResponseDataItemsAttributes { + this := ListAppsResponseDataItemsAttributes{} + return &this +} + +// NewListAppsResponseDataItemsAttributesWithDefaults instantiates a new ListAppsResponseDataItemsAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppsResponseDataItemsAttributesWithDefaults() *ListAppsResponseDataItemsAttributes { + this := ListAppsResponseDataItemsAttributes{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ListAppsResponseDataItemsAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItemsAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ListAppsResponseDataItemsAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ListAppsResponseDataItemsAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetFavorite returns the Favorite field value if set, zero value otherwise. +func (o *ListAppsResponseDataItemsAttributes) GetFavorite() bool { + if o == nil || o.Favorite == nil { + var ret bool + return ret + } + return *o.Favorite +} + +// GetFavoriteOk returns a tuple with the Favorite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItemsAttributes) GetFavoriteOk() (*bool, bool) { + if o == nil || o.Favorite == nil { + return nil, false + } + return o.Favorite, true +} + +// HasFavorite returns a boolean if a field has been set. +func (o *ListAppsResponseDataItemsAttributes) HasFavorite() bool { + return o != nil && o.Favorite != nil +} + +// SetFavorite gets a reference to the given bool and assigns it to the Favorite field. +func (o *ListAppsResponseDataItemsAttributes) SetFavorite(v bool) { + o.Favorite = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ListAppsResponseDataItemsAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItemsAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ListAppsResponseDataItemsAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ListAppsResponseDataItemsAttributes) SetName(v string) { + o.Name = &v +} + +// GetSelfService returns the SelfService field value if set, zero value otherwise. +func (o *ListAppsResponseDataItemsAttributes) GetSelfService() bool { + if o == nil || o.SelfService == nil { + var ret bool + return ret + } + return *o.SelfService +} + +// GetSelfServiceOk returns a tuple with the SelfService field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItemsAttributes) GetSelfServiceOk() (*bool, bool) { + if o == nil || o.SelfService == nil { + return nil, false + } + return o.SelfService, true +} + +// HasSelfService returns a boolean if a field has been set. +func (o *ListAppsResponseDataItemsAttributes) HasSelfService() bool { + return o != nil && o.SelfService != nil +} + +// SetSelfService gets a reference to the given bool and assigns it to the SelfService field. +func (o *ListAppsResponseDataItemsAttributes) SetSelfService(v bool) { + o.SelfService = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *ListAppsResponseDataItemsAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItemsAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *ListAppsResponseDataItemsAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *ListAppsResponseDataItemsAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppsResponseDataItemsAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Favorite != nil { + toSerialize["favorite"] = o.Favorite + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.SelfService != nil { + toSerialize["selfService"] = o.SelfService + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppsResponseDataItemsAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Favorite *bool `json:"favorite,omitempty"` + Name *string `json:"name,omitempty"` + SelfService *bool `json:"selfService,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "favorite", "name", "selfService", "tags"}) + } else { + return err + } + o.Description = all.Description + o.Favorite = all.Favorite + o.Name = all.Name + o.SelfService = all.SelfService + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_list_apps_response_data_items_relationships.go b/api/datadogV2/model_list_apps_response_data_items_relationships.go new file mode 100644 index 00000000000..8ceabf1cc8a --- /dev/null +++ b/api/datadogV2/model_list_apps_response_data_items_relationships.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponseDataItemsRelationships The definition of `ListAppsResponseDataItemsRelationships` object. +type ListAppsResponseDataItemsRelationships struct { + // The definition of `DeploymentRelationship` object. + Deployment *DeploymentRelationship `json:"deployment,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppsResponseDataItemsRelationships instantiates a new ListAppsResponseDataItemsRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppsResponseDataItemsRelationships() *ListAppsResponseDataItemsRelationships { + this := ListAppsResponseDataItemsRelationships{} + return &this +} + +// NewListAppsResponseDataItemsRelationshipsWithDefaults instantiates a new ListAppsResponseDataItemsRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppsResponseDataItemsRelationshipsWithDefaults() *ListAppsResponseDataItemsRelationships { + this := ListAppsResponseDataItemsRelationships{} + return &this +} + +// GetDeployment returns the Deployment field value if set, zero value otherwise. +func (o *ListAppsResponseDataItemsRelationships) GetDeployment() DeploymentRelationship { + if o == nil || o.Deployment == nil { + var ret DeploymentRelationship + return ret + } + return *o.Deployment +} + +// GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseDataItemsRelationships) GetDeploymentOk() (*DeploymentRelationship, bool) { + if o == nil || o.Deployment == nil { + return nil, false + } + return o.Deployment, true +} + +// HasDeployment returns a boolean if a field has been set. +func (o *ListAppsResponseDataItemsRelationships) HasDeployment() bool { + return o != nil && o.Deployment != nil +} + +// SetDeployment gets a reference to the given DeploymentRelationship and assigns it to the Deployment field. +func (o *ListAppsResponseDataItemsRelationships) SetDeployment(v DeploymentRelationship) { + o.Deployment = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppsResponseDataItemsRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Deployment != nil { + toSerialize["deployment"] = o.Deployment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppsResponseDataItemsRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Deployment *DeploymentRelationship `json:"deployment,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"deployment"}) + } else { + return err + } + + hasInvalidField := false + if all.Deployment != nil && all.Deployment.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Deployment = all.Deployment + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_apps_response_data_items_type.go b/api/datadogV2/model_list_apps_response_data_items_type.go new file mode 100644 index 00000000000..6f157cea851 --- /dev/null +++ b/api/datadogV2/model_list_apps_response_data_items_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponseDataItemsType The definition of `ListAppsResponseDataItemsType` object. +type ListAppsResponseDataItemsType string + +// List of ListAppsResponseDataItemsType. +const ( + LISTAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS ListAppsResponseDataItemsType = "appDefinitions" +) + +var allowedListAppsResponseDataItemsTypeEnumValues = []ListAppsResponseDataItemsType{ + LISTAPPSRESPONSEDATAITEMSTYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ListAppsResponseDataItemsType) GetAllowedValues() []ListAppsResponseDataItemsType { + return allowedListAppsResponseDataItemsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ListAppsResponseDataItemsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ListAppsResponseDataItemsType(value) + return nil +} + +// NewListAppsResponseDataItemsTypeFromValue returns a pointer to a valid ListAppsResponseDataItemsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewListAppsResponseDataItemsTypeFromValue(v string) (*ListAppsResponseDataItemsType, error) { + ev := ListAppsResponseDataItemsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ListAppsResponseDataItemsType: valid values are %v", v, allowedListAppsResponseDataItemsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ListAppsResponseDataItemsType) IsValid() bool { + for _, existing := range allowedListAppsResponseDataItemsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ListAppsResponseDataItemsType value. +func (v ListAppsResponseDataItemsType) Ptr() *ListAppsResponseDataItemsType { + return &v +} diff --git a/api/datadogV2/model_list_apps_response_meta.go b/api/datadogV2/model_list_apps_response_meta.go new file mode 100644 index 00000000000..ea9d49594a5 --- /dev/null +++ b/api/datadogV2/model_list_apps_response_meta.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponseMeta The definition of `ListAppsResponseMeta` object. +type ListAppsResponseMeta struct { + // The definition of `ListAppsResponseMetaPage` object. + Page *ListAppsResponseMetaPage `json:"page,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppsResponseMeta instantiates a new ListAppsResponseMeta object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppsResponseMeta() *ListAppsResponseMeta { + this := ListAppsResponseMeta{} + return &this +} + +// NewListAppsResponseMetaWithDefaults instantiates a new ListAppsResponseMeta object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppsResponseMetaWithDefaults() *ListAppsResponseMeta { + this := ListAppsResponseMeta{} + return &this +} + +// GetPage returns the Page field value if set, zero value otherwise. +func (o *ListAppsResponseMeta) GetPage() ListAppsResponseMetaPage { + if o == nil || o.Page == nil { + var ret ListAppsResponseMetaPage + return ret + } + return *o.Page +} + +// GetPageOk returns a tuple with the Page field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseMeta) GetPageOk() (*ListAppsResponseMetaPage, bool) { + if o == nil || o.Page == nil { + return nil, false + } + return o.Page, true +} + +// HasPage returns a boolean if a field has been set. +func (o *ListAppsResponseMeta) HasPage() bool { + return o != nil && o.Page != nil +} + +// SetPage gets a reference to the given ListAppsResponseMetaPage and assigns it to the Page field. +func (o *ListAppsResponseMeta) SetPage(v ListAppsResponseMetaPage) { + o.Page = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppsResponseMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Page != nil { + toSerialize["page"] = o.Page + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppsResponseMeta) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Page *ListAppsResponseMetaPage `json:"page,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"page"}) + } else { + return err + } + + hasInvalidField := false + if all.Page != nil && all.Page.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Page = all.Page + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_list_apps_response_meta_page.go b/api/datadogV2/model_list_apps_response_meta_page.go new file mode 100644 index 00000000000..138d720fdf8 --- /dev/null +++ b/api/datadogV2/model_list_apps_response_meta_page.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ListAppsResponseMetaPage The definition of `ListAppsResponseMetaPage` object. +type ListAppsResponseMetaPage struct { + // The `page` `totalCount`. + TotalCount *int64 `json:"totalCount,omitempty"` + // The `page` `totalFilteredCount`. + TotalFilteredCount *int64 `json:"totalFilteredCount,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewListAppsResponseMetaPage instantiates a new ListAppsResponseMetaPage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewListAppsResponseMetaPage() *ListAppsResponseMetaPage { + this := ListAppsResponseMetaPage{} + return &this +} + +// NewListAppsResponseMetaPageWithDefaults instantiates a new ListAppsResponseMetaPage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewListAppsResponseMetaPageWithDefaults() *ListAppsResponseMetaPage { + this := ListAppsResponseMetaPage{} + return &this +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise. +func (o *ListAppsResponseMetaPage) GetTotalCount() int64 { + if o == nil || o.TotalCount == nil { + var ret int64 + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseMetaPage) GetTotalCountOk() (*int64, bool) { + if o == nil || o.TotalCount == nil { + return nil, false + } + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *ListAppsResponseMetaPage) HasTotalCount() bool { + return o != nil && o.TotalCount != nil +} + +// SetTotalCount gets a reference to the given int64 and assigns it to the TotalCount field. +func (o *ListAppsResponseMetaPage) SetTotalCount(v int64) { + o.TotalCount = &v +} + +// GetTotalFilteredCount returns the TotalFilteredCount field value if set, zero value otherwise. +func (o *ListAppsResponseMetaPage) GetTotalFilteredCount() int64 { + if o == nil || o.TotalFilteredCount == nil { + var ret int64 + return ret + } + return *o.TotalFilteredCount +} + +// GetTotalFilteredCountOk returns a tuple with the TotalFilteredCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListAppsResponseMetaPage) GetTotalFilteredCountOk() (*int64, bool) { + if o == nil || o.TotalFilteredCount == nil { + return nil, false + } + return o.TotalFilteredCount, true +} + +// HasTotalFilteredCount returns a boolean if a field has been set. +func (o *ListAppsResponseMetaPage) HasTotalFilteredCount() bool { + return o != nil && o.TotalFilteredCount != nil +} + +// SetTotalFilteredCount gets a reference to the given int64 and assigns it to the TotalFilteredCount field. +func (o *ListAppsResponseMetaPage) SetTotalFilteredCount(v int64) { + o.TotalFilteredCount = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ListAppsResponseMetaPage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.TotalCount != nil { + toSerialize["totalCount"] = o.TotalCount + } + if o.TotalFilteredCount != nil { + toSerialize["totalFilteredCount"] = o.TotalFilteredCount + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ListAppsResponseMetaPage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + TotalCount *int64 `json:"totalCount,omitempty"` + TotalFilteredCount *int64 `json:"totalFilteredCount,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"totalCount", "totalFilteredCount"}) + } else { + return err + } + o.TotalCount = all.TotalCount + o.TotalFilteredCount = all.TotalFilteredCount + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_query.go b/api/datadogV2/model_query.go new file mode 100644 index 00000000000..1f2c4eb8f4a --- /dev/null +++ b/api/datadogV2/model_query.go @@ -0,0 +1,245 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// Query The definition of `Query` object. +type Query struct { + // The `Query` `events`. + Events []AppBuilderEvent `json:"events,omitempty"` + // The `Query` `id`. + Id string `json:"id"` + // The `Query` `name`. + Name string `json:"name"` + // The `Query` `properties`. + Properties interface{} `json:"properties,omitempty"` + // The definition of `QueryType` object. + Type QueryType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewQuery instantiates a new Query object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewQuery(id string, name string, typeVar QueryType) *Query { + this := Query{} + this.Id = id + this.Name = name + this.Type = typeVar + return &this +} + +// NewQueryWithDefaults instantiates a new Query object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewQueryWithDefaults() *Query { + this := Query{} + return &this +} + +// GetEvents returns the Events field value if set, zero value otherwise. +func (o *Query) GetEvents() []AppBuilderEvent { + if o == nil || o.Events == nil { + var ret []AppBuilderEvent + return ret + } + return o.Events +} + +// GetEventsOk returns a tuple with the Events field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Query) GetEventsOk() (*[]AppBuilderEvent, bool) { + if o == nil || o.Events == nil { + return nil, false + } + return &o.Events, true +} + +// HasEvents returns a boolean if a field has been set. +func (o *Query) HasEvents() bool { + return o != nil && o.Events != nil +} + +// SetEvents gets a reference to the given []AppBuilderEvent and assigns it to the Events field. +func (o *Query) SetEvents(v []AppBuilderEvent) { + o.Events = v +} + +// GetId returns the Id field value. +func (o *Query) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Query) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *Query) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value. +func (o *Query) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Query) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *Query) SetName(v string) { + o.Name = v +} + +// GetProperties returns the Properties field value if set, zero value otherwise. +func (o *Query) GetProperties() interface{} { + if o == nil || o.Properties == nil { + var ret interface{} + return ret + } + return o.Properties +} + +// GetPropertiesOk returns a tuple with the Properties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Query) GetPropertiesOk() (*interface{}, bool) { + if o == nil || o.Properties == nil { + return nil, false + } + return &o.Properties, true +} + +// HasProperties returns a boolean if a field has been set. +func (o *Query) HasProperties() bool { + return o != nil && o.Properties != nil +} + +// SetProperties gets a reference to the given interface{} and assigns it to the Properties field. +func (o *Query) SetProperties(v interface{}) { + o.Properties = v +} + +// GetType returns the Type field value. +func (o *Query) GetType() QueryType { + if o == nil { + var ret QueryType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Query) GetTypeOk() (*QueryType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *Query) SetType(v QueryType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o Query) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Events != nil { + toSerialize["events"] = o.Events + } + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if o.Properties != nil { + toSerialize["properties"] = o.Properties + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *Query) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Events []AppBuilderEvent `json:"events,omitempty"` + Id *string `json:"id"` + Name *string `json:"name"` + Properties interface{} `json:"properties,omitempty"` + Type *QueryType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"events", "id", "name", "properties", "type"}) + } else { + return err + } + + hasInvalidField := false + o.Events = all.Events + o.Id = *all.Id + o.Name = *all.Name + o.Properties = all.Properties + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_query_type.go b/api/datadogV2/model_query_type.go new file mode 100644 index 00000000000..53beb4bb63c --- /dev/null +++ b/api/datadogV2/model_query_type.go @@ -0,0 +1,68 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// QueryType The definition of `QueryType` object. +type QueryType string + +// List of QueryType. +const ( + QUERYTYPE_ACTION QueryType = "action" + QUERYTYPE_STATEVARIABLE QueryType = "stateVariable" + QUERYTYPE_DATATRANSFORM QueryType = "dataTransform" +) + +var allowedQueryTypeEnumValues = []QueryType{ + QUERYTYPE_ACTION, + QUERYTYPE_STATEVARIABLE, + QUERYTYPE_DATATRANSFORM, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *QueryType) GetAllowedValues() []QueryType { + return allowedQueryTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *QueryType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = QueryType(value) + return nil +} + +// NewQueryTypeFromValue returns a pointer to a valid QueryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewQueryTypeFromValue(v string) (*QueryType, error) { + ev := QueryType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for QueryType: valid values are %v", v, allowedQueryTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v QueryType) IsValid() bool { + for _, existing := range allowedQueryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to QueryType value. +func (v QueryType) Ptr() *QueryType { + return &v +} diff --git a/api/datadogV2/model_script.go b/api/datadogV2/model_script.go new file mode 100644 index 00000000000..db9fd9f05f9 --- /dev/null +++ b/api/datadogV2/model_script.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// Script The definition of `Script` object. +type Script struct { + // The definition of `ScriptData` object. + Data *ScriptData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScript instantiates a new Script object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScript() *Script { + this := Script{} + return &this +} + +// NewScriptWithDefaults instantiates a new Script object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScriptWithDefaults() *Script { + this := Script{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *Script) GetData() ScriptData { + if o == nil || o.Data == nil { + var ret ScriptData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Script) GetDataOk() (*ScriptData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *Script) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given ScriptData and assigns it to the Data field. +func (o *Script) SetData(v ScriptData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o Script) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *Script) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *ScriptData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_script_data.go b/api/datadogV2/model_script_data.go new file mode 100644 index 00000000000..1dea53d9e00 --- /dev/null +++ b/api/datadogV2/model_script_data.go @@ -0,0 +1,189 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScriptData The definition of `ScriptData` object. +type ScriptData struct { + // The definition of `ScriptDataAttributes` object. + Attributes *ScriptDataAttributes `json:"attributes,omitempty"` + // The `data` `id`. + Id *string `json:"id,omitempty"` + // The definition of `ScriptDataType` object. + Type *ScriptDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScriptData instantiates a new ScriptData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScriptData() *ScriptData { + this := ScriptData{} + var typeVar ScriptDataType = SCRIPTDATATYPE_SCRIPTS + this.Type = &typeVar + return &this +} + +// NewScriptDataWithDefaults instantiates a new ScriptData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScriptDataWithDefaults() *ScriptData { + this := ScriptData{} + var typeVar ScriptDataType = SCRIPTDATATYPE_SCRIPTS + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *ScriptData) GetAttributes() ScriptDataAttributes { + if o == nil || o.Attributes == nil { + var ret ScriptDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScriptData) GetAttributesOk() (*ScriptDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *ScriptData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given ScriptDataAttributes and assigns it to the Attributes field. +func (o *ScriptData) SetAttributes(v ScriptDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ScriptData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScriptData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *ScriptData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *ScriptData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ScriptData) GetType() ScriptDataType { + if o == nil || o.Type == nil { + var ret ScriptDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScriptData) GetTypeOk() (*ScriptDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ScriptData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given ScriptDataType and assigns it to the Type field. +func (o *ScriptData) SetType(v ScriptDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScriptData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScriptData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *ScriptDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *ScriptDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_script_data_attributes.go b/api/datadogV2/model_script_data_attributes.go new file mode 100644 index 00000000000..ac04b81da46 --- /dev/null +++ b/api/datadogV2/model_script_data_attributes.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScriptDataAttributes The definition of `ScriptDataAttributes` object. +type ScriptDataAttributes struct { + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `src`. + Src *string `json:"src,omitempty"` + // The `attributes` `type`. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewScriptDataAttributes instantiates a new ScriptDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewScriptDataAttributes() *ScriptDataAttributes { + this := ScriptDataAttributes{} + return &this +} + +// NewScriptDataAttributesWithDefaults instantiates a new ScriptDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewScriptDataAttributesWithDefaults() *ScriptDataAttributes { + this := ScriptDataAttributes{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ScriptDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScriptDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ScriptDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ScriptDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetSrc returns the Src field value if set, zero value otherwise. +func (o *ScriptDataAttributes) GetSrc() string { + if o == nil || o.Src == nil { + var ret string + return ret + } + return *o.Src +} + +// GetSrcOk returns a tuple with the Src field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScriptDataAttributes) GetSrcOk() (*string, bool) { + if o == nil || o.Src == nil { + return nil, false + } + return o.Src, true +} + +// HasSrc returns a boolean if a field has been set. +func (o *ScriptDataAttributes) HasSrc() bool { + return o != nil && o.Src != nil +} + +// SetSrc gets a reference to the given string and assigns it to the Src field. +func (o *ScriptDataAttributes) SetSrc(v string) { + o.Src = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *ScriptDataAttributes) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScriptDataAttributes) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ScriptDataAttributes) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ScriptDataAttributes) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o ScriptDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Src != nil { + toSerialize["src"] = o.Src + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *ScriptDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + Src *string `json:"src,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "src", "type"}) + } else { + return err + } + o.Name = all.Name + o.Src = all.Src + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_script_data_type.go b/api/datadogV2/model_script_data_type.go new file mode 100644 index 00000000000..9820d9fc26e --- /dev/null +++ b/api/datadogV2/model_script_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// ScriptDataType The definition of `ScriptDataType` object. +type ScriptDataType string + +// List of ScriptDataType. +const ( + SCRIPTDATATYPE_SCRIPTS ScriptDataType = "scripts" +) + +var allowedScriptDataTypeEnumValues = []ScriptDataType{ + SCRIPTDATATYPE_SCRIPTS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *ScriptDataType) GetAllowedValues() []ScriptDataType { + return allowedScriptDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *ScriptDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = ScriptDataType(value) + return nil +} + +// NewScriptDataTypeFromValue returns a pointer to a valid ScriptDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewScriptDataTypeFromValue(v string) (*ScriptDataType, error) { + ev := ScriptDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for ScriptDataType: valid values are %v", v, allowedScriptDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v ScriptDataType) IsValid() bool { + for _, existing := range allowedScriptDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ScriptDataType value. +func (v ScriptDataType) Ptr() *ScriptDataType { + return &v +} diff --git a/api/datadogV2/model_update_app_request.go b/api/datadogV2/model_update_app_request.go new file mode 100644 index 00000000000..0b215d43b9f --- /dev/null +++ b/api/datadogV2/model_update_app_request.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppRequest The definition of `UpdateAppRequest` object. +type UpdateAppRequest struct { + // The definition of `UpdateAppRequestData` object. + Data *UpdateAppRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppRequest instantiates a new UpdateAppRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppRequest() *UpdateAppRequest { + this := UpdateAppRequest{} + return &this +} + +// NewUpdateAppRequestWithDefaults instantiates a new UpdateAppRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppRequestWithDefaults() *UpdateAppRequest { + this := UpdateAppRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppRequest) GetData() UpdateAppRequestData { + if o == nil || o.Data == nil { + var ret UpdateAppRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequest) GetDataOk() (*UpdateAppRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppRequestData and assigns it to the Data field. +func (o *UpdateAppRequest) SetData(v UpdateAppRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_request_data.go b/api/datadogV2/model_update_app_request_data.go new file mode 100644 index 00000000000..70216e58329 --- /dev/null +++ b/api/datadogV2/model_update_app_request_data.go @@ -0,0 +1,186 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppRequestData The definition of `UpdateAppRequestData` object. +type UpdateAppRequestData struct { + // The definition of `UpdateAppRequestDataAttributes` object. + Attributes *UpdateAppRequestDataAttributes `json:"attributes,omitempty"` + // The `data` `id`. + Id *string `json:"id,omitempty"` + // The definition of `UpdateAppRequestDataType` object. + Type UpdateAppRequestDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppRequestData instantiates a new UpdateAppRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppRequestData(typeVar UpdateAppRequestDataType) *UpdateAppRequestData { + this := UpdateAppRequestData{} + this.Type = typeVar + return &this +} + +// NewUpdateAppRequestDataWithDefaults instantiates a new UpdateAppRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppRequestDataWithDefaults() *UpdateAppRequestData { + this := UpdateAppRequestData{} + var typeVar UpdateAppRequestDataType = UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UpdateAppRequestData) GetAttributes() UpdateAppRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret UpdateAppRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestData) GetAttributesOk() (*UpdateAppRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UpdateAppRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given UpdateAppRequestDataAttributes and assigns it to the Attributes field. +func (o *UpdateAppRequestData) SetAttributes(v UpdateAppRequestDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateAppRequestData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateAppRequestData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateAppRequestData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value. +func (o *UpdateAppRequestData) GetType() UpdateAppRequestDataType { + if o == nil { + var ret UpdateAppRequestDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestData) GetTypeOk() (*UpdateAppRequestDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *UpdateAppRequestData) SetType(v UpdateAppRequestDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppRequestDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *UpdateAppRequestDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_request_data_attributes.go b/api/datadogV2/model_update_app_request_data_attributes.go new file mode 100644 index 00000000000..32787644d78 --- /dev/null +++ b/api/datadogV2/model_update_app_request_data_attributes.go @@ -0,0 +1,356 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppRequestDataAttributes The definition of `UpdateAppRequestDataAttributes` object. +type UpdateAppRequestDataAttributes struct { + // The `attributes` `components`. + Components []ComponentGrid `json:"components,omitempty"` + // The `attributes` `description`. + Description *string `json:"description,omitempty"` + // The `attributes` `embeddedQueries`. + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + // The definition of `InputSchema` object. + InputSchema *InputSchema `json:"inputSchema,omitempty"` + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `rootInstanceName`. + RootInstanceName *string `json:"rootInstanceName,omitempty"` + // The `attributes` `scripts`. + Scripts []Script `json:"scripts,omitempty"` + // The `attributes` `tags`. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppRequestDataAttributes instantiates a new UpdateAppRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppRequestDataAttributes() *UpdateAppRequestDataAttributes { + this := UpdateAppRequestDataAttributes{} + return &this +} + +// NewUpdateAppRequestDataAttributesWithDefaults instantiates a new UpdateAppRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppRequestDataAttributesWithDefaults() *UpdateAppRequestDataAttributes { + this := UpdateAppRequestDataAttributes{} + return &this +} + +// GetComponents returns the Components field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetComponents() []ComponentGrid { + if o == nil || o.Components == nil { + var ret []ComponentGrid + return ret + } + return o.Components +} + +// GetComponentsOk returns a tuple with the Components field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetComponentsOk() (*[]ComponentGrid, bool) { + if o == nil || o.Components == nil { + return nil, false + } + return &o.Components, true +} + +// HasComponents returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasComponents() bool { + return o != nil && o.Components != nil +} + +// SetComponents gets a reference to the given []ComponentGrid and assigns it to the Components field. +func (o *UpdateAppRequestDataAttributes) SetComponents(v []ComponentGrid) { + o.Components = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateAppRequestDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEmbeddedQueries returns the EmbeddedQueries field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetEmbeddedQueries() []Query { + if o == nil || o.EmbeddedQueries == nil { + var ret []Query + return ret + } + return o.EmbeddedQueries +} + +// GetEmbeddedQueriesOk returns a tuple with the EmbeddedQueries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetEmbeddedQueriesOk() (*[]Query, bool) { + if o == nil || o.EmbeddedQueries == nil { + return nil, false + } + return &o.EmbeddedQueries, true +} + +// HasEmbeddedQueries returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasEmbeddedQueries() bool { + return o != nil && o.EmbeddedQueries != nil +} + +// SetEmbeddedQueries gets a reference to the given []Query and assigns it to the EmbeddedQueries field. +func (o *UpdateAppRequestDataAttributes) SetEmbeddedQueries(v []Query) { + o.EmbeddedQueries = v +} + +// GetInputSchema returns the InputSchema field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetInputSchema() InputSchema { + if o == nil || o.InputSchema == nil { + var ret InputSchema + return ret + } + return *o.InputSchema +} + +// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { + if o == nil || o.InputSchema == nil { + return nil, false + } + return o.InputSchema, true +} + +// HasInputSchema returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasInputSchema() bool { + return o != nil && o.InputSchema != nil +} + +// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. +func (o *UpdateAppRequestDataAttributes) SetInputSchema(v InputSchema) { + o.InputSchema = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateAppRequestDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetRootInstanceName returns the RootInstanceName field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetRootInstanceName() string { + if o == nil || o.RootInstanceName == nil { + var ret string + return ret + } + return *o.RootInstanceName +} + +// GetRootInstanceNameOk returns a tuple with the RootInstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetRootInstanceNameOk() (*string, bool) { + if o == nil || o.RootInstanceName == nil { + return nil, false + } + return o.RootInstanceName, true +} + +// HasRootInstanceName returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasRootInstanceName() bool { + return o != nil && o.RootInstanceName != nil +} + +// SetRootInstanceName gets a reference to the given string and assigns it to the RootInstanceName field. +func (o *UpdateAppRequestDataAttributes) SetRootInstanceName(v string) { + o.RootInstanceName = &v +} + +// GetScripts returns the Scripts field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetScripts() []Script { + if o == nil || o.Scripts == nil { + var ret []Script + return ret + } + return o.Scripts +} + +// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetScriptsOk() (*[]Script, bool) { + if o == nil || o.Scripts == nil { + return nil, false + } + return &o.Scripts, true +} + +// HasScripts returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasScripts() bool { + return o != nil && o.Scripts != nil +} + +// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. +func (o *UpdateAppRequestDataAttributes) SetScripts(v []Script) { + o.Scripts = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *UpdateAppRequestDataAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppRequestDataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *UpdateAppRequestDataAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *UpdateAppRequestDataAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Components != nil { + toSerialize["components"] = o.Components + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.EmbeddedQueries != nil { + toSerialize["embeddedQueries"] = o.EmbeddedQueries + } + if o.InputSchema != nil { + toSerialize["inputSchema"] = o.InputSchema + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.RootInstanceName != nil { + toSerialize["rootInstanceName"] = o.RootInstanceName + } + if o.Scripts != nil { + toSerialize["scripts"] = o.Scripts + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Components []ComponentGrid `json:"components,omitempty"` + Description *string `json:"description,omitempty"` + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + InputSchema *InputSchema `json:"inputSchema,omitempty"` + Name *string `json:"name,omitempty"` + RootInstanceName *string `json:"rootInstanceName,omitempty"` + Scripts []Script `json:"scripts,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + } else { + return err + } + + hasInvalidField := false + o.Components = all.Components + o.Description = all.Description + o.EmbeddedQueries = all.EmbeddedQueries + if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.InputSchema = all.InputSchema + o.Name = all.Name + o.RootInstanceName = all.RootInstanceName + o.Scripts = all.Scripts + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_request_data_type.go b/api/datadogV2/model_update_app_request_data_type.go new file mode 100644 index 00000000000..76a45480754 --- /dev/null +++ b/api/datadogV2/model_update_app_request_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppRequestDataType The definition of `UpdateAppRequestDataType` object. +type UpdateAppRequestDataType string + +// List of UpdateAppRequestDataType. +const ( + UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS UpdateAppRequestDataType = "appDefinitions" +) + +var allowedUpdateAppRequestDataTypeEnumValues = []UpdateAppRequestDataType{ + UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *UpdateAppRequestDataType) GetAllowedValues() []UpdateAppRequestDataType { + return allowedUpdateAppRequestDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *UpdateAppRequestDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = UpdateAppRequestDataType(value) + return nil +} + +// NewUpdateAppRequestDataTypeFromValue returns a pointer to a valid UpdateAppRequestDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewUpdateAppRequestDataTypeFromValue(v string) (*UpdateAppRequestDataType, error) { + ev := UpdateAppRequestDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for UpdateAppRequestDataType: valid values are %v", v, allowedUpdateAppRequestDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v UpdateAppRequestDataType) IsValid() bool { + for _, existing := range allowedUpdateAppRequestDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateAppRequestDataType value. +func (v UpdateAppRequestDataType) Ptr() *UpdateAppRequestDataType { + return &v +} diff --git a/api/datadogV2/model_update_app_response.go b/api/datadogV2/model_update_app_response.go new file mode 100644 index 00000000000..b3cf8e54ba3 --- /dev/null +++ b/api/datadogV2/model_update_app_response.go @@ -0,0 +1,222 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppResponse The definition of `UpdateAppResponse` object. +type UpdateAppResponse struct { + // The definition of `UpdateAppResponseData` object. + Data *UpdateAppResponseData `json:"data,omitempty"` + // The `UpdateAppResponse` `included`. + Included []DeploymentIncluded `json:"included,omitempty"` + // The definition of `AppMeta` object. + Meta *AppMeta `json:"meta,omitempty"` + // The definition of `UpdateAppResponseRelationship` object. + Relationship *UpdateAppResponseRelationship `json:"relationship,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppResponse instantiates a new UpdateAppResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppResponse() *UpdateAppResponse { + this := UpdateAppResponse{} + return &this +} + +// NewUpdateAppResponseWithDefaults instantiates a new UpdateAppResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppResponseWithDefaults() *UpdateAppResponse { + this := UpdateAppResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *UpdateAppResponse) GetData() UpdateAppResponseData { + if o == nil || o.Data == nil { + var ret UpdateAppResponseData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponse) GetDataOk() (*UpdateAppResponseData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *UpdateAppResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given UpdateAppResponseData and assigns it to the Data field. +func (o *UpdateAppResponse) SetData(v UpdateAppResponseData) { + o.Data = &v +} + +// GetIncluded returns the Included field value if set, zero value otherwise. +func (o *UpdateAppResponse) GetIncluded() []DeploymentIncluded { + if o == nil || o.Included == nil { + var ret []DeploymentIncluded + return ret + } + return o.Included +} + +// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponse) GetIncludedOk() (*[]DeploymentIncluded, bool) { + if o == nil || o.Included == nil { + return nil, false + } + return &o.Included, true +} + +// HasIncluded returns a boolean if a field has been set. +func (o *UpdateAppResponse) HasIncluded() bool { + return o != nil && o.Included != nil +} + +// SetIncluded gets a reference to the given []DeploymentIncluded and assigns it to the Included field. +func (o *UpdateAppResponse) SetIncluded(v []DeploymentIncluded) { + o.Included = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *UpdateAppResponse) GetMeta() AppMeta { + if o == nil || o.Meta == nil { + var ret AppMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponse) GetMetaOk() (*AppMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *UpdateAppResponse) HasMeta() bool { + return o != nil && o.Meta != nil +} + +// SetMeta gets a reference to the given AppMeta and assigns it to the Meta field. +func (o *UpdateAppResponse) SetMeta(v AppMeta) { + o.Meta = &v +} + +// GetRelationship returns the Relationship field value if set, zero value otherwise. +func (o *UpdateAppResponse) GetRelationship() UpdateAppResponseRelationship { + if o == nil || o.Relationship == nil { + var ret UpdateAppResponseRelationship + return ret + } + return *o.Relationship +} + +// GetRelationshipOk returns a tuple with the Relationship field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponse) GetRelationshipOk() (*UpdateAppResponseRelationship, bool) { + if o == nil || o.Relationship == nil { + return nil, false + } + return o.Relationship, true +} + +// HasRelationship returns a boolean if a field has been set. +func (o *UpdateAppResponse) HasRelationship() bool { + return o != nil && o.Relationship != nil +} + +// SetRelationship gets a reference to the given UpdateAppResponseRelationship and assigns it to the Relationship field. +func (o *UpdateAppResponse) SetRelationship(v UpdateAppResponseRelationship) { + o.Relationship = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Included != nil { + toSerialize["included"] = o.Included + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Relationship != nil { + toSerialize["relationship"] = o.Relationship + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *UpdateAppResponseData `json:"data,omitempty"` + Included []DeploymentIncluded `json:"included,omitempty"` + Meta *AppMeta `json:"meta,omitempty"` + Relationship *UpdateAppResponseRelationship `json:"relationship,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included", "meta", "relationship"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + o.Included = all.Included + if all.Meta != nil && all.Meta.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Meta = all.Meta + if all.Relationship != nil && all.Relationship.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationship = all.Relationship + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_response_data.go b/api/datadogV2/model_update_app_response_data.go new file mode 100644 index 00000000000..95cdb33e808 --- /dev/null +++ b/api/datadogV2/model_update_app_response_data.go @@ -0,0 +1,180 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppResponseData The definition of `UpdateAppResponseData` object. +type UpdateAppResponseData struct { + // The definition of `UpdateAppResponseDataAttributes` object. + Attributes UpdateAppResponseDataAttributes `json:"attributes"` + // The `data` `id`. + Id string `json:"id"` + // The definition of `UpdateAppResponseDataType` object. + Type UpdateAppResponseDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppResponseData instantiates a new UpdateAppResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppResponseData(attributes UpdateAppResponseDataAttributes, id string, typeVar UpdateAppResponseDataType) *UpdateAppResponseData { + this := UpdateAppResponseData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewUpdateAppResponseDataWithDefaults instantiates a new UpdateAppResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppResponseDataWithDefaults() *UpdateAppResponseData { + this := UpdateAppResponseData{} + var typeVar UpdateAppResponseDataType = UPDATEAPPRESPONSEDATATYPE_APPDEFINITIONS + this.Type = typeVar + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *UpdateAppResponseData) GetAttributes() UpdateAppResponseDataAttributes { + if o == nil { + var ret UpdateAppResponseDataAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseData) GetAttributesOk() (*UpdateAppResponseDataAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *UpdateAppResponseData) SetAttributes(v UpdateAppResponseDataAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *UpdateAppResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *UpdateAppResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *UpdateAppResponseData) GetType() UpdateAppResponseDataType { + if o == nil { + var ret UpdateAppResponseDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseData) GetTypeOk() (*UpdateAppResponseDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *UpdateAppResponseData) SetType(v UpdateAppResponseDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *UpdateAppResponseDataAttributes `json:"attributes"` + Id *string `json:"id"` + Type *UpdateAppResponseDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_response_data_attributes.go b/api/datadogV2/model_update_app_response_data_attributes.go new file mode 100644 index 00000000000..ad7a5469dbe --- /dev/null +++ b/api/datadogV2/model_update_app_response_data_attributes.go @@ -0,0 +1,391 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppResponseDataAttributes The definition of `UpdateAppResponseDataAttributes` object. +type UpdateAppResponseDataAttributes struct { + // The `attributes` `components`. + Components []ComponentGrid `json:"components,omitempty"` + // The `attributes` `description`. + Description *string `json:"description,omitempty"` + // The `attributes` `embeddedQueries`. + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + // The `attributes` `favorite`. + Favorite *bool `json:"favorite,omitempty"` + // The definition of `InputSchema` object. + InputSchema *InputSchema `json:"inputSchema,omitempty"` + // The `attributes` `name`. + Name *string `json:"name,omitempty"` + // The `attributes` `rootInstanceName`. + RootInstanceName *string `json:"rootInstanceName,omitempty"` + // The `attributes` `scripts`. + Scripts []Script `json:"scripts,omitempty"` + // The `attributes` `tags`. + Tags []string `json:"tags,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppResponseDataAttributes instantiates a new UpdateAppResponseDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppResponseDataAttributes() *UpdateAppResponseDataAttributes { + this := UpdateAppResponseDataAttributes{} + return &this +} + +// NewUpdateAppResponseDataAttributesWithDefaults instantiates a new UpdateAppResponseDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppResponseDataAttributesWithDefaults() *UpdateAppResponseDataAttributes { + this := UpdateAppResponseDataAttributes{} + return &this +} + +// GetComponents returns the Components field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetComponents() []ComponentGrid { + if o == nil || o.Components == nil { + var ret []ComponentGrid + return ret + } + return o.Components +} + +// GetComponentsOk returns a tuple with the Components field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetComponentsOk() (*[]ComponentGrid, bool) { + if o == nil || o.Components == nil { + return nil, false + } + return &o.Components, true +} + +// HasComponents returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasComponents() bool { + return o != nil && o.Components != nil +} + +// SetComponents gets a reference to the given []ComponentGrid and assigns it to the Components field. +func (o *UpdateAppResponseDataAttributes) SetComponents(v []ComponentGrid) { + o.Components = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateAppResponseDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetEmbeddedQueries returns the EmbeddedQueries field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetEmbeddedQueries() []Query { + if o == nil || o.EmbeddedQueries == nil { + var ret []Query + return ret + } + return o.EmbeddedQueries +} + +// GetEmbeddedQueriesOk returns a tuple with the EmbeddedQueries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetEmbeddedQueriesOk() (*[]Query, bool) { + if o == nil || o.EmbeddedQueries == nil { + return nil, false + } + return &o.EmbeddedQueries, true +} + +// HasEmbeddedQueries returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasEmbeddedQueries() bool { + return o != nil && o.EmbeddedQueries != nil +} + +// SetEmbeddedQueries gets a reference to the given []Query and assigns it to the EmbeddedQueries field. +func (o *UpdateAppResponseDataAttributes) SetEmbeddedQueries(v []Query) { + o.EmbeddedQueries = v +} + +// GetFavorite returns the Favorite field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetFavorite() bool { + if o == nil || o.Favorite == nil { + var ret bool + return ret + } + return *o.Favorite +} + +// GetFavoriteOk returns a tuple with the Favorite field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetFavoriteOk() (*bool, bool) { + if o == nil || o.Favorite == nil { + return nil, false + } + return o.Favorite, true +} + +// HasFavorite returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasFavorite() bool { + return o != nil && o.Favorite != nil +} + +// SetFavorite gets a reference to the given bool and assigns it to the Favorite field. +func (o *UpdateAppResponseDataAttributes) SetFavorite(v bool) { + o.Favorite = &v +} + +// GetInputSchema returns the InputSchema field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetInputSchema() InputSchema { + if o == nil || o.InputSchema == nil { + var ret InputSchema + return ret + } + return *o.InputSchema +} + +// GetInputSchemaOk returns a tuple with the InputSchema field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetInputSchemaOk() (*InputSchema, bool) { + if o == nil || o.InputSchema == nil { + return nil, false + } + return o.InputSchema, true +} + +// HasInputSchema returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasInputSchema() bool { + return o != nil && o.InputSchema != nil +} + +// SetInputSchema gets a reference to the given InputSchema and assigns it to the InputSchema field. +func (o *UpdateAppResponseDataAttributes) SetInputSchema(v InputSchema) { + o.InputSchema = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateAppResponseDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetRootInstanceName returns the RootInstanceName field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetRootInstanceName() string { + if o == nil || o.RootInstanceName == nil { + var ret string + return ret + } + return *o.RootInstanceName +} + +// GetRootInstanceNameOk returns a tuple with the RootInstanceName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetRootInstanceNameOk() (*string, bool) { + if o == nil || o.RootInstanceName == nil { + return nil, false + } + return o.RootInstanceName, true +} + +// HasRootInstanceName returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasRootInstanceName() bool { + return o != nil && o.RootInstanceName != nil +} + +// SetRootInstanceName gets a reference to the given string and assigns it to the RootInstanceName field. +func (o *UpdateAppResponseDataAttributes) SetRootInstanceName(v string) { + o.RootInstanceName = &v +} + +// GetScripts returns the Scripts field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetScripts() []Script { + if o == nil || o.Scripts == nil { + var ret []Script + return ret + } + return o.Scripts +} + +// GetScriptsOk returns a tuple with the Scripts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetScriptsOk() (*[]Script, bool) { + if o == nil || o.Scripts == nil { + return nil, false + } + return &o.Scripts, true +} + +// HasScripts returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasScripts() bool { + return o != nil && o.Scripts != nil +} + +// SetScripts gets a reference to the given []Script and assigns it to the Scripts field. +func (o *UpdateAppResponseDataAttributes) SetScripts(v []Script) { + o.Scripts = v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *UpdateAppResponseDataAttributes) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseDataAttributes) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *UpdateAppResponseDataAttributes) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *UpdateAppResponseDataAttributes) SetTags(v []string) { + o.Tags = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppResponseDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Components != nil { + toSerialize["components"] = o.Components + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.EmbeddedQueries != nil { + toSerialize["embeddedQueries"] = o.EmbeddedQueries + } + if o.Favorite != nil { + toSerialize["favorite"] = o.Favorite + } + if o.InputSchema != nil { + toSerialize["inputSchema"] = o.InputSchema + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.RootInstanceName != nil { + toSerialize["rootInstanceName"] = o.RootInstanceName + } + if o.Scripts != nil { + toSerialize["scripts"] = o.Scripts + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppResponseDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Components []ComponentGrid `json:"components,omitempty"` + Description *string `json:"description,omitempty"` + EmbeddedQueries []Query `json:"embeddedQueries,omitempty"` + Favorite *bool `json:"favorite,omitempty"` + InputSchema *InputSchema `json:"inputSchema,omitempty"` + Name *string `json:"name,omitempty"` + RootInstanceName *string `json:"rootInstanceName,omitempty"` + Scripts []Script `json:"scripts,omitempty"` + Tags []string `json:"tags,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"components", "description", "embeddedQueries", "favorite", "inputSchema", "name", "rootInstanceName", "scripts", "tags"}) + } else { + return err + } + + hasInvalidField := false + o.Components = all.Components + o.Description = all.Description + o.EmbeddedQueries = all.EmbeddedQueries + o.Favorite = all.Favorite + if all.InputSchema != nil && all.InputSchema.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.InputSchema = all.InputSchema + o.Name = all.Name + o.RootInstanceName = all.RootInstanceName + o.Scripts = all.Scripts + o.Tags = all.Tags + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_update_app_response_data_type.go b/api/datadogV2/model_update_app_response_data_type.go new file mode 100644 index 00000000000..5bd61678885 --- /dev/null +++ b/api/datadogV2/model_update_app_response_data_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppResponseDataType The definition of `UpdateAppResponseDataType` object. +type UpdateAppResponseDataType string + +// List of UpdateAppResponseDataType. +const ( + UPDATEAPPRESPONSEDATATYPE_APPDEFINITIONS UpdateAppResponseDataType = "appDefinitions" +) + +var allowedUpdateAppResponseDataTypeEnumValues = []UpdateAppResponseDataType{ + UPDATEAPPRESPONSEDATATYPE_APPDEFINITIONS, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *UpdateAppResponseDataType) GetAllowedValues() []UpdateAppResponseDataType { + return allowedUpdateAppResponseDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *UpdateAppResponseDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = UpdateAppResponseDataType(value) + return nil +} + +// NewUpdateAppResponseDataTypeFromValue returns a pointer to a valid UpdateAppResponseDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewUpdateAppResponseDataTypeFromValue(v string) (*UpdateAppResponseDataType, error) { + ev := UpdateAppResponseDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for UpdateAppResponseDataType: valid values are %v", v, allowedUpdateAppResponseDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v UpdateAppResponseDataType) IsValid() bool { + for _, existing := range allowedUpdateAppResponseDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateAppResponseDataType value. +func (v UpdateAppResponseDataType) Ptr() *UpdateAppResponseDataType { + return &v +} diff --git a/api/datadogV2/model_update_app_response_relationship.go b/api/datadogV2/model_update_app_response_relationship.go new file mode 100644 index 00000000000..1408ad16e9f --- /dev/null +++ b/api/datadogV2/model_update_app_response_relationship.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// UpdateAppResponseRelationship The definition of `UpdateAppResponseRelationship` object. +type UpdateAppResponseRelationship struct { + // The `relationship` `connections`. + Connections []CustomConnection `json:"connections,omitempty"` + // The definition of `DeploymentRelationship` object. + Deployment *DeploymentRelationship `json:"deployment,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewUpdateAppResponseRelationship instantiates a new UpdateAppResponseRelationship object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewUpdateAppResponseRelationship() *UpdateAppResponseRelationship { + this := UpdateAppResponseRelationship{} + return &this +} + +// NewUpdateAppResponseRelationshipWithDefaults instantiates a new UpdateAppResponseRelationship object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewUpdateAppResponseRelationshipWithDefaults() *UpdateAppResponseRelationship { + this := UpdateAppResponseRelationship{} + return &this +} + +// GetConnections returns the Connections field value if set, zero value otherwise. +func (o *UpdateAppResponseRelationship) GetConnections() []CustomConnection { + if o == nil || o.Connections == nil { + var ret []CustomConnection + return ret + } + return o.Connections +} + +// GetConnectionsOk returns a tuple with the Connections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseRelationship) GetConnectionsOk() (*[]CustomConnection, bool) { + if o == nil || o.Connections == nil { + return nil, false + } + return &o.Connections, true +} + +// HasConnections returns a boolean if a field has been set. +func (o *UpdateAppResponseRelationship) HasConnections() bool { + return o != nil && o.Connections != nil +} + +// SetConnections gets a reference to the given []CustomConnection and assigns it to the Connections field. +func (o *UpdateAppResponseRelationship) SetConnections(v []CustomConnection) { + o.Connections = v +} + +// GetDeployment returns the Deployment field value if set, zero value otherwise. +func (o *UpdateAppResponseRelationship) GetDeployment() DeploymentRelationship { + if o == nil || o.Deployment == nil { + var ret DeploymentRelationship + return ret + } + return *o.Deployment +} + +// GetDeploymentOk returns a tuple with the Deployment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAppResponseRelationship) GetDeploymentOk() (*DeploymentRelationship, bool) { + if o == nil || o.Deployment == nil { + return nil, false + } + return o.Deployment, true +} + +// HasDeployment returns a boolean if a field has been set. +func (o *UpdateAppResponseRelationship) HasDeployment() bool { + return o != nil && o.Deployment != nil +} + +// SetDeployment gets a reference to the given DeploymentRelationship and assigns it to the Deployment field. +func (o *UpdateAppResponseRelationship) SetDeployment(v DeploymentRelationship) { + o.Deployment = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o UpdateAppResponseRelationship) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Connections != nil { + toSerialize["connections"] = o.Connections + } + if o.Deployment != nil { + toSerialize["deployment"] = o.Deployment + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *UpdateAppResponseRelationship) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Connections []CustomConnection `json:"connections,omitempty"` + Deployment *DeploymentRelationship `json:"deployment,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"connections", "deployment"}) + } else { + return err + } + + hasInvalidField := false + o.Connections = all.Connections + if all.Deployment != nil && all.Deployment.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Deployment = all.Deployment + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/examples/v2/app-deployment/DeployApp.go b/examples/v2/app-deployment/DeployApp.go new file mode 100644 index 00000000000..476aa6a7b00 --- /dev/null +++ b/examples/v2/app-deployment/DeployApp.go @@ -0,0 +1,33 @@ +// Deploy App returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "app" in the system + AppDataID := os.Getenv("APP_DATA_ID") + + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeployApp", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppDeploymentApi(apiClient) + resp, r, err := api.DeployApp(ctx, AppDataID) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppDeploymentApi.DeployApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppDeploymentApi.DeployApp`:\n%s\n", responseContent) +} diff --git a/examples/v2/app-deployment/DisableApp.go b/examples/v2/app-deployment/DisableApp.go new file mode 100644 index 00000000000..b5757e9c6e2 --- /dev/null +++ b/examples/v2/app-deployment/DisableApp.go @@ -0,0 +1,33 @@ +// Disable App returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "app" in the system + AppDataID := os.Getenv("APP_DATA_ID") + + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DisableApp", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppDeploymentApi(apiClient) + resp, r, err := api.DisableApp(ctx, AppDataID) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppDeploymentApi.DisableApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppDeploymentApi.DisableApp`:\n%s\n", responseContent) +} diff --git a/examples/v2/apps/CreateApp.go b/examples/v2/apps/CreateApp.go new file mode 100644 index 00000000000..0a19867687a --- /dev/null +++ b/examples/v2/apps/CreateApp.go @@ -0,0 +1,72 @@ +// Create App returns "App Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CreateAppRequest{ + Data: &datadogV2.CreateAppRequestData{ + Attributes: &datadogV2.CreateAppRequestDataAttributes{ + Components: []datadogV2.ComponentGrid{ + { + Events: []datadogV2.AppBuilderEvent{}, + Name: "grid0", + Properties: datadogV2.ComponentGridProperties{ + Children: []datadogV2.Component{ + { + Events: []datadogV2.AppBuilderEvent{}, + Name: "gridCell0", + Properties: datadogV2.ComponentProperties{ + Children: []datadogV2.Component{ + { + Events: []datadogV2.AppBuilderEvent{}, + Name: "calloutValue0", + Properties: datadogV2.ComponentProperties{ + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + Bool: datadog.PtrBool(true)}, + }, + Type: datadogV2.COMPONENTTYPE_CALLOUTVALUE, + }, + }, + IsVisible: &datadogV2.ComponentPropertiesIsVisible{ + String: datadog.PtrString("true")}, + }, + Type: datadogV2.COMPONENTTYPE_GRIDCELL, + }, + }, + }, + Type: datadogV2.COMPONENTGRIDTYPE_GRID, + }, + }, + Description: datadog.PtrString("This is a simple example app"), + EmbeddedQueries: []datadogV2.Query{}, + Name: datadog.PtrString("Example App"), + RootInstanceName: datadog.PtrString("grid0"), + }, + Type: datadogV2.CREATEAPPREQUESTDATATYPE_APPDEFINITIONS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateApp", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppsApi(apiClient) + resp, r, err := api.CreateApp(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.CreateApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppsApi.CreateApp`:\n%s\n", responseContent) +} diff --git a/examples/v2/apps/DeleteApp.go b/examples/v2/apps/DeleteApp.go new file mode 100644 index 00000000000..9f67d3c673d --- /dev/null +++ b/examples/v2/apps/DeleteApp.go @@ -0,0 +1,33 @@ +// Delete App returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "app" in the system + AppDataID := os.Getenv("APP_DATA_ID") + + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteApp", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppsApi(apiClient) + resp, r, err := api.DeleteApp(ctx, AppDataID) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DeleteApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppsApi.DeleteApp`:\n%s\n", responseContent) +} diff --git a/examples/v2/apps/DeleteApps.go b/examples/v2/apps/DeleteApps.go new file mode 100644 index 00000000000..0514eafb7b8 --- /dev/null +++ b/examples/v2/apps/DeleteApps.go @@ -0,0 +1,41 @@ +// Delete Multiple Apps returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "app" in the system + AppDataID := os.Getenv("APP_DATA_ID") + + body := datadogV2.DeleteAppsRequest{ + Data: []datadogV2.DeleteAppsRequestDataItems{ + { + Id: AppDataID, + Type: datadogV2.DELETEAPPSREQUESTDATAITEMSTYPE_APPDEFINITIONS, + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteApps", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppsApi(apiClient) + resp, r, err := api.DeleteApps(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.DeleteApps`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppsApi.DeleteApps`:\n%s\n", responseContent) +} diff --git a/examples/v2/apps/GetApp.go b/examples/v2/apps/GetApp.go new file mode 100644 index 00000000000..188ee704cb3 --- /dev/null +++ b/examples/v2/apps/GetApp.go @@ -0,0 +1,33 @@ +// Get App returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "app" in the system + AppDataID := os.Getenv("APP_DATA_ID") + + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetApp", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppsApi(apiClient) + resp, r, err := api.GetApp(ctx, AppDataID) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.GetApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppsApi.GetApp`:\n%s\n", responseContent) +} diff --git a/examples/v2/apps/ListApps.go b/examples/v2/apps/ListApps.go new file mode 100644 index 00000000000..a28f666f516 --- /dev/null +++ b/examples/v2/apps/ListApps.go @@ -0,0 +1,30 @@ +// List Apps returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListApps", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppsApi(apiClient) + resp, r, err := api.ListApps(ctx, *datadogV2.NewListAppsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.ListApps`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppsApi.ListApps`:\n%s\n", responseContent) +} diff --git a/examples/v2/apps/UpdateApp.go b/examples/v2/apps/UpdateApp.go new file mode 100644 index 00000000000..198e43b41da --- /dev/null +++ b/examples/v2/apps/UpdateApp.go @@ -0,0 +1,43 @@ +// Update App returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + // there is a valid "app" in the system + AppDataID := os.Getenv("APP_DATA_ID") + + body := datadogV2.UpdateAppRequest{ + Data: &datadogV2.UpdateAppRequestData{ + Attributes: &datadogV2.UpdateAppRequestDataAttributes{ + Name: datadog.PtrString("Updated Name"), + RootInstanceName: datadog.PtrString("grid0"), + }, + Id: datadog.PtrString(AppDataID), + Type: datadogV2.UPDATEAPPREQUESTDATATYPE_APPDEFINITIONS, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateApp", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewAppsApi(apiClient) + resp, r, err := api.UpdateApp(ctx, AppDataID, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AppsApi.UpdateApp`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `AppsApi.UpdateApp`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/api_mappings.go b/tests/scenarios/api_mappings.go index f3201748d99..ed9068dad14 100644 --- a/tests/scenarios/api_mappings.go +++ b/tests/scenarios/api_mappings.go @@ -48,6 +48,8 @@ var apiMappings = map[string]map[string]reflect.Value{ "APIManagementApi": reflect.ValueOf(datadogV2.NewAPIManagementApi), "SpansMetricsApi": reflect.ValueOf(datadogV2.NewSpansMetricsApi), "APMRetentionFiltersApi": reflect.ValueOf(datadogV2.NewAPMRetentionFiltersApi), + "AppsApi": reflect.ValueOf(datadogV2.NewAppsApi), + "AppDeploymentApi": reflect.ValueOf(datadogV2.NewAppDeploymentApi), "AuditApi": reflect.ValueOf(datadogV2.NewAuditApi), "AuthNMappingsApi": reflect.ValueOf(datadogV2.NewAuthNMappingsApi), "CaseManagementApi": reflect.ValueOf(datadogV2.NewCaseManagementApi), diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..70eab29e2a7 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:35.320Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..c2280ccb0ee --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Bad_Request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps/invalid-uuid/deployment + response: + body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze new file mode 100644 index 00000000000..12cd09b1d29 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:22.668Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml new file mode 100644 index 00000000000..3a63b8bf16a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Created_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"d9f547cd-bc8d-46be-b321-336856723728","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps/d9f547cd-bc8d-46be-b321-336856723728/deployment + response: + body: '{"data":{"id":"7e1d147c-815e-46fa-8be0-278783311881","type":"deployment","attributes":{"app_version_id":"f8567809-049e-49c2-b5c0-e5cb0e8e0f5e"},"meta":{"created_at":"2024-12-12T20:29:23.253704Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/d9f547cd-bc8d-46be-b321-336856723728 + response: + body: '{"data":{"id":"d9f547cd-bc8d-46be-b321-336856723728","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..c11fe09d7f4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:35.984Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..c1276132f44 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Deploy_App_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/deployment + response: + body: '{"errors":[{"detail":"app not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..bf3af7629d0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:36.091Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..cad0f8a2468 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Bad_Request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/invalid-uuid/deployment + response: + body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..8dc6b57d756 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:36.179Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..36ce5941506 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e/deployment + response: + body: '{"errors":[{"detail":"app not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze new file mode 100644 index 00000000000..883ce61def2 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:23.546Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml new file mode 100644 index 00000000000..785dc99099d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_App_Deployment/Scenario_Disable_App_returns_OK_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad/deployment + response: + body: '{"data":{"id":"be510de8-34d8-45fc-830f-85c208a42920","type":"deployment","attributes":{"app_version_id":"00000000-0000-0000-0000-000000000000"},"meta":{"created_at":"2024-12-12T20:29:23.883145Z","user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad + response: + body: '{"data":{"id":"6fdd1eb3-bd2c-4fe3-a3cf-38d0af4913ad","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze new file mode 100644 index 00000000000..6dfadcf607a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:24.182Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml new file mode 100644 index 00000000000..dc4df561a90 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_App_Created_response.yaml @@ -0,0 +1,39 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"2d9dd18e-c574-454c-8d43-3045b731d6a2","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/2d9dd18e-c574-454c-8d43-3045b731d6a2 + response: + body: '{"data":{"id":"2d9dd18e-c574-454c-8d43-3045b731d6a2","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..5912dc34412 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:10.031Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..65a082a9e3f --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Create_App_returns_Bad_Request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"description":"This is a bad example app","embeddedQueries":[],"rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"errors":[{"detail":"missing required field","source":{"pointer":"/data/attributes/name"}}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..3925b1b25d4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:10.128Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..1982aecc054 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Bad_Request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/bad-app-id + response: + body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..cfa34bd9baf --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:10.225Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..08f466a08b8 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e + response: + body: '{"errors":[{"detail":"app not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze new file mode 100644 index 00000000000..81a74305aec --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:24.659Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml new file mode 100644 index 00000000000..a6db0635c80 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_App_returns_OK_response.yaml @@ -0,0 +1,56 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"5cb67134-d7bd-4320-9cda-d79ec98cff4c","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/5cb67134-d7bd-4320-9cda-d79ec98cff4c + response: + body: '{"data":{"id":"5cb67134-d7bd-4320-9cda-d79ec98cff4c","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/5cb67134-d7bd-4320-9cda-d79ec98cff4c + response: + body: '{"errors":[{"detail":"app not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..47c84b21b2b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:10.845Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..7d15e5b626b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Bad_Request_response.yaml @@ -0,0 +1,23 @@ +interactions: +- request: + body: | + {"data":[{"id":"71c0d358-eac5-41e3-892d-a7467571b9b","type":"appDefinitions"},{"id":"71c0d358-eac5-41e3-892d-a7467571b9b0","type":"appDefinitions"},{"id":"98e7e44d-1562-474a-90f7-3a94e739c006","type":"appDefinitions"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"errors":[{"status":"400","title":"Bad Request","detail":"invalid UUID + length: 35"}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..0fbfbe769d0 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:10.942Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..330dc0ee886 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_Not_Found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: | + {"data":[{"id":"29494ddd-ac13-46a7-8558-b05b050ee755","type":"appDefinitions"},{"id":"71c0d358-eac5-41e3-892d-a7467571b9b0","type":"appDefinitions"},{"id":"98e7e44d-1562-474a-90f7-3a94e739c006","type":"appDefinitions"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"errors":[{"detail":"one or more apps not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze new file mode 100644 index 00000000000..5848314b797 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:25.239Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml new file mode 100644 index 00000000000..6a4e46ae1ab --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Delete_Multiple_Apps_returns_OK_response.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"61d36766-5d27-47ea-a3e7-aa7bd77b1da3","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":[{"id":"61d36766-5d27-47ea-a3e7-aa7bd77b1da3","type":"appDefinitions"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":[{"id":"61d36766-5d27-47ea-a3e7-aa7bd77b1da3","type":"appDefinitions"}]}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/61d36766-5d27-47ea-a3e7-aa7bd77b1da3 + response: + body: '{"errors":[{"detail":"app not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..9a1b4493f05 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:11.519Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..0d4806c69d4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Bad_Request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps/invalid-uuid + response: + body: '{"errors":[{"detail":"invalid path parameter","source":{"parameter":"appId"}}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..0d42c760761 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:11.612Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..2ace6c9c5f4 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_Not_Found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps/7addb29b-f935-472c-ae79-d1963979a23e + response: + body: '{"errors":[{"detail":"app not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze new file mode 100644 index 00000000000..7b34332de4d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:25.770Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml new file mode 100644 index 00000000000..a3e85111b71 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Get_App_returns_OK_response.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"4937a273-31f5-4375-a9cf-b71eeb92f89c","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 1 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps/4937a273-31f5-4375-a9cf-b71eeb92f89c + response: + body: '{"data":{"id":"4937a273-31f5-4375-a9cf-b71eeb92f89c","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU + Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This + is a simple example app","embeddedQueries":[],"favorite":false,"name":"Example + App","rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":321813,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":1,"updated_since_deployment":false,"created_at":"2024-12-12T20:29:25.869968Z","updated_at":"2024-12-12T20:29:25.869968Z","deleted_at":"0001-01-01T00:00:00Z"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/4937a273-31f5-4375-a9cf-b71eeb92f89c + response: + body: '{"data":{"id":"4937a273-31f5-4375-a9cf-b71eeb92f89c","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze new file mode 100644 index 00000000000..1cb2468dc44 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-10T19:57:12.227Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml new file mode 100644 index 00000000000..2839eeede75 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_List_Apps_returns_OK_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 0 + method: GET + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":[{"id":"d595693a-473d-4671-9da3-fce89e3a5c5d","type":"appDefinitions","attributes":{"description":"","favorite":false,"name":"Max''s + App Fri, Jul 12, 11:10:35 am","selfService":false,"tags":[]},"meta":{"org_id":1107852,"user_id":7571362,"user_uuid":"3114f3a0-3fc9-11ef-acbe-a6def6551924","user_name":"max.gale@datadoghq.com","version":0,"updated_since_deployment":false,"created_at":"2024-07-12T15:10:48.690305Z","updated_at":"2024-07-12T15:10:48.690305Z","deleted_at":"0001-01-01T00:00:00Z"}}],"meta":{"page":{"totalCount":1,"totalFilteredCount":1}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..56162830354 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:26.349Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..b2c8eadb0a3 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_Bad_Request_response.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"9d2ee93b-6ac5-4b0e-abd8-829916f2365d","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"rootInstanceName":""},"id":"9d2ee93b-6ac5-4b0e-abd8-829916f2365d","type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/9d2ee93b-6ac5-4b0e-abd8-829916f2365d + response: + body: '{"errors":[{"detail":"missing required field","source":{"pointer":"/data/attributes/rootInstanceName"}}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/9d2ee93b-6ac5-4b0e-abd8-829916f2365d + response: + body: '{"data":{"id":"9d2ee93b-6ac5-4b0e-abd8-829916f2365d","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze new file mode 100644 index 00000000000..9a62b802399 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.freeze @@ -0,0 +1 @@ +2024-12-12T20:29:26.986Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml new file mode 100644 index 00000000000..6db2ad9ef0b --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Apps/Scenario_Update_App_returns_OK_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: | + {"data":{"attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This is a simple example app","embeddedQueries":[],"name":"Example App","rootInstanceName":"grid0"},"type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/app-builder/apps + response: + body: '{"data":{"id":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions"}}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"attributes":{"name":"Updated Name","rootInstanceName":"grid0"},"id":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions"}} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 1 + method: PATCH + url: https://api.datadoghq.com/api/v2/app-builder/apps/5a5e6785-d3f8-41bf-9d5d-95a179362e02 + response: + body: '{"data":{"id":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions","attributes":{"components":[{"events":[],"name":"grid0","properties":{"children":[{"events":[],"name":"gridCell0","properties":{"children":[{"events":[],"name":"calloutValue0","properties":{"isDisabled":false,"isLoading":false,"isVisible":true,"label":"CPU + Usage","size":"sm","style":"vivid_yellow","unit":"kB","value":"42"},"type":"calloutValue"}],"isVisible":"true","layout":{"default":{"height":8,"width":2,"x":0,"y":0}}},"type":"gridCell"}]},"type":"grid"}],"description":"This + is a simple example app","embeddedQueries":[],"favorite":false,"name":"Updated + Name","rootInstanceName":"grid0","selfService":false,"tags":[]},"meta":{"org_id":321813,"user_id":2320499,"user_uuid":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","user_name":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","version":2,"updated_since_deployment":false,"created_at":"2024-12-12T20:29:27.115629Z","updated_at":"2024-12-12T20:29:27.362767Z","deleted_at":"0001-01-01T00:00:00Z"}}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +- request: + body: '' + form: {} + headers: + Accept: + - application/json + id: 2 + method: DELETE + url: https://api.datadoghq.com/api/v2/app-builder/apps/5a5e6785-d3f8-41bf-9d5d-95a179362e02 + response: + body: '{"data":{"id":"5a5e6785-d3f8-41bf-9d5d-95a179362e02","type":"appDefinitions"}}' + code: 200 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 200 OK +version: 2 diff --git a/tests/scenarios/features/v2/app_deployment.feature b/tests/scenarios/features/v2/app_deployment.feature new file mode 100644 index 00000000000..b76bc1d8841 --- /dev/null +++ b/tests/scenarios/features/v2/app_deployment.feature @@ -0,0 +1,58 @@ +@endpoint(app-deployment) @endpoint(app-deployment-v2) +Feature: App Deployment + Deploy and disable apps in App Builder. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "AppDeployment" API + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Deploy App returns "Bad Request" response + Given operation "DeployApp" enabled + And new "DeployApp" request + And request contains "app_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Deploy App returns "Created" response + Given operation "DeployApp" enabled + And new "DeployApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 201 Created + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Deploy App returns "Not Found" response + Given operation "DeployApp" enabled + And new "DeployApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Disable App returns "Bad Request" response + Given operation "DisableApp" enabled + And new "DisableApp" request + And request contains "app_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Disable App returns "Not Found" response + Given operation "DisableApp" enabled + And new "DisableApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Disable App returns "OK" response + Given operation "DisableApp" enabled + And new "DisableApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/apps.feature b/tests/scenarios/features/v2/apps.feature new file mode 100644 index 00000000000..531cc382643 --- /dev/null +++ b/tests/scenarios/features/v2/apps.feature @@ -0,0 +1,155 @@ +@endpoint(apps) @endpoint(apps-v2) +Feature: Apps + Create, read, update, and delete apps in App Builder. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Apps" API + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Create App returns "App Created" response + Given operation "CreateApp" enabled + And new "CreateApp" request + And body with value {"data": {"attributes": {"components": [{"events": [], "name": "grid0", "properties": {"children": [{"events": [], "name": "gridCell0", "properties": {"children": [{"events": [], "name": "calloutValue0", "properties": {"isVisible": true, "isDisabled": false, "isLoading": false, "label": "CPU Usage", "size": "sm", "style": "vivid_yellow", "unit": "kB", "value": "42"}, "type": "calloutValue"}], "isVisible": "true", "layout": {"default": {"height": 8, "width": 2, "x": 0, "y": 0}}}, "type": "gridCell"}]}, "type": "grid"}], "description": "This is a simple example app", "embeddedQueries": [], "name": "Example App", "rootInstanceName": "grid0"}, "type": "appDefinitions"}} + When the request is sent + Then the response status is 201 App Created + And the response "data.type" is equal to "appDefinitions" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Create App returns "Bad Request" response + Given operation "CreateApp" enabled + And new "CreateApp" request + And body with value {"data": {"attributes": {"description": "This is a bad example app", "embeddedQueries": [], "rootInstanceName": "grid0"}, "type": "appDefinitions"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].detail" is equal to "missing required field" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete App returns "Bad Request" response + Given operation "DeleteApp" enabled + And new "DeleteApp" request + And request contains "app_id" parameter with value "bad-app-id" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/app-builder-backend + Scenario: Delete App returns "Gone" response + Given operation "DeleteApp" enabled + And new "DeleteApp" request + And request contains "app_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 410 Gone + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete App returns "Not Found" response + Given operation "DeleteApp" enabled + And new "DeleteApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete App returns "OK" response + Given operation "DeleteApp" enabled + And there is a valid "app" in the system + And new "DeleteApp" request + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "app.data.id" + And the response "data.type" is equal to "appDefinitions" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete Multiple Apps returns "Bad Request" response + Given operation "DeleteApps" enabled + And new "DeleteApps" request + And body with value {"data": [{"id": "71c0d358-eac5-41e3-892d-a7467571b9b", "type": "appDefinitions"}, {"id": "71c0d358-eac5-41e3-892d-a7467571b9b0", "type": "appDefinitions"}, {"id": "98e7e44d-1562-474a-90f7-3a94e739c006", "type": "appDefinitions"}]} + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete Multiple Apps returns "Not Found" response + Given operation "DeleteApps" enabled + And new "DeleteApps" request + And body with value {"data": [{"id": "29494ddd-ac13-46a7-8558-b05b050ee755", "type": "appDefinitions"}, {"id": "71c0d358-eac5-41e3-892d-a7467571b9b0", "type": "appDefinitions"}, {"id": "98e7e44d-1562-474a-90f7-3a94e739c006", "type": "appDefinitions"}]} + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Delete Multiple Apps returns "OK" response + Given operation "DeleteApps" enabled + And new "DeleteApps" request + And there is a valid "app" in the system + And body with value {"data": [{"id": "{{ app.data.id }}", "type": "appDefinitions"}]} + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].id" has the same value as "app.data.id" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Get App returns "Bad Request" response + Given operation "GetApp" enabled + And new "GetApp" request + And request contains "app_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Get App returns "Not Found" response + Given operation "GetApp" enabled + And new "GetApp" request + And request contains "app_id" parameter with value "7addb29b-f935-472c-ae79-d1963979a23e" + When the request is sent + Then the response status is 404 Not Found + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Get App returns "OK" response + Given operation "GetApp" enabled + And new "GetApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "app.data.id" + And the response "data.type" is equal to "appDefinitions" + + @generated @skip @team:DataDog/app-builder-backend + Scenario: List Apps returns "Bad Request, e.g. invalid sort parameter" response + Given operation "ListApps" enabled + And new "ListApps" request + When the request is sent + Then the response status is 400 Bad Request, e.g. invalid sort parameter + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: List Apps returns "OK" response + Given operation "ListApps" enabled + And new "ListApps" request + When the request is sent + Then the response status is 200 OK + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App returns "Bad Request" response + Given operation "UpdateApp" enabled + And new "UpdateApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"rootInstanceName": ""}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} + When the request is sent + Then the response status is 400 Bad Request + And the response "errors" has length 1 + And the response "errors[0].detail" is equal to "missing required field" + + @skip-typescript @team:DataDog/app-builder-backend + Scenario: Update App returns "OK" response + Given operation "UpdateApp" enabled + And new "UpdateApp" request + And there is a valid "app" in the system + And request contains "app_id" parameter from "app.data.id" + And body with value {"data": {"attributes": {"name": "Updated Name", "rootInstanceName": "grid0"}, "id": "{{ app.data.id }}", "type": "appDefinitions"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" has the same value as "app.data.id" + And the response "data.type" is equal to "appDefinitions" + And the response "data.attributes.name" is equal to "Updated Name" diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 21d526af248..29503a6ae7c 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -47,6 +47,18 @@ "tag": "APM Retention Filters", "operationId": "CreateApmRetentionFilter" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\": {\"attributes\": {\"components\": [{\"events\": [], \"name\": \"grid0\", \"properties\": {\"children\": [{\"events\": [], \"name\": \"gridCell0\", \"properties\": {\"children\": [{\"events\": [], \"name\": \"calloutValue0\", \"properties\": {\"isVisible\": true, \"isDisabled\": false, \"isLoading\": false, \"label\": \"CPU Usage\", \"size\": \"sm\", \"style\": \"vivid_yellow\", \"unit\": \"kB\", \"value\": \"42\"}, \"type\": \"calloutValue\"}], \"isVisible\": \"true\", \"layout\": {\"default\": {\"height\": 8, \"width\": 2, \"x\": 0, \"y\": 0}}}, \"type\": \"gridCell\"}]}, \"type\": \"grid\"}], \"description\": \"This is a simple example app\", \"embeddedQueries\": [], \"name\": \"Example App\", \"rootInstanceName\": \"grid0\"}, \"type\": \"appDefinitions\"}}" + } + ], + "step": "there is a valid \"app\" in the system", + "key": "app", + "tag": "Apps", + "operationId": "CreateApp" + }, { "parameters": [ { diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 8a00411a3b6..b1ed2db693d 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -153,6 +153,61 @@ "type": "idempotent" } }, + "DeleteApps": { + "tag": "Apps", + "undo": { + "type": "idempotent" + } + }, + "ListApps": { + "tag": "Apps", + "undo": { + "type": "safe" + } + }, + "CreateApp": { + "tag": "Apps", + "undo": { + "operationId": "DeleteApp", + "parameters": [ + { + "name": "app_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteApp": { + "tag": "Apps", + "undo": { + "type": "idempotent" + } + }, + "GetApp": { + "tag": "Apps", + "undo": { + "type": "safe" + } + }, + "UpdateApp": { + "tag": "Apps", + "undo": { + "type": "idempotent" + } + }, + "DisableApp": { + "tag": "App Deployment", + "undo": { + "type": "idempotent" + } + }, + "DeployApp": { + "tag": "App Deployment", + "undo": { + "type": "idempotent" + } + }, "ListApplicationKeys": { "tag": "Key Management", "undo": {