diff --git a/service/iam/api_add_saml_provider_certificate.go b/service/iam/api_add_saml_provider_certificate.go new file mode 100644 index 00000000..b77c6ee6 --- /dev/null +++ b/service/iam/api_add_saml_provider_certificate.go @@ -0,0 +1,212 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opAddSAMLProviderCertificateCommon = "AddSAMLProviderCertificate" + +// AddSAMLProviderCertificateCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the AddSAMLProviderCertificateCommon operation. The "output" return +// value will be populated with the AddSAMLProviderCertificateCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned AddSAMLProviderCertificateCommon Request to send the API call to the service. +// the "output" return value is not valid until after AddSAMLProviderCertificateCommon Send returns without error. +// +// See AddSAMLProviderCertificateCommon for more information on using the AddSAMLProviderCertificateCommon +// API call, and error handling. +// +// // Example sending a request using the AddSAMLProviderCertificateCommonRequest method. +// req, resp := client.AddSAMLProviderCertificateCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) AddSAMLProviderCertificateCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opAddSAMLProviderCertificateCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + return +} + +// AddSAMLProviderCertificateCommon API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation AddSAMLProviderCertificateCommon for usage and error information. +func (c *IAM) AddSAMLProviderCertificateCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.AddSAMLProviderCertificateCommonRequest(input) + return out, req.Send() +} + +// AddSAMLProviderCertificateCommonWithContext is the same as AddSAMLProviderCertificateCommon with the addition of +// the ability to pass a context and additional request options. +// +// See AddSAMLProviderCertificateCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AddSAMLProviderCertificateCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.AddSAMLProviderCertificateCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAddSAMLProviderCertificate = "AddSAMLProviderCertificate" + +// AddSAMLProviderCertificateRequest generates a "volcengine/request.Request" representing the +// client's request for the AddSAMLProviderCertificate operation. The "output" return +// value will be populated with the AddSAMLProviderCertificateCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned AddSAMLProviderCertificateCommon Request to send the API call to the service. +// the "output" return value is not valid until after AddSAMLProviderCertificateCommon Send returns without error. +// +// See AddSAMLProviderCertificate for more information on using the AddSAMLProviderCertificate +// API call, and error handling. +// +// // Example sending a request using the AddSAMLProviderCertificateRequest method. +// req, resp := client.AddSAMLProviderCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) AddSAMLProviderCertificateRequest(input *AddSAMLProviderCertificateInput) (req *request.Request, output *AddSAMLProviderCertificateOutput) { + op := &request.Operation{ + Name: opAddSAMLProviderCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddSAMLProviderCertificateInput{} + } + + output = &AddSAMLProviderCertificateOutput{} + req = c.newRequest(op, input, output) + + return +} + +// AddSAMLProviderCertificate API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation AddSAMLProviderCertificate for usage and error information. +func (c *IAM) AddSAMLProviderCertificate(input *AddSAMLProviderCertificateInput) (*AddSAMLProviderCertificateOutput, error) { + req, out := c.AddSAMLProviderCertificateRequest(input) + return out, req.Send() +} + +// AddSAMLProviderCertificateWithContext is the same as AddSAMLProviderCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See AddSAMLProviderCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) AddSAMLProviderCertificateWithContext(ctx volcengine.Context, input *AddSAMLProviderCertificateInput, opts ...request.Option) (*AddSAMLProviderCertificateOutput, error) { + req, out := c.AddSAMLProviderCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type AddSAMLProviderCertificateInput struct { + _ struct{} `type:"structure"` + + // SAMLProviderName is a required field + SAMLProviderName *string `type:"string" required:"true"` + + // X509Certificate is a required field + X509Certificate *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AddSAMLProviderCertificateInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddSAMLProviderCertificateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddSAMLProviderCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddSAMLProviderCertificateInput"} + if s.SAMLProviderName == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLProviderName")) + } + if s.X509Certificate == nil { + invalidParams.Add(request.NewErrParamRequired("X509Certificate")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSAMLProviderName sets the SAMLProviderName field's value. +func (s *AddSAMLProviderCertificateInput) SetSAMLProviderName(v string) *AddSAMLProviderCertificateInput { + s.SAMLProviderName = &v + return s +} + +// SetX509Certificate sets the X509Certificate field's value. +func (s *AddSAMLProviderCertificateInput) SetX509Certificate(v string) *AddSAMLProviderCertificateInput { + s.X509Certificate = &v + return s +} + +type AddSAMLProviderCertificateOutput struct { + _ struct{} `type:"structure"` + + Metadata *response.ResponseMetadata + + CertificateId *string `type:"string"` +} + +// String returns the string representation +func (s AddSAMLProviderCertificateOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddSAMLProviderCertificateOutput) GoString() string { + return s.String() +} + +// SetCertificateId sets the CertificateId field's value. +func (s *AddSAMLProviderCertificateOutput) SetCertificateId(v string) *AddSAMLProviderCertificateOutput { + s.CertificateId = &v + return s +} diff --git a/service/iam/api_create_saml_provider.go b/service/iam/api_create_saml_provider.go new file mode 100644 index 00000000..0510fb07 --- /dev/null +++ b/service/iam/api_create_saml_provider.go @@ -0,0 +1,291 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opCreateSAMLProviderCommon = "CreateSAMLProvider" + +// CreateSAMLProviderCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the CreateSAMLProviderCommon operation. The "output" return +// value will be populated with the CreateSAMLProviderCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned CreateSAMLProviderCommon Request to send the API call to the service. +// the "output" return value is not valid until after CreateSAMLProviderCommon Send returns without error. +// +// See CreateSAMLProviderCommon for more information on using the CreateSAMLProviderCommon +// API call, and error handling. +// +// // Example sending a request using the CreateSAMLProviderCommonRequest method. +// req, resp := client.CreateSAMLProviderCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) CreateSAMLProviderCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opCreateSAMLProviderCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + return +} + +// CreateSAMLProviderCommon API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation CreateSAMLProviderCommon for usage and error information. +func (c *IAM) CreateSAMLProviderCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.CreateSAMLProviderCommonRequest(input) + return out, req.Send() +} + +// CreateSAMLProviderCommonWithContext is the same as CreateSAMLProviderCommon with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSAMLProviderCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateSAMLProviderCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.CreateSAMLProviderCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateSAMLProvider = "CreateSAMLProvider" + +// CreateSAMLProviderRequest generates a "volcengine/request.Request" representing the +// client's request for the CreateSAMLProvider operation. The "output" return +// value will be populated with the CreateSAMLProviderCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned CreateSAMLProviderCommon Request to send the API call to the service. +// the "output" return value is not valid until after CreateSAMLProviderCommon Send returns without error. +// +// See CreateSAMLProvider for more information on using the CreateSAMLProvider +// API call, and error handling. +// +// // Example sending a request using the CreateSAMLProviderRequest method. +// req, resp := client.CreateSAMLProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) CreateSAMLProviderRequest(input *CreateSAMLProviderInput) (req *request.Request, output *CreateSAMLProviderOutput) { + op := &request.Operation{ + Name: opCreateSAMLProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateSAMLProviderInput{} + } + + output = &CreateSAMLProviderOutput{} + req = c.newRequest(op, input, output) + + return +} + +// CreateSAMLProvider API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation CreateSAMLProvider for usage and error information. +func (c *IAM) CreateSAMLProvider(input *CreateSAMLProviderInput) (*CreateSAMLProviderOutput, error) { + req, out := c.CreateSAMLProviderRequest(input) + return out, req.Send() +} + +// CreateSAMLProviderWithContext is the same as CreateSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) CreateSAMLProviderWithContext(ctx volcengine.Context, input *CreateSAMLProviderInput, opts ...request.Option) (*CreateSAMLProviderOutput, error) { + req, out := c.CreateSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type CreateSAMLProviderInput struct { + _ struct{} `type:"structure"` + + Description *string `max:"256" type:"string"` + + // EncodedSAMLMetadataDocument is a required field + EncodedSAMLMetadataDocument *string `type:"string" required:"true"` + + // SAMLProviderName is a required field + SAMLProviderName *string `type:"string" required:"true"` + + // SSOType is a required field + SSOType *int32 `type:"int32" required:"true"` + + Status *int32 `type:"int32"` +} + +// String returns the string representation +func (s CreateSAMLProviderInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSAMLProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSAMLProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSAMLProviderInput"} + if s.Description != nil && len(*s.Description) > 256 { + invalidParams.Add(request.NewErrParamMaxLen("Description", 256, *s.Description)) + } + if s.EncodedSAMLMetadataDocument == nil { + invalidParams.Add(request.NewErrParamRequired("EncodedSAMLMetadataDocument")) + } + if s.SAMLProviderName == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLProviderName")) + } + if s.SSOType == nil { + invalidParams.Add(request.NewErrParamRequired("SSOType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *CreateSAMLProviderInput) SetDescription(v string) *CreateSAMLProviderInput { + s.Description = &v + return s +} + +// SetEncodedSAMLMetadataDocument sets the EncodedSAMLMetadataDocument field's value. +func (s *CreateSAMLProviderInput) SetEncodedSAMLMetadataDocument(v string) *CreateSAMLProviderInput { + s.EncodedSAMLMetadataDocument = &v + return s +} + +// SetSAMLProviderName sets the SAMLProviderName field's value. +func (s *CreateSAMLProviderInput) SetSAMLProviderName(v string) *CreateSAMLProviderInput { + s.SAMLProviderName = &v + return s +} + +// SetSSOType sets the SSOType field's value. +func (s *CreateSAMLProviderInput) SetSSOType(v int32) *CreateSAMLProviderInput { + s.SSOType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateSAMLProviderInput) SetStatus(v int32) *CreateSAMLProviderInput { + s.Status = &v + return s +} + +type CreateSAMLProviderOutput struct { + _ struct{} `type:"structure"` + + Metadata *response.ResponseMetadata + + CreateDate *string `type:"string"` + + Description *string `type:"string"` + + SAMLProviderName *string `type:"string"` + + SSOType *int32 `type:"int32"` + + Status *int32 `type:"int32"` + + Trn *string `type:"string"` + + UpdateDate *string `type:"string"` +} + +// String returns the string representation +func (s CreateSAMLProviderOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSAMLProviderOutput) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *CreateSAMLProviderOutput) SetCreateDate(v string) *CreateSAMLProviderOutput { + s.CreateDate = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateSAMLProviderOutput) SetDescription(v string) *CreateSAMLProviderOutput { + s.Description = &v + return s +} + +// SetSAMLProviderName sets the SAMLProviderName field's value. +func (s *CreateSAMLProviderOutput) SetSAMLProviderName(v string) *CreateSAMLProviderOutput { + s.SAMLProviderName = &v + return s +} + +// SetSSOType sets the SSOType field's value. +func (s *CreateSAMLProviderOutput) SetSSOType(v int32) *CreateSAMLProviderOutput { + s.SSOType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateSAMLProviderOutput) SetStatus(v int32) *CreateSAMLProviderOutput { + s.Status = &v + return s +} + +// SetTrn sets the Trn field's value. +func (s *CreateSAMLProviderOutput) SetTrn(v string) *CreateSAMLProviderOutput { + s.Trn = &v + return s +} + +// SetUpdateDate sets the UpdateDate field's value. +func (s *CreateSAMLProviderOutput) SetUpdateDate(v string) *CreateSAMLProviderOutput { + s.UpdateDate = &v + return s +} diff --git a/service/iam/api_update_o_auth_provider.go b/service/iam/api_update_o_auth_provider.go new file mode 100644 index 00000000..456f822c --- /dev/null +++ b/service/iam/api_update_o_auth_provider.go @@ -0,0 +1,336 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opUpdateOAuthProviderCommon = "UpdateOAuthProvider" + +// UpdateOAuthProviderCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the UpdateOAuthProviderCommon operation. The "output" return +// value will be populated with the UpdateOAuthProviderCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned UpdateOAuthProviderCommon Request to send the API call to the service. +// the "output" return value is not valid until after UpdateOAuthProviderCommon Send returns without error. +// +// See UpdateOAuthProviderCommon for more information on using the UpdateOAuthProviderCommon +// API call, and error handling. +// +// // Example sending a request using the UpdateOAuthProviderCommonRequest method. +// req, resp := client.UpdateOAuthProviderCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) UpdateOAuthProviderCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opUpdateOAuthProviderCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + return +} + +// UpdateOAuthProviderCommon API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation UpdateOAuthProviderCommon for usage and error information. +func (c *IAM) UpdateOAuthProviderCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.UpdateOAuthProviderCommonRequest(input) + return out, req.Send() +} + +// UpdateOAuthProviderCommonWithContext is the same as UpdateOAuthProviderCommon with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateOAuthProviderCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateOAuthProviderCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.UpdateOAuthProviderCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateOAuthProvider = "UpdateOAuthProvider" + +// UpdateOAuthProviderRequest generates a "volcengine/request.Request" representing the +// client's request for the UpdateOAuthProvider operation. The "output" return +// value will be populated with the UpdateOAuthProviderCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned UpdateOAuthProviderCommon Request to send the API call to the service. +// the "output" return value is not valid until after UpdateOAuthProviderCommon Send returns without error. +// +// See UpdateOAuthProvider for more information on using the UpdateOAuthProvider +// API call, and error handling. +// +// // Example sending a request using the UpdateOAuthProviderRequest method. +// req, resp := client.UpdateOAuthProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) UpdateOAuthProviderRequest(input *UpdateOAuthProviderInput) (req *request.Request, output *UpdateOAuthProviderOutput) { + op := &request.Operation{ + Name: opUpdateOAuthProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateOAuthProviderInput{} + } + + output = &UpdateOAuthProviderOutput{} + req = c.newRequest(op, input, output) + + return +} + +// UpdateOAuthProvider API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation UpdateOAuthProvider for usage and error information. +func (c *IAM) UpdateOAuthProvider(input *UpdateOAuthProviderInput) (*UpdateOAuthProviderOutput, error) { + req, out := c.UpdateOAuthProviderRequest(input) + return out, req.Send() +} + +// UpdateOAuthProviderWithContext is the same as UpdateOAuthProvider with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateOAuthProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateOAuthProviderWithContext(ctx volcengine.Context, input *UpdateOAuthProviderInput, opts ...request.Option) (*UpdateOAuthProviderOutput, error) { + req, out := c.UpdateOAuthProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type UpdateOAuthProviderInput struct { + _ struct{} `type:"structure"` + + AuthorizeTemplate *string `type:"string"` + + AuthorizeURL *string `type:"string"` + + ClientId *string `type:"string"` + + ClientSecret *string `type:"string"` + + Description *string `type:"string"` + + IdentityMapType *int32 `type:"int32"` + + IdpIdentityKey *string `type:"string"` + + // OAuthProviderName is a required field + OAuthProviderName *string `type:"string" required:"true"` + + Scope *string `type:"string"` + + Status *int32 `type:"int32"` + + TokenURL *string `type:"string"` + + UserInfoURL *string `type:"string"` +} + +// String returns the string representation +func (s UpdateOAuthProviderInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateOAuthProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateOAuthProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateOAuthProviderInput"} + if s.OAuthProviderName == nil { + invalidParams.Add(request.NewErrParamRequired("OAuthProviderName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorizeTemplate sets the AuthorizeTemplate field's value. +func (s *UpdateOAuthProviderInput) SetAuthorizeTemplate(v string) *UpdateOAuthProviderInput { + s.AuthorizeTemplate = &v + return s +} + +// SetAuthorizeURL sets the AuthorizeURL field's value. +func (s *UpdateOAuthProviderInput) SetAuthorizeURL(v string) *UpdateOAuthProviderInput { + s.AuthorizeURL = &v + return s +} + +// SetClientId sets the ClientId field's value. +func (s *UpdateOAuthProviderInput) SetClientId(v string) *UpdateOAuthProviderInput { + s.ClientId = &v + return s +} + +// SetClientSecret sets the ClientSecret field's value. +func (s *UpdateOAuthProviderInput) SetClientSecret(v string) *UpdateOAuthProviderInput { + s.ClientSecret = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateOAuthProviderInput) SetDescription(v string) *UpdateOAuthProviderInput { + s.Description = &v + return s +} + +// SetIdentityMapType sets the IdentityMapType field's value. +func (s *UpdateOAuthProviderInput) SetIdentityMapType(v int32) *UpdateOAuthProviderInput { + s.IdentityMapType = &v + return s +} + +// SetIdpIdentityKey sets the IdpIdentityKey field's value. +func (s *UpdateOAuthProviderInput) SetIdpIdentityKey(v string) *UpdateOAuthProviderInput { + s.IdpIdentityKey = &v + return s +} + +// SetOAuthProviderName sets the OAuthProviderName field's value. +func (s *UpdateOAuthProviderInput) SetOAuthProviderName(v string) *UpdateOAuthProviderInput { + s.OAuthProviderName = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *UpdateOAuthProviderInput) SetScope(v string) *UpdateOAuthProviderInput { + s.Scope = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateOAuthProviderInput) SetStatus(v int32) *UpdateOAuthProviderInput { + s.Status = &v + return s +} + +// SetTokenURL sets the TokenURL field's value. +func (s *UpdateOAuthProviderInput) SetTokenURL(v string) *UpdateOAuthProviderInput { + s.TokenURL = &v + return s +} + +// SetUserInfoURL sets the UserInfoURL field's value. +func (s *UpdateOAuthProviderInput) SetUserInfoURL(v string) *UpdateOAuthProviderInput { + s.UserInfoURL = &v + return s +} + +type UpdateOAuthProviderOutput struct { + _ struct{} `type:"structure"` + + Metadata *response.ResponseMetadata + + CreateDate *string `type:"string"` + + Description *string `type:"string"` + + OAuthProviderName *string `type:"string"` + + SSOType *int32 `type:"int32"` + + Status *int32 `type:"int32"` + + Trn *string `type:"string"` + + UpdateDate *string `type:"string"` +} + +// String returns the string representation +func (s UpdateOAuthProviderOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateOAuthProviderOutput) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *UpdateOAuthProviderOutput) SetCreateDate(v string) *UpdateOAuthProviderOutput { + s.CreateDate = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateOAuthProviderOutput) SetDescription(v string) *UpdateOAuthProviderOutput { + s.Description = &v + return s +} + +// SetOAuthProviderName sets the OAuthProviderName field's value. +func (s *UpdateOAuthProviderOutput) SetOAuthProviderName(v string) *UpdateOAuthProviderOutput { + s.OAuthProviderName = &v + return s +} + +// SetSSOType sets the SSOType field's value. +func (s *UpdateOAuthProviderOutput) SetSSOType(v int32) *UpdateOAuthProviderOutput { + s.SSOType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateOAuthProviderOutput) SetStatus(v int32) *UpdateOAuthProviderOutput { + s.Status = &v + return s +} + +// SetTrn sets the Trn field's value. +func (s *UpdateOAuthProviderOutput) SetTrn(v string) *UpdateOAuthProviderOutput { + s.Trn = &v + return s +} + +// SetUpdateDate sets the UpdateDate field's value. +func (s *UpdateOAuthProviderOutput) SetUpdateDate(v string) *UpdateOAuthProviderOutput { + s.UpdateDate = &v + return s +} diff --git a/service/iam/api_update_saml_provider.go b/service/iam/api_update_saml_provider.go new file mode 100644 index 00000000..28d7fbb5 --- /dev/null +++ b/service/iam/api_update_saml_provider.go @@ -0,0 +1,272 @@ +// Code generated by volcengine with private/model/cli/gen-api/main.go. DO NOT EDIT. + +package iam + +import ( + "github.com/volcengine/volcengine-go-sdk/volcengine" + "github.com/volcengine/volcengine-go-sdk/volcengine/request" + "github.com/volcengine/volcengine-go-sdk/volcengine/response" + "github.com/volcengine/volcengine-go-sdk/volcengine/volcengineutil" +) + +const opUpdateSAMLProviderCommon = "UpdateSAMLProvider" + +// UpdateSAMLProviderCommonRequest generates a "volcengine/request.Request" representing the +// client's request for the UpdateSAMLProviderCommon operation. The "output" return +// value will be populated with the UpdateSAMLProviderCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned UpdateSAMLProviderCommon Request to send the API call to the service. +// the "output" return value is not valid until after UpdateSAMLProviderCommon Send returns without error. +// +// See UpdateSAMLProviderCommon for more information on using the UpdateSAMLProviderCommon +// API call, and error handling. +// +// // Example sending a request using the UpdateSAMLProviderCommonRequest method. +// req, resp := client.UpdateSAMLProviderCommonRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) UpdateSAMLProviderCommonRequest(input *map[string]interface{}) (req *request.Request, output *map[string]interface{}) { + op := &request.Operation{ + Name: opUpdateSAMLProviderCommon, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &map[string]interface{}{} + } + + output = &map[string]interface{}{} + req = c.newRequest(op, input, output) + + return +} + +// UpdateSAMLProviderCommon API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation UpdateSAMLProviderCommon for usage and error information. +func (c *IAM) UpdateSAMLProviderCommon(input *map[string]interface{}) (*map[string]interface{}, error) { + req, out := c.UpdateSAMLProviderCommonRequest(input) + return out, req.Send() +} + +// UpdateSAMLProviderCommonWithContext is the same as UpdateSAMLProviderCommon with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSAMLProviderCommon for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateSAMLProviderCommonWithContext(ctx volcengine.Context, input *map[string]interface{}, opts ...request.Option) (*map[string]interface{}, error) { + req, out := c.UpdateSAMLProviderCommonRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSAMLProvider = "UpdateSAMLProvider" + +// UpdateSAMLProviderRequest generates a "volcengine/request.Request" representing the +// client's request for the UpdateSAMLProvider operation. The "output" return +// value will be populated with the UpdateSAMLProviderCommon request's response once the request completes +// successfully. +// +// Use "Send" method on the returned UpdateSAMLProviderCommon Request to send the API call to the service. +// the "output" return value is not valid until after UpdateSAMLProviderCommon Send returns without error. +// +// See UpdateSAMLProvider for more information on using the UpdateSAMLProvider +// API call, and error handling. +// +// // Example sending a request using the UpdateSAMLProviderRequest method. +// req, resp := client.UpdateSAMLProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IAM) UpdateSAMLProviderRequest(input *UpdateSAMLProviderInput) (req *request.Request, output *UpdateSAMLProviderOutput) { + op := &request.Operation{ + Name: opUpdateSAMLProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateSAMLProviderInput{} + } + + output = &UpdateSAMLProviderOutput{} + req = c.newRequest(op, input, output) + + return +} + +// UpdateSAMLProvider API operation for IAM. +// +// Returns volcengineerr.Error for service API and SDK errors. Use runtime type assertions +// with volcengineerr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the VOLCENGINE API reference guide for IAM's +// API operation UpdateSAMLProvider for usage and error information. +func (c *IAM) UpdateSAMLProvider(input *UpdateSAMLProviderInput) (*UpdateSAMLProviderOutput, error) { + req, out := c.UpdateSAMLProviderRequest(input) + return out, req.Send() +} + +// UpdateSAMLProviderWithContext is the same as UpdateSAMLProvider with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSAMLProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. Ifthe context is nil a panic will occur. +// In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IAM) UpdateSAMLProviderWithContext(ctx volcengine.Context, input *UpdateSAMLProviderInput, opts ...request.Option) (*UpdateSAMLProviderOutput, error) { + req, out := c.UpdateSAMLProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type UpdateSAMLProviderInput struct { + _ struct{} `type:"structure"` + + Description *string `type:"string"` + + NewEncodedSAMLMetadataDocument *string `type:"string"` + + // SAMLProviderName is a required field + SAMLProviderName *string `type:"string" required:"true"` + + Status *int32 `type:"int32"` +} + +// String returns the string representation +func (s UpdateSAMLProviderInput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSAMLProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSAMLProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSAMLProviderInput"} + if s.SAMLProviderName == nil { + invalidParams.Add(request.NewErrParamRequired("SAMLProviderName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *UpdateSAMLProviderInput) SetDescription(v string) *UpdateSAMLProviderInput { + s.Description = &v + return s +} + +// SetNewEncodedSAMLMetadataDocument sets the NewEncodedSAMLMetadataDocument field's value. +func (s *UpdateSAMLProviderInput) SetNewEncodedSAMLMetadataDocument(v string) *UpdateSAMLProviderInput { + s.NewEncodedSAMLMetadataDocument = &v + return s +} + +// SetSAMLProviderName sets the SAMLProviderName field's value. +func (s *UpdateSAMLProviderInput) SetSAMLProviderName(v string) *UpdateSAMLProviderInput { + s.SAMLProviderName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateSAMLProviderInput) SetStatus(v int32) *UpdateSAMLProviderInput { + s.Status = &v + return s +} + +type UpdateSAMLProviderOutput struct { + _ struct{} `type:"structure"` + + Metadata *response.ResponseMetadata + + CreateDate *string `type:"string"` + + Description *string `type:"string"` + + SAMLProviderName *string `type:"string"` + + SSOType *int32 `type:"int32"` + + Status *int32 `type:"int32"` + + Trn *string `type:"string"` + + UpdateDate *string `type:"string"` +} + +// String returns the string representation +func (s UpdateSAMLProviderOutput) String() string { + return volcengineutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSAMLProviderOutput) GoString() string { + return s.String() +} + +// SetCreateDate sets the CreateDate field's value. +func (s *UpdateSAMLProviderOutput) SetCreateDate(v string) *UpdateSAMLProviderOutput { + s.CreateDate = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateSAMLProviderOutput) SetDescription(v string) *UpdateSAMLProviderOutput { + s.Description = &v + return s +} + +// SetSAMLProviderName sets the SAMLProviderName field's value. +func (s *UpdateSAMLProviderOutput) SetSAMLProviderName(v string) *UpdateSAMLProviderOutput { + s.SAMLProviderName = &v + return s +} + +// SetSSOType sets the SSOType field's value. +func (s *UpdateSAMLProviderOutput) SetSSOType(v int32) *UpdateSAMLProviderOutput { + s.SSOType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateSAMLProviderOutput) SetStatus(v int32) *UpdateSAMLProviderOutput { + s.Status = &v + return s +} + +// SetTrn sets the Trn field's value. +func (s *UpdateSAMLProviderOutput) SetTrn(v string) *UpdateSAMLProviderOutput { + s.Trn = &v + return s +} + +// SetUpdateDate sets the UpdateDate field's value. +func (s *UpdateSAMLProviderOutput) SetUpdateDate(v string) *UpdateSAMLProviderOutput { + s.UpdateDate = &v + return s +} diff --git a/service/iam/interface_iam.go b/service/iam/interface_iam.go index bea6707a..86fbc121 100644 --- a/service/iam/interface_iam.go +++ b/service/iam/interface_iam.go @@ -573,6 +573,38 @@ type IAMAPI interface { UpdateUser(*UpdateUserInput) (*UpdateUserOutput, error) UpdateUserWithContext(volcengine.Context, *UpdateUserInput, ...request.Option) (*UpdateUserOutput, error) UpdateUserRequest(*UpdateUserInput) (*request.Request, *UpdateUserOutput) + + AddSAMLProviderCertificateCommon(*map[string]interface{}) (*map[string]interface{}, error) + AddSAMLProviderCertificateCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + AddSAMLProviderCertificateCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + AddSAMLProviderCertificate(*AddSAMLProviderCertificateInput) (*AddSAMLProviderCertificateOutput, error) + AddSAMLProviderCertificateWithContext(volcengine.Context, *AddSAMLProviderCertificateInput, ...request.Option) (*AddSAMLProviderCertificateOutput, error) + AddSAMLProviderCertificateRequest(*AddSAMLProviderCertificateInput) (*request.Request, *AddSAMLProviderCertificateOutput) + + CreateSAMLProviderCommon(*map[string]interface{}) (*map[string]interface{}, error) + CreateSAMLProviderCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + CreateSAMLProviderCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + CreateSAMLProvider(*CreateSAMLProviderInput) (*CreateSAMLProviderOutput, error) + CreateSAMLProviderWithContext(volcengine.Context, *CreateSAMLProviderInput, ...request.Option) (*CreateSAMLProviderOutput, error) + CreateSAMLProviderRequest(*CreateSAMLProviderInput) (*request.Request, *CreateSAMLProviderOutput) + + UpdateOAuthProviderCommon(*map[string]interface{}) (*map[string]interface{}, error) + UpdateOAuthProviderCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + UpdateOAuthProviderCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + UpdateOAuthProvider(*UpdateOAuthProviderInput) (*UpdateOAuthProviderOutput, error) + UpdateOAuthProviderWithContext(volcengine.Context, *UpdateOAuthProviderInput, ...request.Option) (*UpdateOAuthProviderOutput, error) + UpdateOAuthProviderRequest(*UpdateOAuthProviderInput) (*request.Request, *UpdateOAuthProviderOutput) + + UpdateSAMLProviderCommon(*map[string]interface{}) (*map[string]interface{}, error) + UpdateSAMLProviderCommonWithContext(volcengine.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) + UpdateSAMLProviderCommonRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) + + UpdateSAMLProvider(*UpdateSAMLProviderInput) (*UpdateSAMLProviderOutput, error) + UpdateSAMLProviderWithContext(volcengine.Context, *UpdateSAMLProviderInput, ...request.Option) (*UpdateSAMLProviderOutput, error) + UpdateSAMLProviderRequest(*UpdateSAMLProviderInput) (*request.Request, *UpdateSAMLProviderOutput) } var _ IAMAPI = (*IAM)(nil)