From 55a54d6a80f164b91d213f86f3793459c75c4e1e Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 4 Nov 2026 11:28:01 +0000 Subject: [PATCH] Generate telemetryrouter --- services/telemetryrouter/oas_commit | 2 +- services/telemetryrouter/v1api/api_default.go | 562 ++++++++++++++++++ .../telemetryrouter/v1api/api_default_mock.go | 68 +++ .../v1api/model_access_token_base_request.go | 2 +- .../v1api/model_access_token_base_response.go | 2 +- .../v1api/model_config_filter_attributes.go | 2 +- .../model_create_access_token_payload.go | 2 +- .../model_create_access_token_response.go | 2 +- .../v1api/model_create_destination_payload.go | 2 +- .../model_create_telemetry_router_payload.go | 43 +- ...model_destination_config_open_telemetry.go | 4 +- ...nation_config_open_telemetry_basic_auth.go | 4 +- .../v1api/model_destination_config_s3.go | 4 +- .../model_destination_config_s3_access_key.go | 4 +- .../v1api/model_destination_response.go | 2 +- .../v1api/model_get_access_token_response.go | 2 +- ...del_partial_update_access_token_payload.go | 212 +++++++ ...odel_partial_update_destination_payload.go | 229 +++++++ ...partial_update_telemetry_router_payload.go | 266 +++++++++ .../v1api/model_telemetry_router_response.go | 81 ++- .../model_update_access_token_payload.go | 2 +- .../model_update_access_token_response.go | 2 +- .../v1api/model_update_destination_payload.go | 2 +- .../model_update_telemetry_router_payload.go | 43 +- 24 files changed, 1515 insertions(+), 29 deletions(-) create mode 100644 services/telemetryrouter/v1api/model_partial_update_access_token_payload.go create mode 100644 services/telemetryrouter/v1api/model_partial_update_destination_payload.go create mode 100644 services/telemetryrouter/v1api/model_partial_update_telemetry_router_payload.go diff --git a/services/telemetryrouter/oas_commit b/services/telemetryrouter/oas_commit index fa742ff4a1..63a33b7991 100644 --- a/services/telemetryrouter/oas_commit +++ b/services/telemetryrouter/oas_commit @@ -1 +1 @@ -7fd0fb8e513021dfbad1f5ee736785ec72987b40 +692f43a036e54bd79e6c93ffe2a5dade91548731 diff --git a/services/telemetryrouter/v1api/api_default.go b/services/telemetryrouter/v1api/api_default.go index ff15328037..5474af9ddf 100644 --- a/services/telemetryrouter/v1api/api_default.go +++ b/services/telemetryrouter/v1api/api_default.go @@ -226,6 +226,59 @@ type DefaultAPI interface { // @return ListTelemetryRoutersResponse ListTelemetryRoutersExecute(r ApiListTelemetryRoutersRequest) (*ListTelemetryRoutersResponse, error) + /* + PartialUpdateAccessToken Method for PartialUpdateAccessToken + + Patch an existing access token for the given Telemetry Router by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param telemetryRouterId The Telemetry Router UUID. + @param accessTokenId The Access Token UUID. + @return ApiPartialUpdateAccessTokenRequest + */ + PartialUpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiPartialUpdateAccessTokenRequest + + // PartialUpdateAccessTokenExecute executes the request + // @return UpdateAccessTokenResponse + PartialUpdateAccessTokenExecute(r ApiPartialUpdateAccessTokenRequest) (*UpdateAccessTokenResponse, error) + + /* + PartialUpdateDestination Method for PartialUpdateDestination + + Patches the given destination. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param telemetryRouterId The Telemetry Router UUID. + @param destinationId The Destination UUID. + @return ApiPartialUpdateDestinationRequest + */ + PartialUpdateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiPartialUpdateDestinationRequest + + // PartialUpdateDestinationExecute executes the request + // @return DestinationResponse + PartialUpdateDestinationExecute(r ApiPartialUpdateDestinationRequest) (*DestinationResponse, error) + + /* + PartialUpdateTelemetryRouter Method for PartialUpdateTelemetryRouter + + Patches the given Telemetry Router. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param telemetryRouterId The Telemetry Router UUID. + @return ApiPartialUpdateTelemetryRouterRequest + */ + PartialUpdateTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiPartialUpdateTelemetryRouterRequest + + // PartialUpdateTelemetryRouterExecute executes the request + // @return TelemetryRouterResponse + PartialUpdateTelemetryRouterExecute(r ApiPartialUpdateTelemetryRouterRequest) (*TelemetryRouterResponse, error) + /* UpdateAccessToken Method for UpdateAccessToken @@ -2210,6 +2263,515 @@ func (a *DefaultAPIService) ListTelemetryRoutersExecute(r ApiListTelemetryRouter return localVarReturnValue, nil } +type ApiPartialUpdateAccessTokenRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + telemetryRouterId string + accessTokenId string + partialUpdateAccessTokenPayload *PartialUpdateAccessTokenPayload +} + +func (r ApiPartialUpdateAccessTokenRequest) PartialUpdateAccessTokenPayload(partialUpdateAccessTokenPayload PartialUpdateAccessTokenPayload) ApiPartialUpdateAccessTokenRequest { + r.partialUpdateAccessTokenPayload = &partialUpdateAccessTokenPayload + return r +} + +func (r ApiPartialUpdateAccessTokenRequest) Execute() (*UpdateAccessTokenResponse, error) { + return r.ApiService.PartialUpdateAccessTokenExecute(r) +} + +/* +PartialUpdateAccessToken Method for PartialUpdateAccessToken + +Patch an existing access token for the given Telemetry Router by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param telemetryRouterId The Telemetry Router UUID. + @param accessTokenId The Access Token UUID. + @return ApiPartialUpdateAccessTokenRequest +*/ +func (a *DefaultAPIService) PartialUpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiPartialUpdateAccessTokenRequest { + return ApiPartialUpdateAccessTokenRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + telemetryRouterId: telemetryRouterId, + accessTokenId: accessTokenId, + } +} + +// Execute executes the request +// +// @return UpdateAccessTokenResponse +func (a *DefaultAPIService) PartialUpdateAccessTokenExecute(r ApiPartialUpdateAccessTokenRequest) (*UpdateAccessTokenResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateAccessTokenResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateAccessToken") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/telemetry-routers/{telemetryRouterId}/access-tokens/{accessTokenId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"telemetryRouterId"+"}", url.PathEscape(parameterValueToString(r.telemetryRouterId, "telemetryRouterId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"accessTokenId"+"}", url.PathEscape(parameterValueToString(r.accessTokenId, "accessTokenId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateAccessTokenPayload == nil { + return localVarReturnValue, reportError("partialUpdateAccessTokenPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateAccessTokenPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateDestinationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + telemetryRouterId string + destinationId string + partialUpdateDestinationPayload *PartialUpdateDestinationPayload +} + +func (r ApiPartialUpdateDestinationRequest) PartialUpdateDestinationPayload(partialUpdateDestinationPayload PartialUpdateDestinationPayload) ApiPartialUpdateDestinationRequest { + r.partialUpdateDestinationPayload = &partialUpdateDestinationPayload + return r +} + +func (r ApiPartialUpdateDestinationRequest) Execute() (*DestinationResponse, error) { + return r.ApiService.PartialUpdateDestinationExecute(r) +} + +/* +PartialUpdateDestination Method for PartialUpdateDestination + +Patches the given destination. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param telemetryRouterId The Telemetry Router UUID. + @param destinationId The Destination UUID. + @return ApiPartialUpdateDestinationRequest +*/ +func (a *DefaultAPIService) PartialUpdateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiPartialUpdateDestinationRequest { + return ApiPartialUpdateDestinationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + telemetryRouterId: telemetryRouterId, + destinationId: destinationId, + } +} + +// Execute executes the request +// +// @return DestinationResponse +func (a *DefaultAPIService) PartialUpdateDestinationExecute(r ApiPartialUpdateDestinationRequest) (*DestinationResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DestinationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateDestination") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/telemetry-routers/{telemetryRouterId}/destinations/{destinationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"telemetryRouterId"+"}", url.PathEscape(parameterValueToString(r.telemetryRouterId, "telemetryRouterId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"destinationId"+"}", url.PathEscape(parameterValueToString(r.destinationId, "destinationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateDestinationPayload == nil { + return localVarReturnValue, reportError("partialUpdateDestinationPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateDestinationPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateTelemetryRouterRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + regionId string + telemetryRouterId string + partialUpdateTelemetryRouterPayload *PartialUpdateTelemetryRouterPayload +} + +func (r ApiPartialUpdateTelemetryRouterRequest) PartialUpdateTelemetryRouterPayload(partialUpdateTelemetryRouterPayload PartialUpdateTelemetryRouterPayload) ApiPartialUpdateTelemetryRouterRequest { + r.partialUpdateTelemetryRouterPayload = &partialUpdateTelemetryRouterPayload + return r +} + +func (r ApiPartialUpdateTelemetryRouterRequest) Execute() (*TelemetryRouterResponse, error) { + return r.ApiService.PartialUpdateTelemetryRouterExecute(r) +} + +/* +PartialUpdateTelemetryRouter Method for PartialUpdateTelemetryRouter + +Patches the given Telemetry Router. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The STACKIT portal project UUID the resource is located in. + @param regionId The STACKIT region name the resource is located in. + @param telemetryRouterId The Telemetry Router UUID. + @return ApiPartialUpdateTelemetryRouterRequest +*/ +func (a *DefaultAPIService) PartialUpdateTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiPartialUpdateTelemetryRouterRequest { + return ApiPartialUpdateTelemetryRouterRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + telemetryRouterId: telemetryRouterId, + } +} + +// Execute executes the request +// +// @return TelemetryRouterResponse +func (a *DefaultAPIService) PartialUpdateTelemetryRouterExecute(r ApiPartialUpdateTelemetryRouterRequest) (*TelemetryRouterResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelemetryRouterResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateTelemetryRouter") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/telemetry-routers/{telemetryRouterId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(parameterValueToString(r.regionId, "regionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"telemetryRouterId"+"}", url.PathEscape(parameterValueToString(r.telemetryRouterId, "telemetryRouterId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.partialUpdateTelemetryRouterPayload == nil { + return localVarReturnValue, reportError("partialUpdateTelemetryRouterPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateTelemetryRouterPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Response4xx + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + type ApiUpdateAccessTokenRequest struct { ctx context.Context ApiService DefaultAPI diff --git a/services/telemetryrouter/v1api/api_default_mock.go b/services/telemetryrouter/v1api/api_default_mock.go index e1c69c049f..171fb20626 100644 --- a/services/telemetryrouter/v1api/api_default_mock.go +++ b/services/telemetryrouter/v1api/api_default_mock.go @@ -44,6 +44,12 @@ type DefaultAPIServiceMock struct { ListDestinationsExecuteMock *func(r ApiListDestinationsRequest) (*ListDestinationsResponse, error) // ListTelemetryRoutersExecuteMock can be populated to implement the behavior of the ListTelemetryRoutersExecute function of this mock ListTelemetryRoutersExecuteMock *func(r ApiListTelemetryRoutersRequest) (*ListTelemetryRoutersResponse, error) + // PartialUpdateAccessTokenExecuteMock can be populated to implement the behavior of the PartialUpdateAccessTokenExecute function of this mock + PartialUpdateAccessTokenExecuteMock *func(r ApiPartialUpdateAccessTokenRequest) (*UpdateAccessTokenResponse, error) + // PartialUpdateDestinationExecuteMock can be populated to implement the behavior of the PartialUpdateDestinationExecute function of this mock + PartialUpdateDestinationExecuteMock *func(r ApiPartialUpdateDestinationRequest) (*DestinationResponse, error) + // PartialUpdateTelemetryRouterExecuteMock can be populated to implement the behavior of the PartialUpdateTelemetryRouterExecute function of this mock + PartialUpdateTelemetryRouterExecuteMock *func(r ApiPartialUpdateTelemetryRouterRequest) (*TelemetryRouterResponse, error) // UpdateAccessTokenExecuteMock can be populated to implement the behavior of the UpdateAccessTokenExecute function of this mock UpdateAccessTokenExecuteMock *func(r ApiUpdateAccessTokenRequest) (*UpdateAccessTokenResponse, error) // UpdateDestinationExecuteMock can be populated to implement the behavior of the UpdateDestinationExecute function of this mock @@ -291,6 +297,68 @@ func (a DefaultAPIServiceMock) ListTelemetryRoutersExecute(r ApiListTelemetryRou return (*a.ListTelemetryRoutersExecuteMock)(r) } +func (a DefaultAPIServiceMock) PartialUpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiPartialUpdateAccessTokenRequest { + return ApiPartialUpdateAccessTokenRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + telemetryRouterId: telemetryRouterId, + accessTokenId: accessTokenId, + } +} + +// PartialUpdateAccessTokenExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateAccessTokenExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateAccessTokenExecute(r ApiPartialUpdateAccessTokenRequest) (*UpdateAccessTokenResponse, error) { + if a.PartialUpdateAccessTokenExecuteMock == nil { + var localVarReturnValue *UpdateAccessTokenResponse + return localVarReturnValue, nil + } + + return (*a.PartialUpdateAccessTokenExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateDestination(ctx context.Context, projectId string, regionId string, telemetryRouterId string, destinationId string) ApiPartialUpdateDestinationRequest { + return ApiPartialUpdateDestinationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + telemetryRouterId: telemetryRouterId, + destinationId: destinationId, + } +} + +// PartialUpdateDestinationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateDestinationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateDestinationExecute(r ApiPartialUpdateDestinationRequest) (*DestinationResponse, error) { + if a.PartialUpdateDestinationExecuteMock == nil { + var localVarReturnValue *DestinationResponse + return localVarReturnValue, nil + } + + return (*a.PartialUpdateDestinationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateTelemetryRouter(ctx context.Context, projectId string, regionId string, telemetryRouterId string) ApiPartialUpdateTelemetryRouterRequest { + return ApiPartialUpdateTelemetryRouterRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + regionId: regionId, + telemetryRouterId: telemetryRouterId, + } +} + +// PartialUpdateTelemetryRouterExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateTelemetryRouterExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateTelemetryRouterExecute(r ApiPartialUpdateTelemetryRouterRequest) (*TelemetryRouterResponse, error) { + if a.PartialUpdateTelemetryRouterExecuteMock == nil { + var localVarReturnValue *TelemetryRouterResponse + return localVarReturnValue, nil + } + + return (*a.PartialUpdateTelemetryRouterExecuteMock)(r) +} + func (a DefaultAPIServiceMock) UpdateAccessToken(ctx context.Context, projectId string, regionId string, telemetryRouterId string, accessTokenId string) ApiUpdateAccessTokenRequest { return ApiUpdateAccessTokenRequest{ ApiService: a, diff --git a/services/telemetryrouter/v1api/model_access_token_base_request.go b/services/telemetryrouter/v1api/model_access_token_base_request.go index 2da1d3cc27..bd38db7e08 100644 --- a/services/telemetryrouter/v1api/model_access_token_base_request.go +++ b/services/telemetryrouter/v1api/model_access_token_base_request.go @@ -21,7 +21,7 @@ var _ MappedNullable = &AccessTokenBaseRequest{} // AccessTokenBaseRequest struct for AccessTokenBaseRequest type AccessTokenBaseRequest struct { // The description of the access token. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The selected display name of the access token. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` // The time-to-live (TTL) in days for the access token. If not set, token will not expire. diff --git a/services/telemetryrouter/v1api/model_access_token_base_response.go b/services/telemetryrouter/v1api/model_access_token_base_response.go index 3935d4a38d..046f84b71f 100644 --- a/services/telemetryrouter/v1api/model_access_token_base_response.go +++ b/services/telemetryrouter/v1api/model_access_token_base_response.go @@ -24,7 +24,7 @@ type AccessTokenBaseResponse struct { // The user ID of the creator of the access token. CreatorId string `json:"creatorId"` // The description of the access token. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The selected display name of the access token. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 ]*$"` // The date and time until the access token is valid to (inclusively). diff --git a/services/telemetryrouter/v1api/model_config_filter_attributes.go b/services/telemetryrouter/v1api/model_config_filter_attributes.go index 21c608b452..b44a0042f9 100644 --- a/services/telemetryrouter/v1api/model_config_filter_attributes.go +++ b/services/telemetryrouter/v1api/model_config_filter_attributes.go @@ -20,7 +20,7 @@ var _ MappedNullable = &ConfigFilterAttributes{} // ConfigFilterAttributes struct for ConfigFilterAttributes type ConfigFilterAttributes struct { - Key string `json:"key"` + Key string `json:"key" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` Level ConfigFilterLevel `json:"level"` Matcher ConfigFilterMatcher `json:"matcher"` Values []string `json:"values"` diff --git a/services/telemetryrouter/v1api/model_create_access_token_payload.go b/services/telemetryrouter/v1api/model_create_access_token_payload.go index dd47a6d6cc..86e4d4f7da 100644 --- a/services/telemetryrouter/v1api/model_create_access_token_payload.go +++ b/services/telemetryrouter/v1api/model_create_access_token_payload.go @@ -21,7 +21,7 @@ var _ MappedNullable = &CreateAccessTokenPayload{} // CreateAccessTokenPayload struct for CreateAccessTokenPayload type CreateAccessTokenPayload struct { // The description of the access token. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The selected display name of the access token. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` // The time-to-live (TTL) in days for the access token. If not set, token will not expire. diff --git a/services/telemetryrouter/v1api/model_create_access_token_response.go b/services/telemetryrouter/v1api/model_create_access_token_response.go index 145559d440..43f141519a 100644 --- a/services/telemetryrouter/v1api/model_create_access_token_response.go +++ b/services/telemetryrouter/v1api/model_create_access_token_response.go @@ -24,7 +24,7 @@ type CreateAccessTokenResponse struct { // The user ID of the creator of the access token. CreatorId string `json:"creatorId"` // The description of the access token. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The selected display name of the access token. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 ]*$"` // The date and time until the access token is valid to (inclusively). diff --git a/services/telemetryrouter/v1api/model_create_destination_payload.go b/services/telemetryrouter/v1api/model_create_destination_payload.go index e9c6f435f1..34771e95f3 100644 --- a/services/telemetryrouter/v1api/model_create_destination_payload.go +++ b/services/telemetryrouter/v1api/model_create_destination_payload.go @@ -22,7 +22,7 @@ var _ MappedNullable = &CreateDestinationPayload{} type CreateDestinationPayload struct { Config DestinationConfig `json:"config"` // The description is a longer text chosen by the user to provide more context for the resource. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The display name is a short name chosen by the user to identify the resource. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` AdditionalProperties map[string]interface{} diff --git a/services/telemetryrouter/v1api/model_create_telemetry_router_payload.go b/services/telemetryrouter/v1api/model_create_telemetry_router_payload.go index 86e8df39f4..5c3bc41be3 100644 --- a/services/telemetryrouter/v1api/model_create_telemetry_router_payload.go +++ b/services/telemetryrouter/v1api/model_create_telemetry_router_payload.go @@ -21,10 +21,11 @@ var _ MappedNullable = &CreateTelemetryRouterPayload{} // CreateTelemetryRouterPayload struct for CreateTelemetryRouterPayload type CreateTelemetryRouterPayload struct { // The description is a longer text chosen by the user to provide more context for the resource. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The display name is a short name chosen by the user to identify the resource. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` - Filter *ConfigFilter `json:"filter,omitempty"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` + Filter *ConfigFilter `json:"filter,omitempty"` + ResourceLabels *map[string]string `json:"resourceLabels,omitempty"` AdditionalProperties map[string]interface{} } @@ -136,6 +137,38 @@ func (o *CreateTelemetryRouterPayload) SetFilter(v ConfigFilter) { o.Filter = &v } +// GetResourceLabels returns the ResourceLabels field value if set, zero value otherwise. +func (o *CreateTelemetryRouterPayload) GetResourceLabels() map[string]string { + if o == nil || IsNil(o.ResourceLabels) { + var ret map[string]string + return ret + } + return *o.ResourceLabels +} + +// GetResourceLabelsOk returns a tuple with the ResourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateTelemetryRouterPayload) GetResourceLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.ResourceLabels) { + return nil, false + } + return o.ResourceLabels, true +} + +// HasResourceLabels returns a boolean if a field has been set. +func (o *CreateTelemetryRouterPayload) HasResourceLabels() bool { + if o != nil && !IsNil(o.ResourceLabels) { + return true + } + + return false +} + +// SetResourceLabels gets a reference to the given map[string]string and assigns it to the ResourceLabels field. +func (o *CreateTelemetryRouterPayload) SetResourceLabels(v map[string]string) { + o.ResourceLabels = &v +} + func (o CreateTelemetryRouterPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -153,6 +186,9 @@ func (o CreateTelemetryRouterPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } + if !IsNil(o.ResourceLabels) { + toSerialize["resourceLabels"] = o.ResourceLabels + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -199,6 +235,7 @@ func (o *CreateTelemetryRouterPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "description") delete(additionalProperties, "displayName") delete(additionalProperties, "filter") + delete(additionalProperties, "resourceLabels") o.AdditionalProperties = additionalProperties } diff --git a/services/telemetryrouter/v1api/model_destination_config_open_telemetry.go b/services/telemetryrouter/v1api/model_destination_config_open_telemetry.go index 9d601862a0..f7ee0b6dda 100644 --- a/services/telemetryrouter/v1api/model_destination_config_open_telemetry.go +++ b/services/telemetryrouter/v1api/model_destination_config_open_telemetry.go @@ -22,9 +22,9 @@ var _ MappedNullable = &DestinationConfigOpenTelemetry{} type DestinationConfigOpenTelemetry struct { BasicAuth *DestinationConfigOpenTelemetryBasicAuth `json:"basicAuth,omitempty"` // A bearer token to authenticate at the OpenTelemetry URI. - BearerToken *string `json:"bearerToken,omitempty"` + BearerToken *string `json:"bearerToken,omitempty" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` // The URI for reaching the resource. - Uri string `json:"uri"` + Uri string `json:"uri" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` AdditionalProperties map[string]interface{} } diff --git a/services/telemetryrouter/v1api/model_destination_config_open_telemetry_basic_auth.go b/services/telemetryrouter/v1api/model_destination_config_open_telemetry_basic_auth.go index 328090ccc8..c33ec6510c 100644 --- a/services/telemetryrouter/v1api/model_destination_config_open_telemetry_basic_auth.go +++ b/services/telemetryrouter/v1api/model_destination_config_open_telemetry_basic_auth.go @@ -20,8 +20,8 @@ var _ MappedNullable = &DestinationConfigOpenTelemetryBasicAuth{} // DestinationConfigOpenTelemetryBasicAuth Basic auth to authenticate at the OpenTelemetry URI type DestinationConfigOpenTelemetryBasicAuth struct { - Password string `json:"password"` - Username string `json:"username"` + Password string `json:"password" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` + Username string `json:"username" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` AdditionalProperties map[string]interface{} } diff --git a/services/telemetryrouter/v1api/model_destination_config_s3.go b/services/telemetryrouter/v1api/model_destination_config_s3.go index fda0e07ca8..b560edd592 100644 --- a/services/telemetryrouter/v1api/model_destination_config_s3.go +++ b/services/telemetryrouter/v1api/model_destination_config_s3.go @@ -21,9 +21,9 @@ var _ MappedNullable = &DestinationConfigS3{} // DestinationConfigS3 struct for DestinationConfigS3 type DestinationConfigS3 struct { AccessKey *DestinationConfigS3AccessKey `json:"accessKey,omitempty"` - Bucket string `json:"bucket"` + Bucket string `json:"bucket" validate:"regexp=^[a-z0-9\\-]+$"` // The URI for reaching the resource. - Endpoint string `json:"endpoint"` + Endpoint string `json:"endpoint" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` AdditionalProperties map[string]interface{} } diff --git a/services/telemetryrouter/v1api/model_destination_config_s3_access_key.go b/services/telemetryrouter/v1api/model_destination_config_s3_access_key.go index 2ad0578421..861ce7e05d 100644 --- a/services/telemetryrouter/v1api/model_destination_config_s3_access_key.go +++ b/services/telemetryrouter/v1api/model_destination_config_s3_access_key.go @@ -20,8 +20,8 @@ var _ MappedNullable = &DestinationConfigS3AccessKey{} // DestinationConfigS3AccessKey The S3 access key type DestinationConfigS3AccessKey struct { - Id string `json:"id"` - Secret string `json:"secret"` + Id string `json:"id" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` + Secret string `json:"secret" validate:"regexp=^[^\\\\0-\\\\x1F\\\\x7F-\\\\x9F]+$"` AdditionalProperties map[string]interface{} } diff --git a/services/telemetryrouter/v1api/model_destination_response.go b/services/telemetryrouter/v1api/model_destination_response.go index 18c5741d86..2542a149b2 100644 --- a/services/telemetryrouter/v1api/model_destination_response.go +++ b/services/telemetryrouter/v1api/model_destination_response.go @@ -26,7 +26,7 @@ type DestinationResponse struct { CreationTime time.Time `json:"creationTime"` CredentialType DestinationResponseCredentialType `json:"credentialType"` // The description is a longer text chosen by the user to provide more context for the resource. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The display name is a short name chosen by the user to identify the resource. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` // A auto generated unique id which identifies the resource. diff --git a/services/telemetryrouter/v1api/model_get_access_token_response.go b/services/telemetryrouter/v1api/model_get_access_token_response.go index de5cf72d25..a44cceab2b 100644 --- a/services/telemetryrouter/v1api/model_get_access_token_response.go +++ b/services/telemetryrouter/v1api/model_get_access_token_response.go @@ -24,7 +24,7 @@ type GetAccessTokenResponse struct { // The user ID of the creator of the access token. CreatorId string `json:"creatorId"` // The description of the access token. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The selected display name of the access token. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 ]*$"` // The date and time until the access token is valid to (inclusively). diff --git a/services/telemetryrouter/v1api/model_partial_update_access_token_payload.go b/services/telemetryrouter/v1api/model_partial_update_access_token_payload.go new file mode 100644 index 0000000000..92390f1a6e --- /dev/null +++ b/services/telemetryrouter/v1api/model_partial_update_access_token_payload.go @@ -0,0 +1,212 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateAccessTokenPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateAccessTokenPayload{} + +// PartialUpdateAccessTokenPayload struct for PartialUpdateAccessTokenPayload +type PartialUpdateAccessTokenPayload struct { + Description NullableString `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` + DisplayName NullableString `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateAccessTokenPayload PartialUpdateAccessTokenPayload + +// NewPartialUpdateAccessTokenPayload instantiates a new PartialUpdateAccessTokenPayload 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 NewPartialUpdateAccessTokenPayload() *PartialUpdateAccessTokenPayload { + this := PartialUpdateAccessTokenPayload{} + return &this +} + +// NewPartialUpdateAccessTokenPayloadWithDefaults instantiates a new PartialUpdateAccessTokenPayload 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 NewPartialUpdateAccessTokenPayloadWithDefaults() *PartialUpdateAccessTokenPayload { + this := PartialUpdateAccessTokenPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PartialUpdateAccessTokenPayload) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string + return ret + } + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description 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 *PartialUpdateAccessTokenPayload) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// HasDescription returns a boolean if a field has been set. +func (o *PartialUpdateAccessTokenPayload) HasDescription() bool { + if o != nil && o.Description.IsSet() { + return true + } + + return false +} + +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *PartialUpdateAccessTokenPayload) SetDescription(v string) { + o.Description.Set(&v) +} + +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *PartialUpdateAccessTokenPayload) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *PartialUpdateAccessTokenPayload) UnsetDescription() { + o.Description.Unset() +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PartialUpdateAccessTokenPayload) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName.Get()) { + var ret string + return ret + } + return *o.DisplayName.Get() +} + +// GetDisplayNameOk returns a tuple with the DisplayName 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 *PartialUpdateAccessTokenPayload) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DisplayName.Get(), o.DisplayName.IsSet() +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *PartialUpdateAccessTokenPayload) HasDisplayName() bool { + if o != nil && o.DisplayName.IsSet() { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given NullableString and assigns it to the DisplayName field. +func (o *PartialUpdateAccessTokenPayload) SetDisplayName(v string) { + o.DisplayName.Set(&v) +} + +// SetDisplayNameNil sets the value for DisplayName to be an explicit nil +func (o *PartialUpdateAccessTokenPayload) SetDisplayNameNil() { + o.DisplayName.Set(nil) +} + +// UnsetDisplayName ensures that no value is present for DisplayName, not even an explicit nil +func (o *PartialUpdateAccessTokenPayload) UnsetDisplayName() { + o.DisplayName.Unset() +} + +func (o PartialUpdateAccessTokenPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateAccessTokenPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if o.DisplayName.IsSet() { + toSerialize["displayName"] = o.DisplayName.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateAccessTokenPayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateAccessTokenPayload := _PartialUpdateAccessTokenPayload{} + + err = json.Unmarshal(data, &varPartialUpdateAccessTokenPayload) + + if err != nil { + return err + } + + *o = PartialUpdateAccessTokenPayload(varPartialUpdateAccessTokenPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "displayName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateAccessTokenPayload struct { + value *PartialUpdateAccessTokenPayload + isSet bool +} + +func (v NullablePartialUpdateAccessTokenPayload) Get() *PartialUpdateAccessTokenPayload { + return v.value +} + +func (v *NullablePartialUpdateAccessTokenPayload) Set(val *PartialUpdateAccessTokenPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateAccessTokenPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateAccessTokenPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateAccessTokenPayload(val *PartialUpdateAccessTokenPayload) *NullablePartialUpdateAccessTokenPayload { + return &NullablePartialUpdateAccessTokenPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateAccessTokenPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateAccessTokenPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1api/model_partial_update_destination_payload.go b/services/telemetryrouter/v1api/model_partial_update_destination_payload.go new file mode 100644 index 0000000000..4131f07db7 --- /dev/null +++ b/services/telemetryrouter/v1api/model_partial_update_destination_payload.go @@ -0,0 +1,229 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateDestinationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateDestinationPayload{} + +// PartialUpdateDestinationPayload struct for PartialUpdateDestinationPayload +type PartialUpdateDestinationPayload struct { + Config *DestinationConfig `json:"config,omitempty"` + // The description is a longer text chosen by the user to provide more context for the resource. + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` + // The display name is a short name chosen by the user to identify the resource. + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateDestinationPayload PartialUpdateDestinationPayload + +// NewPartialUpdateDestinationPayload instantiates a new PartialUpdateDestinationPayload 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 NewPartialUpdateDestinationPayload() *PartialUpdateDestinationPayload { + this := PartialUpdateDestinationPayload{} + return &this +} + +// NewPartialUpdateDestinationPayloadWithDefaults instantiates a new PartialUpdateDestinationPayload 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 NewPartialUpdateDestinationPayloadWithDefaults() *PartialUpdateDestinationPayload { + this := PartialUpdateDestinationPayload{} + return &this +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *PartialUpdateDestinationPayload) GetConfig() DestinationConfig { + if o == nil || IsNil(o.Config) { + var ret DestinationConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateDestinationPayload) GetConfigOk() (*DestinationConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *PartialUpdateDestinationPayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given DestinationConfig and assigns it to the Config field. +func (o *PartialUpdateDestinationPayload) SetConfig(v DestinationConfig) { + o.Config = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PartialUpdateDestinationPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + 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 *PartialUpdateDestinationPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PartialUpdateDestinationPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PartialUpdateDestinationPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *PartialUpdateDestinationPayload) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret + } + return *o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateDestinationPayload) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *PartialUpdateDestinationPayload) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *PartialUpdateDestinationPayload) SetDisplayName(v string) { + o.DisplayName = &v +} + +func (o PartialUpdateDestinationPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateDestinationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateDestinationPayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateDestinationPayload := _PartialUpdateDestinationPayload{} + + err = json.Unmarshal(data, &varPartialUpdateDestinationPayload) + + if err != nil { + return err + } + + *o = PartialUpdateDestinationPayload(varPartialUpdateDestinationPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "config") + delete(additionalProperties, "description") + delete(additionalProperties, "displayName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateDestinationPayload struct { + value *PartialUpdateDestinationPayload + isSet bool +} + +func (v NullablePartialUpdateDestinationPayload) Get() *PartialUpdateDestinationPayload { + return v.value +} + +func (v *NullablePartialUpdateDestinationPayload) Set(val *PartialUpdateDestinationPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateDestinationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateDestinationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateDestinationPayload(val *PartialUpdateDestinationPayload) *NullablePartialUpdateDestinationPayload { + return &NullablePartialUpdateDestinationPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateDestinationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateDestinationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1api/model_partial_update_telemetry_router_payload.go b/services/telemetryrouter/v1api/model_partial_update_telemetry_router_payload.go new file mode 100644 index 0000000000..bcb664bfcb --- /dev/null +++ b/services/telemetryrouter/v1api/model_partial_update_telemetry_router_payload.go @@ -0,0 +1,266 @@ +/* +STACKIT Telemetry Router API + +This API provides endpoints for managing Telemetry Routers. + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateTelemetryRouterPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateTelemetryRouterPayload{} + +// PartialUpdateTelemetryRouterPayload struct for PartialUpdateTelemetryRouterPayload +type PartialUpdateTelemetryRouterPayload struct { + // The description is a longer text chosen by the user to provide more context for the resource. + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` + // The display name is a short name chosen by the user to identify the resource. + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` + Filter *ConfigFilter `json:"filter,omitempty"` + ResourceLabels *map[string]string `json:"resourceLabels,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialUpdateTelemetryRouterPayload PartialUpdateTelemetryRouterPayload + +// NewPartialUpdateTelemetryRouterPayload instantiates a new PartialUpdateTelemetryRouterPayload 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 NewPartialUpdateTelemetryRouterPayload() *PartialUpdateTelemetryRouterPayload { + this := PartialUpdateTelemetryRouterPayload{} + return &this +} + +// NewPartialUpdateTelemetryRouterPayloadWithDefaults instantiates a new PartialUpdateTelemetryRouterPayload 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 NewPartialUpdateTelemetryRouterPayloadWithDefaults() *PartialUpdateTelemetryRouterPayload { + this := PartialUpdateTelemetryRouterPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PartialUpdateTelemetryRouterPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + 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 *PartialUpdateTelemetryRouterPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PartialUpdateTelemetryRouterPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PartialUpdateTelemetryRouterPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDisplayName returns the DisplayName field value if set, zero value otherwise. +func (o *PartialUpdateTelemetryRouterPayload) GetDisplayName() string { + if o == nil || IsNil(o.DisplayName) { + var ret string + return ret + } + return *o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateTelemetryRouterPayload) GetDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DisplayName) { + return nil, false + } + return o.DisplayName, true +} + +// HasDisplayName returns a boolean if a field has been set. +func (o *PartialUpdateTelemetryRouterPayload) HasDisplayName() bool { + if o != nil && !IsNil(o.DisplayName) { + return true + } + + return false +} + +// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. +func (o *PartialUpdateTelemetryRouterPayload) SetDisplayName(v string) { + o.DisplayName = &v +} + +// GetFilter returns the Filter field value if set, zero value otherwise. +func (o *PartialUpdateTelemetryRouterPayload) GetFilter() ConfigFilter { + if o == nil || IsNil(o.Filter) { + var ret ConfigFilter + return ret + } + return *o.Filter +} + +// GetFilterOk returns a tuple with the Filter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateTelemetryRouterPayload) GetFilterOk() (*ConfigFilter, bool) { + if o == nil || IsNil(o.Filter) { + return nil, false + } + return o.Filter, true +} + +// HasFilter returns a boolean if a field has been set. +func (o *PartialUpdateTelemetryRouterPayload) HasFilter() bool { + if o != nil && !IsNil(o.Filter) { + return true + } + + return false +} + +// SetFilter gets a reference to the given ConfigFilter and assigns it to the Filter field. +func (o *PartialUpdateTelemetryRouterPayload) SetFilter(v ConfigFilter) { + o.Filter = &v +} + +// GetResourceLabels returns the ResourceLabels field value if set, zero value otherwise. +func (o *PartialUpdateTelemetryRouterPayload) GetResourceLabels() map[string]string { + if o == nil || IsNil(o.ResourceLabels) { + var ret map[string]string + return ret + } + return *o.ResourceLabels +} + +// GetResourceLabelsOk returns a tuple with the ResourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateTelemetryRouterPayload) GetResourceLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.ResourceLabels) { + return nil, false + } + return o.ResourceLabels, true +} + +// HasResourceLabels returns a boolean if a field has been set. +func (o *PartialUpdateTelemetryRouterPayload) HasResourceLabels() bool { + if o != nil && !IsNil(o.ResourceLabels) { + return true + } + + return false +} + +// SetResourceLabels gets a reference to the given map[string]string and assigns it to the ResourceLabels field. +func (o *PartialUpdateTelemetryRouterPayload) SetResourceLabels(v map[string]string) { + o.ResourceLabels = &v +} + +func (o PartialUpdateTelemetryRouterPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateTelemetryRouterPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DisplayName) { + toSerialize["displayName"] = o.DisplayName + } + if !IsNil(o.Filter) { + toSerialize["filter"] = o.Filter + } + if !IsNil(o.ResourceLabels) { + toSerialize["resourceLabels"] = o.ResourceLabels + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUpdateTelemetryRouterPayload) UnmarshalJSON(data []byte) (err error) { + varPartialUpdateTelemetryRouterPayload := _PartialUpdateTelemetryRouterPayload{} + + err = json.Unmarshal(data, &varPartialUpdateTelemetryRouterPayload) + + if err != nil { + return err + } + + *o = PartialUpdateTelemetryRouterPayload(varPartialUpdateTelemetryRouterPayload) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "displayName") + delete(additionalProperties, "filter") + delete(additionalProperties, "resourceLabels") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUpdateTelemetryRouterPayload struct { + value *PartialUpdateTelemetryRouterPayload + isSet bool +} + +func (v NullablePartialUpdateTelemetryRouterPayload) Get() *PartialUpdateTelemetryRouterPayload { + return v.value +} + +func (v *NullablePartialUpdateTelemetryRouterPayload) Set(val *PartialUpdateTelemetryRouterPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateTelemetryRouterPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateTelemetryRouterPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateTelemetryRouterPayload(val *PartialUpdateTelemetryRouterPayload) *NullablePartialUpdateTelemetryRouterPayload { + return &NullablePartialUpdateTelemetryRouterPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateTelemetryRouterPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateTelemetryRouterPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/telemetryrouter/v1api/model_telemetry_router_response.go b/services/telemetryrouter/v1api/model_telemetry_router_response.go index 01b4dc13a6..dc79c5ff66 100644 --- a/services/telemetryrouter/v1api/model_telemetry_router_response.go +++ b/services/telemetryrouter/v1api/model_telemetry_router_response.go @@ -24,13 +24,16 @@ type TelemetryRouterResponse struct { // The point in time the resource was created. CreationTime time.Time `json:"creationTime"` // The description is a longer text chosen by the user to provide more context for the resource. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` + // The number of destinations configured for the telemetry router. + DestinationCount *int32 `json:"destinationCount,omitempty"` // The display name is a short name chosen by the user to identify the resource. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` Filter *ConfigFilter `json:"filter,omitempty"` // A auto generated unique id which identifies the resource. - Id string `json:"id"` - Status TelemetryRouterResponseStatus `json:"status"` + Id string `json:"id"` + ResourceLabels *map[string]string `json:"resourceLabels,omitempty"` + Status TelemetryRouterResponseStatus `json:"status"` // The URI for reaching the resource. Uri string `json:"uri"` AdditionalProperties map[string]interface{} @@ -116,6 +119,38 @@ func (o *TelemetryRouterResponse) SetDescription(v string) { o.Description = &v } +// GetDestinationCount returns the DestinationCount field value if set, zero value otherwise. +func (o *TelemetryRouterResponse) GetDestinationCount() int32 { + if o == nil || IsNil(o.DestinationCount) { + var ret int32 + return ret + } + return *o.DestinationCount +} + +// GetDestinationCountOk returns a tuple with the DestinationCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelemetryRouterResponse) GetDestinationCountOk() (*int32, bool) { + if o == nil || IsNil(o.DestinationCount) { + return nil, false + } + return o.DestinationCount, true +} + +// HasDestinationCount returns a boolean if a field has been set. +func (o *TelemetryRouterResponse) HasDestinationCount() bool { + if o != nil && !IsNil(o.DestinationCount) { + return true + } + + return false +} + +// SetDestinationCount gets a reference to the given int32 and assigns it to the DestinationCount field. +func (o *TelemetryRouterResponse) SetDestinationCount(v int32) { + o.DestinationCount = &v +} + // GetDisplayName returns the DisplayName field value func (o *TelemetryRouterResponse) GetDisplayName() string { if o == nil { @@ -196,6 +231,38 @@ func (o *TelemetryRouterResponse) SetId(v string) { o.Id = v } +// GetResourceLabels returns the ResourceLabels field value if set, zero value otherwise. +func (o *TelemetryRouterResponse) GetResourceLabels() map[string]string { + if o == nil || IsNil(o.ResourceLabels) { + var ret map[string]string + return ret + } + return *o.ResourceLabels +} + +// GetResourceLabelsOk returns a tuple with the ResourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelemetryRouterResponse) GetResourceLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.ResourceLabels) { + return nil, false + } + return o.ResourceLabels, true +} + +// HasResourceLabels returns a boolean if a field has been set. +func (o *TelemetryRouterResponse) HasResourceLabels() bool { + if o != nil && !IsNil(o.ResourceLabels) { + return true + } + + return false +} + +// SetResourceLabels gets a reference to the given map[string]string and assigns it to the ResourceLabels field. +func (o *TelemetryRouterResponse) SetResourceLabels(v map[string]string) { + o.ResourceLabels = &v +} + // GetStatus returns the Status field value func (o *TelemetryRouterResponse) GetStatus() TelemetryRouterResponseStatus { if o == nil { @@ -258,11 +325,17 @@ func (o TelemetryRouterResponse) ToMap() (map[string]interface{}, error) { if !IsNil(o.Description) { toSerialize["description"] = o.Description } + if !IsNil(o.DestinationCount) { + toSerialize["destinationCount"] = o.DestinationCount + } toSerialize["displayName"] = o.DisplayName if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } toSerialize["id"] = o.Id + if !IsNil(o.ResourceLabels) { + toSerialize["resourceLabels"] = o.ResourceLabels + } toSerialize["status"] = o.Status toSerialize["uri"] = o.Uri @@ -314,9 +387,11 @@ func (o *TelemetryRouterResponse) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "creationTime") delete(additionalProperties, "description") + delete(additionalProperties, "destinationCount") delete(additionalProperties, "displayName") delete(additionalProperties, "filter") delete(additionalProperties, "id") + delete(additionalProperties, "resourceLabels") delete(additionalProperties, "status") delete(additionalProperties, "uri") o.AdditionalProperties = additionalProperties diff --git a/services/telemetryrouter/v1api/model_update_access_token_payload.go b/services/telemetryrouter/v1api/model_update_access_token_payload.go index a70326774d..46d290fda3 100644 --- a/services/telemetryrouter/v1api/model_update_access_token_payload.go +++ b/services/telemetryrouter/v1api/model_update_access_token_payload.go @@ -19,7 +19,7 @@ var _ MappedNullable = &UpdateAccessTokenPayload{} // UpdateAccessTokenPayload struct for UpdateAccessTokenPayload type UpdateAccessTokenPayload struct { - Description NullableString `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description NullableString `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` DisplayName NullableString `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` AdditionalProperties map[string]interface{} } diff --git a/services/telemetryrouter/v1api/model_update_access_token_response.go b/services/telemetryrouter/v1api/model_update_access_token_response.go index 3b3d0b8fe8..3e94832baa 100644 --- a/services/telemetryrouter/v1api/model_update_access_token_response.go +++ b/services/telemetryrouter/v1api/model_update_access_token_response.go @@ -24,7 +24,7 @@ type UpdateAccessTokenResponse struct { // The user ID of the creator of the access token. CreatorId string `json:"creatorId"` // The description of the access token. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The selected display name of the access token. DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 ]*$"` // The date and time until the access token is valid to (inclusively). diff --git a/services/telemetryrouter/v1api/model_update_destination_payload.go b/services/telemetryrouter/v1api/model_update_destination_payload.go index 2facc2a2ba..0c31dfdb6b 100644 --- a/services/telemetryrouter/v1api/model_update_destination_payload.go +++ b/services/telemetryrouter/v1api/model_update_destination_payload.go @@ -21,7 +21,7 @@ var _ MappedNullable = &UpdateDestinationPayload{} type UpdateDestinationPayload struct { Config *DestinationConfig `json:"config,omitempty"` // The description is a longer text chosen by the user to provide more context for the resource. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The display name is a short name chosen by the user to identify the resource. DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` AdditionalProperties map[string]interface{} diff --git a/services/telemetryrouter/v1api/model_update_telemetry_router_payload.go b/services/telemetryrouter/v1api/model_update_telemetry_router_payload.go index ad42f6b7a5..3e347f9b55 100644 --- a/services/telemetryrouter/v1api/model_update_telemetry_router_payload.go +++ b/services/telemetryrouter/v1api/model_update_telemetry_router_payload.go @@ -20,10 +20,11 @@ var _ MappedNullable = &UpdateTelemetryRouterPayload{} // UpdateTelemetryRouterPayload struct for UpdateTelemetryRouterPayload type UpdateTelemetryRouterPayload struct { // The description is a longer text chosen by the user to provide more context for the resource. - Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-]*)?$"` + Description *string `json:"description,omitempty" validate:"regexp=^([a-zA-Z0-9][a-zA-Z0-9 \\-.]*)?$"` // The display name is a short name chosen by the user to identify the resource. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` - Filter *ConfigFilter `json:"filter,omitempty"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z0-9][a-zA-Z0-9 \\-]*$"` + Filter *ConfigFilter `json:"filter,omitempty"` + ResourceLabels *map[string]string `json:"resourceLabels,omitempty"` AdditionalProperties map[string]interface{} } @@ -142,6 +143,38 @@ func (o *UpdateTelemetryRouterPayload) SetFilter(v ConfigFilter) { o.Filter = &v } +// GetResourceLabels returns the ResourceLabels field value if set, zero value otherwise. +func (o *UpdateTelemetryRouterPayload) GetResourceLabels() map[string]string { + if o == nil || IsNil(o.ResourceLabels) { + var ret map[string]string + return ret + } + return *o.ResourceLabels +} + +// GetResourceLabelsOk returns a tuple with the ResourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTelemetryRouterPayload) GetResourceLabelsOk() (*map[string]string, bool) { + if o == nil || IsNil(o.ResourceLabels) { + return nil, false + } + return o.ResourceLabels, true +} + +// HasResourceLabels returns a boolean if a field has been set. +func (o *UpdateTelemetryRouterPayload) HasResourceLabels() bool { + if o != nil && !IsNil(o.ResourceLabels) { + return true + } + + return false +} + +// SetResourceLabels gets a reference to the given map[string]string and assigns it to the ResourceLabels field. +func (o *UpdateTelemetryRouterPayload) SetResourceLabels(v map[string]string) { + o.ResourceLabels = &v +} + func (o UpdateTelemetryRouterPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -161,6 +194,9 @@ func (o UpdateTelemetryRouterPayload) ToMap() (map[string]interface{}, error) { if !IsNil(o.Filter) { toSerialize["filter"] = o.Filter } + if !IsNil(o.ResourceLabels) { + toSerialize["resourceLabels"] = o.ResourceLabels + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -186,6 +222,7 @@ func (o *UpdateTelemetryRouterPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "description") delete(additionalProperties, "displayName") delete(additionalProperties, "filter") + delete(additionalProperties, "resourceLabels") o.AdditionalProperties = additionalProperties }