diff --git a/services/logs/oas_commit b/services/logs/oas_commit index c08a6770d..8ae9a8db5 100644 --- a/services/logs/oas_commit +++ b/services/logs/oas_commit @@ -1 +1 @@ -4407196dbbef4e53e6798809e856725cbc84ae05 +e9fe931e91e0b8f067d5c12518398a52062ca794 diff --git a/services/logs/v1alphaapi/client.go b/services/logs/v1alphaapi/client.go index 55ecd19dd..32abc2f39 100644 --- a/services/logs/v1alphaapi/client.go +++ b/services/logs/v1alphaapi/client.go @@ -461,6 +461,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/logs/v1alphaapi/model_access_token.go b/services/logs/v1alphaapi/model_access_token.go index 3bcec3867..f1b45bd8d 100644 --- a/services/logs/v1alphaapi/model_access_token.go +++ b/services/logs/v1alphaapi/model_access_token.go @@ -28,7 +28,7 @@ type AccessToken struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // Indicates if the access token can expire. Expires bool `json:"expires"` // An auto generated unique id which identifies the access token. diff --git a/services/logs/v1alphaapi/model_create_access_token_payload.go b/services/logs/v1alphaapi/model_create_access_token_payload.go index 2875374ce..327e8c0c6 100644 --- a/services/logs/v1alphaapi/model_create_access_token_payload.go +++ b/services/logs/v1alphaapi/model_create_access_token_payload.go @@ -23,7 +23,7 @@ type CreateAccessTokenPayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // A lifetime period for an access token in days. If unset the token will not expire. Lifetime *int32 `json:"lifetime,omitempty"` // The access permissions granted to the access token. diff --git a/services/logs/v1alphaapi/model_create_logs_instance_payload.go b/services/logs/v1alphaapi/model_create_logs_instance_payload.go index 56127e1fa..435acb203 100644 --- a/services/logs/v1alphaapi/model_create_logs_instance_payload.go +++ b/services/logs/v1alphaapi/model_create_logs_instance_payload.go @@ -25,7 +25,7 @@ type CreateLogsInstancePayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name to distinguish multiple Logs instances. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // The log retention time in days. RetentionDays int32 `json:"retentionDays"` AdditionalProperties map[string]interface{} diff --git a/services/logs/v1alphaapi/model_logs_instance.go b/services/logs/v1alphaapi/model_logs_instance.go index b83e21d63..0e898f960 100644 --- a/services/logs/v1alphaapi/model_logs_instance.go +++ b/services/logs/v1alphaapi/model_logs_instance.go @@ -30,7 +30,7 @@ type LogsInstance struct { // The description of the Logs instance. Description *string `json:"description,omitempty"` // The displayed name of the Logs instance. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // A auto generated unique id which identifies the Logs instance. Id string `json:"id"` // The Logs instance's ingest logs via OTLP URL diff --git a/services/logs/v1alphaapi/model_update_access_token_payload.go b/services/logs/v1alphaapi/model_update_access_token_payload.go index a0416caa5..58cc19ae3 100644 --- a/services/logs/v1alphaapi/model_update_access_token_payload.go +++ b/services/logs/v1alphaapi/model_update_access_token_payload.go @@ -22,7 +22,7 @@ type UpdateAccessTokenPayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\w -]*$"` AdditionalProperties map[string]interface{} } diff --git a/services/logs/v1alphaapi/model_update_logs_instance_payload.go b/services/logs/v1alphaapi/model_update_logs_instance_payload.go index f4c4bfe89..e0cbc51b8 100644 --- a/services/logs/v1alphaapi/model_update_logs_instance_payload.go +++ b/services/logs/v1alphaapi/model_update_logs_instance_payload.go @@ -24,7 +24,7 @@ type UpdateLogsInstancePayload struct { // The description of the Logs instance. Description *string `json:"description,omitempty"` // The displayed name to distinguish multiple Logs instances. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\w -]*$"` // The log retention time in days. RetentionDays *int32 `json:"retentionDays,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/logs/v1api/client.go b/services/logs/v1api/client.go index 4c8754812..801071086 100644 --- a/services/logs/v1api/client.go +++ b/services/logs/v1api/client.go @@ -461,6 +461,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/logs/v1api/model_access_token.go b/services/logs/v1api/model_access_token.go index ed184e386..349c32dd8 100644 --- a/services/logs/v1api/model_access_token.go +++ b/services/logs/v1api/model_access_token.go @@ -28,7 +28,7 @@ type AccessToken struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // Indicates if the access token can expire. Expires bool `json:"expires"` // An auto generated unique id which identifies the access token. diff --git a/services/logs/v1api/model_create_access_token_payload.go b/services/logs/v1api/model_create_access_token_payload.go index 9630d8a46..010f20f36 100644 --- a/services/logs/v1api/model_create_access_token_payload.go +++ b/services/logs/v1api/model_create_access_token_payload.go @@ -23,7 +23,7 @@ type CreateAccessTokenPayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // A lifetime period for an access token in days. If unset the token will not expire. Lifetime *int32 `json:"lifetime,omitempty"` // The access permissions granted to the access token. diff --git a/services/logs/v1api/model_create_logs_instance_payload.go b/services/logs/v1api/model_create_logs_instance_payload.go index 206908ef3..067ad8742 100644 --- a/services/logs/v1api/model_create_logs_instance_payload.go +++ b/services/logs/v1api/model_create_logs_instance_payload.go @@ -25,7 +25,7 @@ type CreateLogsInstancePayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name to distinguish multiple Logs instances. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // The log retention time in days. RetentionDays int32 `json:"retentionDays"` AdditionalProperties map[string]interface{} diff --git a/services/logs/v1api/model_logs_instance.go b/services/logs/v1api/model_logs_instance.go index 360e4fbfa..079849e51 100644 --- a/services/logs/v1api/model_logs_instance.go +++ b/services/logs/v1api/model_logs_instance.go @@ -30,7 +30,7 @@ type LogsInstance struct { // The description of the Logs instance. Description *string `json:"description,omitempty"` // The displayed name of the Logs instance. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // A auto generated unique id which identifies the Logs instance. Id string `json:"id"` // The Logs instance's ingest logs via OTLP URL diff --git a/services/logs/v1api/model_update_access_token_payload.go b/services/logs/v1api/model_update_access_token_payload.go index ef966a135..fb224c2a4 100644 --- a/services/logs/v1api/model_update_access_token_payload.go +++ b/services/logs/v1api/model_update_access_token_payload.go @@ -22,7 +22,7 @@ type UpdateAccessTokenPayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\w -]*$"` AdditionalProperties map[string]interface{} } diff --git a/services/logs/v1api/model_update_logs_instance_payload.go b/services/logs/v1api/model_update_logs_instance_payload.go index d589408b9..93b73c298 100644 --- a/services/logs/v1api/model_update_logs_instance_payload.go +++ b/services/logs/v1api/model_update_logs_instance_payload.go @@ -24,7 +24,7 @@ type UpdateLogsInstancePayload struct { // The description of the Logs instance. Description *string `json:"description,omitempty"` // The displayed name to distinguish multiple Logs instances. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\w -]*$"` // The log retention time in days. RetentionDays *int32 `json:"retentionDays,omitempty"` AdditionalProperties map[string]interface{} diff --git a/services/logs/v1betaapi/client.go b/services/logs/v1betaapi/client.go index 386ce585b..cb9f0f1a8 100644 --- a/services/logs/v1betaapi/client.go +++ b/services/logs/v1betaapi/client.go @@ -461,6 +461,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if r, ok := v.(*io.Reader); ok { + *r = bytes.NewReader(b) + return nil + } + // Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte. + if p, ok := v.(*[]byte); ok { + *p = b + return nil + } if f, ok := v.(*os.File); ok { f, err = os.CreateTemp("", "HttpClientFile") if err != nil { diff --git a/services/logs/v1betaapi/model_access_token.go b/services/logs/v1betaapi/model_access_token.go index 540b9ecda..caafe3ad5 100644 --- a/services/logs/v1betaapi/model_access_token.go +++ b/services/logs/v1betaapi/model_access_token.go @@ -28,7 +28,7 @@ type AccessToken struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // Indicates if the access token can expire. Expires bool `json:"expires"` // An auto generated unique id which identifies the access token. diff --git a/services/logs/v1betaapi/model_create_access_token_payload.go b/services/logs/v1betaapi/model_create_access_token_payload.go index a2e69efa4..ebd7578fd 100644 --- a/services/logs/v1betaapi/model_create_access_token_payload.go +++ b/services/logs/v1betaapi/model_create_access_token_payload.go @@ -23,7 +23,7 @@ type CreateAccessTokenPayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // A lifetime period for an access token in days. If unset the token will not expire. Lifetime *int32 `json:"lifetime,omitempty"` // The access permissions granted to the access token. diff --git a/services/logs/v1betaapi/model_create_logs_instance_payload.go b/services/logs/v1betaapi/model_create_logs_instance_payload.go index 06c83e7fa..5546c6ff5 100644 --- a/services/logs/v1betaapi/model_create_logs_instance_payload.go +++ b/services/logs/v1betaapi/model_create_logs_instance_payload.go @@ -25,7 +25,7 @@ type CreateLogsInstancePayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name to distinguish multiple Logs instances. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // The log retention time in days. RetentionDays int32 `json:"retentionDays"` AdditionalProperties map[string]interface{} diff --git a/services/logs/v1betaapi/model_logs_instance.go b/services/logs/v1betaapi/model_logs_instance.go index 068c43965..22363b522 100644 --- a/services/logs/v1betaapi/model_logs_instance.go +++ b/services/logs/v1betaapi/model_logs_instance.go @@ -30,7 +30,7 @@ type LogsInstance struct { // The description of the Logs instance. Description *string `json:"description,omitempty"` // The displayed name of the Logs instance. - DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName string `json:"displayName" validate:"regexp=^[a-zA-Z][\\w -]*$"` // A auto generated unique id which identifies the Logs instance. Id string `json:"id"` // The Logs instance's ingest logs via OTLP URL diff --git a/services/logs/v1betaapi/model_update_access_token_payload.go b/services/logs/v1betaapi/model_update_access_token_payload.go index 84f7a19ac..546a68481 100644 --- a/services/logs/v1betaapi/model_update_access_token_payload.go +++ b/services/logs/v1betaapi/model_update_access_token_payload.go @@ -22,7 +22,7 @@ type UpdateAccessTokenPayload struct { // The description of the access token. Description *string `json:"description,omitempty"` // The displayed name of the access token. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\w -]*$"` AdditionalProperties map[string]interface{} } diff --git a/services/logs/v1betaapi/model_update_logs_instance_payload.go b/services/logs/v1betaapi/model_update_logs_instance_payload.go index 3b9aa529c..1837150e2 100644 --- a/services/logs/v1betaapi/model_update_logs_instance_payload.go +++ b/services/logs/v1betaapi/model_update_logs_instance_payload.go @@ -24,7 +24,7 @@ type UpdateLogsInstancePayload struct { // The description of the Logs instance. Description *string `json:"description,omitempty"` // The displayed name to distinguish multiple Logs instances. - DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\\\w -]*$"` + DisplayName *string `json:"displayName,omitempty" validate:"regexp=^[a-zA-Z][\\w -]*$"` // The log retention time in days. RetentionDays *int32 `json:"retentionDays,omitempty"` AdditionalProperties map[string]interface{}