From 2ae2cff1a5bce8c23766c4c0c2915ea4f13a703c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 20 Jul 2026 16:27:50 +0000 Subject: [PATCH] Regenerate client from commit 69667b8 of spec repo --- .generator/schemas/v2/openapi.yaml | 81 ++++++++++ api/datadog/configuration.go | 1 + api/datadogV2/api_organizations.go | 83 ++++++++++ api/datadogV2/doc.go | 1 + ...el_mcp_cross_app_access_issuer_url_type.go | 64 ++++++++ ...app_access_issuer_url_update_attributes.go | 103 ++++++++++++ ...cross_app_access_issuer_url_update_data.go | 146 ++++++++++++++++++ ...ss_app_access_issuer_url_update_request.go | 110 +++++++++++++ ...ginOrgConfigsMcpCrossAppAccessIssuerUrl.go | 34 ++++ .../features/v2/organizations.feature | 16 ++ tests/scenarios/features/v2/undo.json | 6 + 11 files changed, 645 insertions(+) create mode 100644 api/datadogV2/model_mcp_cross_app_access_issuer_url_type.go create mode 100644 api/datadogV2/model_mcp_cross_app_access_issuer_url_update_attributes.go create mode 100644 api/datadogV2/model_mcp_cross_app_access_issuer_url_update_data.go create mode 100644 api/datadogV2/model_mcp_cross_app_access_issuer_url_update_request.go create mode 100644 examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.go diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ed984a56d0e..8fb6d884937 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -60208,6 +60208,41 @@ components: $ref: "#/components/schemas/MaxSessionDurationUpdateData" required: [data] type: object + McpCrossAppAccessIssuerUrlType: + description: Data type of an MCP Cross-App Access issuer URL update. + enum: [org_config] + example: org_config + type: string + x-enum-varnames: + - ORG_CONFIG + McpCrossAppAccessIssuerUrlUpdateAttributes: + description: Attributes for the MCP Cross-App Access issuer URL update request. + properties: + issuer_url: + description: |- + The Okta OIDC issuer URL for MCP Cross-App Access, for example + `https://your-subdomain.okta.com`. Provide an empty string to unset + the issuer URL and opt the organization out of MCP Cross-App Access. + example: https://your-subdomain.okta.com + type: string + required: [issuer_url] + type: object + McpCrossAppAccessIssuerUrlUpdateData: + description: The data object for an MCP Cross-App Access issuer URL update request. + properties: + attributes: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateAttributes" + type: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlType" + required: [type, attributes] + type: object + McpCrossAppAccessIssuerUrlUpdateRequest: + description: A request to update the MCP Cross-App Access issuer URL for an organization. + properties: + data: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateData" + required: [data] + type: object McpScanRequest: description: The top-level request object for submitting an MCP SCA dependency scan. properties: @@ -154159,6 +154194,52 @@ paths: operator: OR permissions: - org_management + /api/v2/login/org_configs/mcp_cross_app_access_issuer_url: + put: + description: |- + Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA) + for the current organization. The URL must be a bare Okta issuer such + as `https://your-subdomain.okta.com` (no path, port, query, or fragment). + Provide an empty string to unset the issuer URL and opt the organization + out of MCP Cross-App Access. + operationId: UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + issuer_url: https://your-subdomain.okta.com + type: org_config + schema: + $ref: "#/components/schemas/McpCrossAppAccessIssuerUrlUpdateRequest" + required: true + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_management + summary: Update the MCP Cross-App Access issuer URL + tags: [Organizations] + "x-permission": + operator: OR + permissions: + - org_management + x-unstable: |- + **Note**: This endpoint is in Preview and may change in the future. It is not yet recommended for production use. /api/v2/logs: post: description: |- diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 4ac32ee6555..64ac01a0dac 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -963,6 +963,7 @@ func NewConfiguration() *Configuration { "v2.UpdateForm": false, "v2.UpsertAndPublishFormVersion": false, "v2.UpsertFormVersion": false, + "v2.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl": false, "v2.UpdateOrgSamlConfigurations": false, "v2.GetGovernanceControl": false, "v2.ListGovernanceControls": false, diff --git a/api/datadogV2/api_organizations.go b/api/datadogV2/api_organizations.go index d9c9e63eeab..f12f2b24787 100644 --- a/api/datadogV2/api_organizations.go +++ b/api/datadogV2/api_organizations.go @@ -678,6 +678,89 @@ func (a *OrganizationsApi) UpdateLoginOrgConfigsMaxSessionDuration(ctx _context. return localVarHTTPResponse, nil } +// UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl Update the MCP Cross-App Access issuer URL. +// Update the Okta OIDC issuer URL used for MCP Cross-App Access (XAA) +// for the current organization. The URL must be a bare Okta issuer such +// as `https://your-subdomain.okta.com` (no path, port, query, or fragment). +// Provide an empty string to unset the issuer URL and opt the organization +// out of MCP Cross-App Access. +func (a *OrganizationsApi) UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl(ctx _context.Context, body McpCrossAppAccessIssuerUrlUpdateRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + ) + + operationId := "v2.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return 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.OrganizationsApi.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/login/org_configs/mcp_cross_app_access_issuer_url" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + 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 nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // UpdateOrgConfig Update a specific Org Config. // Update the value of a specific Org Config. func (a *OrganizationsApi) UpdateOrgConfig(ctx _context.Context, orgConfigName string, body OrgConfigWriteRequest) (OrgConfigGetResponse, *_nethttp.Response, error) { diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index 8e09f48757a..b585effa487 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -865,6 +865,7 @@ // - [OrganizationsApi.ListOrgs] // - [OrganizationsApi.ListSAMLConfigurations] // - [OrganizationsApi.UpdateLoginOrgConfigsMaxSessionDuration] +// - [OrganizationsApi.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl] // - [OrganizationsApi.UpdateOrgConfig] // - [OrganizationsApi.UpdateOrgSamlConfigurations] // - [OrganizationsApi.UpdateSAMLConfiguration] diff --git a/api/datadogV2/model_mcp_cross_app_access_issuer_url_type.go b/api/datadogV2/model_mcp_cross_app_access_issuer_url_type.go new file mode 100644 index 00000000000..9b0c3629dac --- /dev/null +++ b/api/datadogV2/model_mcp_cross_app_access_issuer_url_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" +) + +// McpCrossAppAccessIssuerUrlType Data type of an MCP Cross-App Access issuer URL update. +type McpCrossAppAccessIssuerUrlType string + +// List of McpCrossAppAccessIssuerUrlType. +const ( + MCPCROSSAPPACCESSISSUERURLTYPE_ORG_CONFIG McpCrossAppAccessIssuerUrlType = "org_config" +) + +var allowedMcpCrossAppAccessIssuerUrlTypeEnumValues = []McpCrossAppAccessIssuerUrlType{ + MCPCROSSAPPACCESSISSUERURLTYPE_ORG_CONFIG, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *McpCrossAppAccessIssuerUrlType) GetAllowedValues() []McpCrossAppAccessIssuerUrlType { + return allowedMcpCrossAppAccessIssuerUrlTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *McpCrossAppAccessIssuerUrlType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = McpCrossAppAccessIssuerUrlType(value) + return nil +} + +// NewMcpCrossAppAccessIssuerUrlTypeFromValue returns a pointer to a valid McpCrossAppAccessIssuerUrlType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewMcpCrossAppAccessIssuerUrlTypeFromValue(v string) (*McpCrossAppAccessIssuerUrlType, error) { + ev := McpCrossAppAccessIssuerUrlType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for McpCrossAppAccessIssuerUrlType: valid values are %v", v, allowedMcpCrossAppAccessIssuerUrlTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v McpCrossAppAccessIssuerUrlType) IsValid() bool { + for _, existing := range allowedMcpCrossAppAccessIssuerUrlTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to McpCrossAppAccessIssuerUrlType value. +func (v McpCrossAppAccessIssuerUrlType) Ptr() *McpCrossAppAccessIssuerUrlType { + return &v +} diff --git a/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_attributes.go b/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_attributes.go new file mode 100644 index 00000000000..a941ddf9ab9 --- /dev/null +++ b/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_attributes.go @@ -0,0 +1,103 @@ +// 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" +) + +// McpCrossAppAccessIssuerUrlUpdateAttributes Attributes for the MCP Cross-App Access issuer URL update request. +type McpCrossAppAccessIssuerUrlUpdateAttributes struct { + // The Okta OIDC issuer URL for MCP Cross-App Access, for example + // `https://your-subdomain.okta.com`. Provide an empty string to unset + // the issuer URL and opt the organization out of MCP Cross-App Access. + IssuerUrl string `json:"issuer_url"` + // 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:"-"` +} + +// NewMcpCrossAppAccessIssuerUrlUpdateAttributes instantiates a new McpCrossAppAccessIssuerUrlUpdateAttributes 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 NewMcpCrossAppAccessIssuerUrlUpdateAttributes(issuerUrl string) *McpCrossAppAccessIssuerUrlUpdateAttributes { + this := McpCrossAppAccessIssuerUrlUpdateAttributes{} + this.IssuerUrl = issuerUrl + return &this +} + +// NewMcpCrossAppAccessIssuerUrlUpdateAttributesWithDefaults instantiates a new McpCrossAppAccessIssuerUrlUpdateAttributes 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 NewMcpCrossAppAccessIssuerUrlUpdateAttributesWithDefaults() *McpCrossAppAccessIssuerUrlUpdateAttributes { + this := McpCrossAppAccessIssuerUrlUpdateAttributes{} + return &this +} + +// GetIssuerUrl returns the IssuerUrl field value. +func (o *McpCrossAppAccessIssuerUrlUpdateAttributes) GetIssuerUrl() string { + if o == nil { + var ret string + return ret + } + return o.IssuerUrl +} + +// GetIssuerUrlOk returns a tuple with the IssuerUrl field value +// and a boolean to check if the value has been set. +func (o *McpCrossAppAccessIssuerUrlUpdateAttributes) GetIssuerUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IssuerUrl, true +} + +// SetIssuerUrl sets field value. +func (o *McpCrossAppAccessIssuerUrlUpdateAttributes) SetIssuerUrl(v string) { + o.IssuerUrl = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o McpCrossAppAccessIssuerUrlUpdateAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["issuer_url"] = o.IssuerUrl + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *McpCrossAppAccessIssuerUrlUpdateAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + IssuerUrl *string `json:"issuer_url"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.IssuerUrl == nil { + return fmt.Errorf("required field issuer_url missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"issuer_url"}) + } else { + return err + } + o.IssuerUrl = *all.IssuerUrl + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_data.go b/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_data.go new file mode 100644 index 00000000000..e93425ce3d9 --- /dev/null +++ b/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_data.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 ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// McpCrossAppAccessIssuerUrlUpdateData The data object for an MCP Cross-App Access issuer URL update request. +type McpCrossAppAccessIssuerUrlUpdateData struct { + // Attributes for the MCP Cross-App Access issuer URL update request. + Attributes McpCrossAppAccessIssuerUrlUpdateAttributes `json:"attributes"` + // Data type of an MCP Cross-App Access issuer URL update. + Type McpCrossAppAccessIssuerUrlType `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:"-"` +} + +// NewMcpCrossAppAccessIssuerUrlUpdateData instantiates a new McpCrossAppAccessIssuerUrlUpdateData 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 NewMcpCrossAppAccessIssuerUrlUpdateData(attributes McpCrossAppAccessIssuerUrlUpdateAttributes, typeVar McpCrossAppAccessIssuerUrlType) *McpCrossAppAccessIssuerUrlUpdateData { + this := McpCrossAppAccessIssuerUrlUpdateData{} + this.Attributes = attributes + this.Type = typeVar + return &this +} + +// NewMcpCrossAppAccessIssuerUrlUpdateDataWithDefaults instantiates a new McpCrossAppAccessIssuerUrlUpdateData 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 NewMcpCrossAppAccessIssuerUrlUpdateDataWithDefaults() *McpCrossAppAccessIssuerUrlUpdateData { + this := McpCrossAppAccessIssuerUrlUpdateData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *McpCrossAppAccessIssuerUrlUpdateData) GetAttributes() McpCrossAppAccessIssuerUrlUpdateAttributes { + if o == nil { + var ret McpCrossAppAccessIssuerUrlUpdateAttributes + 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 *McpCrossAppAccessIssuerUrlUpdateData) GetAttributesOk() (*McpCrossAppAccessIssuerUrlUpdateAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *McpCrossAppAccessIssuerUrlUpdateData) SetAttributes(v McpCrossAppAccessIssuerUrlUpdateAttributes) { + o.Attributes = v +} + +// GetType returns the Type field value. +func (o *McpCrossAppAccessIssuerUrlUpdateData) GetType() McpCrossAppAccessIssuerUrlType { + if o == nil { + var ret McpCrossAppAccessIssuerUrlType + 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 *McpCrossAppAccessIssuerUrlUpdateData) GetTypeOk() (*McpCrossAppAccessIssuerUrlType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *McpCrossAppAccessIssuerUrlUpdateData) SetType(v McpCrossAppAccessIssuerUrlType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o McpCrossAppAccessIssuerUrlUpdateData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + 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 *McpCrossAppAccessIssuerUrlUpdateData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *McpCrossAppAccessIssuerUrlUpdateAttributes `json:"attributes"` + Type *McpCrossAppAccessIssuerUrlType `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.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "type"}) + } else { + return err + } + + hasInvalidField := false + if 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_mcp_cross_app_access_issuer_url_update_request.go b/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_request.go new file mode 100644 index 00000000000..0ea39349f01 --- /dev/null +++ b/api/datadogV2/model_mcp_cross_app_access_issuer_url_update_request.go @@ -0,0 +1,110 @@ +// 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" +) + +// McpCrossAppAccessIssuerUrlUpdateRequest A request to update the MCP Cross-App Access issuer URL for an organization. +type McpCrossAppAccessIssuerUrlUpdateRequest struct { + // The data object for an MCP Cross-App Access issuer URL update request. + Data McpCrossAppAccessIssuerUrlUpdateData `json:"data"` + // 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:"-"` +} + +// NewMcpCrossAppAccessIssuerUrlUpdateRequest instantiates a new McpCrossAppAccessIssuerUrlUpdateRequest 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 NewMcpCrossAppAccessIssuerUrlUpdateRequest(data McpCrossAppAccessIssuerUrlUpdateData) *McpCrossAppAccessIssuerUrlUpdateRequest { + this := McpCrossAppAccessIssuerUrlUpdateRequest{} + this.Data = data + return &this +} + +// NewMcpCrossAppAccessIssuerUrlUpdateRequestWithDefaults instantiates a new McpCrossAppAccessIssuerUrlUpdateRequest 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 NewMcpCrossAppAccessIssuerUrlUpdateRequestWithDefaults() *McpCrossAppAccessIssuerUrlUpdateRequest { + this := McpCrossAppAccessIssuerUrlUpdateRequest{} + return &this +} + +// GetData returns the Data field value. +func (o *McpCrossAppAccessIssuerUrlUpdateRequest) GetData() McpCrossAppAccessIssuerUrlUpdateData { + if o == nil { + var ret McpCrossAppAccessIssuerUrlUpdateData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *McpCrossAppAccessIssuerUrlUpdateRequest) GetDataOk() (*McpCrossAppAccessIssuerUrlUpdateData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *McpCrossAppAccessIssuerUrlUpdateRequest) SetData(v McpCrossAppAccessIssuerUrlUpdateData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o McpCrossAppAccessIssuerUrlUpdateRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *McpCrossAppAccessIssuerUrlUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *McpCrossAppAccessIssuerUrlUpdateData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.UnmarshalUseNumber(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if 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/examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.go b/examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.go new file mode 100644 index 00000000000..2a420869041 --- /dev/null +++ b/examples/v2/organizations/UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl.go @@ -0,0 +1,34 @@ +// Update the MCP Cross-App Access issuer URL returns "No Content" response + +package main + +import ( + "context" + "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.McpCrossAppAccessIssuerUrlUpdateRequest{ + Data: datadogV2.McpCrossAppAccessIssuerUrlUpdateData{ + Attributes: datadogV2.McpCrossAppAccessIssuerUrlUpdateAttributes{ + IssuerUrl: "https://your-subdomain.okta.com", + }, + Type: datadogV2.MCPCROSSAPPACCESSISSUERURLTYPE_ORG_CONFIG, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewOrganizationsApi(apiClient) + r, err := api.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `OrganizationsApi.UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/tests/scenarios/features/v2/organizations.feature b/tests/scenarios/features/v2/organizations.feature index a8ed63ab7e6..844e415f7f4 100644 --- a/tests/scenarios/features/v2/organizations.feature +++ b/tests/scenarios/features/v2/organizations.feature @@ -168,6 +168,22 @@ Feature: Organizations When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update the MCP Cross-App Access issuer URL returns "Bad Request" response + Given operation "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" enabled + And new "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" request + And body with value {"data": {"attributes": {"issuer_url": "https://your-subdomain.okta.com"}, "type": "org_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update the MCP Cross-App Access issuer URL returns "No Content" response + Given operation "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" enabled + And new "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl" request + And body with value {"data": {"attributes": {"issuer_url": "https://your-subdomain.okta.com"}, "type": "org_config"}} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/delegated-auth-login Scenario: Update the maximum session duration returns "Bad Request" response Given new "UpdateLoginOrgConfigsMaxSessionDuration" request diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index f7316aecda2..ea34cd761d4 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -4768,6 +4768,12 @@ "type": "idempotent" } }, + "UpdateLoginOrgConfigsMcpCrossAppAccessIssuerUrl": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "SubmitLog": { "tag": "Logs", "undo": {