github.com/aavshr/aws-sdk-go@v1.41.3/service/ssooidc/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package ssooidc 4 5 import ( 6 "fmt" 7 8 "github.com/aavshr/aws-sdk-go/aws" 9 "github.com/aavshr/aws-sdk-go/aws/awsutil" 10 "github.com/aavshr/aws-sdk-go/aws/credentials" 11 "github.com/aavshr/aws-sdk-go/aws/request" 12 "github.com/aavshr/aws-sdk-go/private/protocol" 13 ) 14 15 const opCreateToken = "CreateToken" 16 17 // CreateTokenRequest generates a "aws/request.Request" representing the 18 // client's request for the CreateToken operation. The "output" return 19 // value will be populated with the request's response once the request completes 20 // successfully. 21 // 22 // Use "Send" method on the returned Request to send the API call to the service. 23 // the "output" return value is not valid until after Send returns without error. 24 // 25 // See CreateToken for more information on using the CreateToken 26 // API call, and error handling. 27 // 28 // This method is useful when you want to inject custom logic or configuration 29 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 30 // 31 // 32 // // Example sending a request using the CreateTokenRequest method. 33 // req, resp := client.CreateTokenRequest(params) 34 // 35 // err := req.Send() 36 // if err == nil { // resp is now filled 37 // fmt.Println(resp) 38 // } 39 // 40 // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/CreateToken 41 func (c *SSOOIDC) CreateTokenRequest(input *CreateTokenInput) (req *request.Request, output *CreateTokenOutput) { 42 op := &request.Operation{ 43 Name: opCreateToken, 44 HTTPMethod: "POST", 45 HTTPPath: "/token", 46 } 47 48 if input == nil { 49 input = &CreateTokenInput{} 50 } 51 52 output = &CreateTokenOutput{} 53 req = c.newRequest(op, input, output) 54 req.Config.Credentials = credentials.AnonymousCredentials 55 return 56 } 57 58 // CreateToken API operation for AWS SSO OIDC. 59 // 60 // Creates and returns an access token for the authorized client. The access 61 // token issued will be used to fetch short-term credentials for the assigned 62 // roles in the AWS account. 63 // 64 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 65 // with awserr.Error's Code and Message methods to get detailed information about 66 // the error. 67 // 68 // See the AWS API reference guide for AWS SSO OIDC's 69 // API operation CreateToken for usage and error information. 70 // 71 // Returned Error Types: 72 // * InvalidRequestException 73 // Indicates that something is wrong with the input to the request. For example, 74 // a required parameter might be missing or out of range. 75 // 76 // * InvalidClientException 77 // Indicates that the clientId or clientSecret in the request is invalid. For 78 // example, this can occur when a client sends an incorrect clientId or an expired 79 // clientSecret. 80 // 81 // * InvalidGrantException 82 // Indicates that a request contains an invalid grant. This can occur if a client 83 // makes a CreateToken request with an invalid grant type. 84 // 85 // * UnauthorizedClientException 86 // Indicates that the client is not currently authorized to make the request. 87 // This can happen when a clientId is not issued for a public client. 88 // 89 // * UnsupportedGrantTypeException 90 // Indicates that the grant type in the request is not supported by the service. 91 // 92 // * InvalidScopeException 93 // Indicates that the scope provided in the request is invalid. 94 // 95 // * AuthorizationPendingException 96 // Indicates that a request to authorize a client with an access user session 97 // token is pending. 98 // 99 // * SlowDownException 100 // Indicates that the client is making the request too frequently and is more 101 // than the service can handle. 102 // 103 // * AccessDeniedException 104 // You do not have sufficient access to perform this action. 105 // 106 // * ExpiredTokenException 107 // Indicates that the token issued by the service is expired and is no longer 108 // valid. 109 // 110 // * InternalServerException 111 // Indicates that an error from the service occurred while trying to process 112 // a request. 113 // 114 // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/CreateToken 115 func (c *SSOOIDC) CreateToken(input *CreateTokenInput) (*CreateTokenOutput, error) { 116 req, out := c.CreateTokenRequest(input) 117 return out, req.Send() 118 } 119 120 // CreateTokenWithContext is the same as CreateToken with the addition of 121 // the ability to pass a context and additional request options. 122 // 123 // See CreateToken for details on how to use this API operation. 124 // 125 // The context must be non-nil and will be used for request cancellation. If 126 // the context is nil a panic will occur. In the future the SDK may create 127 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 128 // for more information on using Contexts. 129 func (c *SSOOIDC) CreateTokenWithContext(ctx aws.Context, input *CreateTokenInput, opts ...request.Option) (*CreateTokenOutput, error) { 130 req, out := c.CreateTokenRequest(input) 131 req.SetContext(ctx) 132 req.ApplyOptions(opts...) 133 return out, req.Send() 134 } 135 136 const opRegisterClient = "RegisterClient" 137 138 // RegisterClientRequest generates a "aws/request.Request" representing the 139 // client's request for the RegisterClient operation. The "output" return 140 // value will be populated with the request's response once the request completes 141 // successfully. 142 // 143 // Use "Send" method on the returned Request to send the API call to the service. 144 // the "output" return value is not valid until after Send returns without error. 145 // 146 // See RegisterClient for more information on using the RegisterClient 147 // API call, and error handling. 148 // 149 // This method is useful when you want to inject custom logic or configuration 150 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 151 // 152 // 153 // // Example sending a request using the RegisterClientRequest method. 154 // req, resp := client.RegisterClientRequest(params) 155 // 156 // err := req.Send() 157 // if err == nil { // resp is now filled 158 // fmt.Println(resp) 159 // } 160 // 161 // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/RegisterClient 162 func (c *SSOOIDC) RegisterClientRequest(input *RegisterClientInput) (req *request.Request, output *RegisterClientOutput) { 163 op := &request.Operation{ 164 Name: opRegisterClient, 165 HTTPMethod: "POST", 166 HTTPPath: "/client/register", 167 } 168 169 if input == nil { 170 input = &RegisterClientInput{} 171 } 172 173 output = &RegisterClientOutput{} 174 req = c.newRequest(op, input, output) 175 req.Config.Credentials = credentials.AnonymousCredentials 176 return 177 } 178 179 // RegisterClient API operation for AWS SSO OIDC. 180 // 181 // Registers a client with AWS SSO. This allows clients to initiate device authorization. 182 // The output should be persisted for reuse through many authentication requests. 183 // 184 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 185 // with awserr.Error's Code and Message methods to get detailed information about 186 // the error. 187 // 188 // See the AWS API reference guide for AWS SSO OIDC's 189 // API operation RegisterClient for usage and error information. 190 // 191 // Returned Error Types: 192 // * InvalidRequestException 193 // Indicates that something is wrong with the input to the request. For example, 194 // a required parameter might be missing or out of range. 195 // 196 // * InvalidScopeException 197 // Indicates that the scope provided in the request is invalid. 198 // 199 // * InvalidClientMetadataException 200 // Indicates that the client information sent in the request during registration 201 // is invalid. 202 // 203 // * InternalServerException 204 // Indicates that an error from the service occurred while trying to process 205 // a request. 206 // 207 // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/RegisterClient 208 func (c *SSOOIDC) RegisterClient(input *RegisterClientInput) (*RegisterClientOutput, error) { 209 req, out := c.RegisterClientRequest(input) 210 return out, req.Send() 211 } 212 213 // RegisterClientWithContext is the same as RegisterClient with the addition of 214 // the ability to pass a context and additional request options. 215 // 216 // See RegisterClient for details on how to use this API operation. 217 // 218 // The context must be non-nil and will be used for request cancellation. If 219 // the context is nil a panic will occur. In the future the SDK may create 220 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 221 // for more information on using Contexts. 222 func (c *SSOOIDC) RegisterClientWithContext(ctx aws.Context, input *RegisterClientInput, opts ...request.Option) (*RegisterClientOutput, error) { 223 req, out := c.RegisterClientRequest(input) 224 req.SetContext(ctx) 225 req.ApplyOptions(opts...) 226 return out, req.Send() 227 } 228 229 const opStartDeviceAuthorization = "StartDeviceAuthorization" 230 231 // StartDeviceAuthorizationRequest generates a "aws/request.Request" representing the 232 // client's request for the StartDeviceAuthorization operation. The "output" return 233 // value will be populated with the request's response once the request completes 234 // successfully. 235 // 236 // Use "Send" method on the returned Request to send the API call to the service. 237 // the "output" return value is not valid until after Send returns without error. 238 // 239 // See StartDeviceAuthorization for more information on using the StartDeviceAuthorization 240 // API call, and error handling. 241 // 242 // This method is useful when you want to inject custom logic or configuration 243 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 244 // 245 // 246 // // Example sending a request using the StartDeviceAuthorizationRequest method. 247 // req, resp := client.StartDeviceAuthorizationRequest(params) 248 // 249 // err := req.Send() 250 // if err == nil { // resp is now filled 251 // fmt.Println(resp) 252 // } 253 // 254 // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/StartDeviceAuthorization 255 func (c *SSOOIDC) StartDeviceAuthorizationRequest(input *StartDeviceAuthorizationInput) (req *request.Request, output *StartDeviceAuthorizationOutput) { 256 op := &request.Operation{ 257 Name: opStartDeviceAuthorization, 258 HTTPMethod: "POST", 259 HTTPPath: "/device_authorization", 260 } 261 262 if input == nil { 263 input = &StartDeviceAuthorizationInput{} 264 } 265 266 output = &StartDeviceAuthorizationOutput{} 267 req = c.newRequest(op, input, output) 268 req.Config.Credentials = credentials.AnonymousCredentials 269 return 270 } 271 272 // StartDeviceAuthorization API operation for AWS SSO OIDC. 273 // 274 // Initiates device authorization by requesting a pair of verification codes 275 // from the authorization service. 276 // 277 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 278 // with awserr.Error's Code and Message methods to get detailed information about 279 // the error. 280 // 281 // See the AWS API reference guide for AWS SSO OIDC's 282 // API operation StartDeviceAuthorization for usage and error information. 283 // 284 // Returned Error Types: 285 // * InvalidRequestException 286 // Indicates that something is wrong with the input to the request. For example, 287 // a required parameter might be missing or out of range. 288 // 289 // * InvalidClientException 290 // Indicates that the clientId or clientSecret in the request is invalid. For 291 // example, this can occur when a client sends an incorrect clientId or an expired 292 // clientSecret. 293 // 294 // * UnauthorizedClientException 295 // Indicates that the client is not currently authorized to make the request. 296 // This can happen when a clientId is not issued for a public client. 297 // 298 // * SlowDownException 299 // Indicates that the client is making the request too frequently and is more 300 // than the service can handle. 301 // 302 // * InternalServerException 303 // Indicates that an error from the service occurred while trying to process 304 // a request. 305 // 306 // See also, https://docs.aws.amazon.com/goto/WebAPI/sso-oidc-2019-06-10/StartDeviceAuthorization 307 func (c *SSOOIDC) StartDeviceAuthorization(input *StartDeviceAuthorizationInput) (*StartDeviceAuthorizationOutput, error) { 308 req, out := c.StartDeviceAuthorizationRequest(input) 309 return out, req.Send() 310 } 311 312 // StartDeviceAuthorizationWithContext is the same as StartDeviceAuthorization with the addition of 313 // the ability to pass a context and additional request options. 314 // 315 // See StartDeviceAuthorization for details on how to use this API operation. 316 // 317 // The context must be non-nil and will be used for request cancellation. If 318 // the context is nil a panic will occur. In the future the SDK may create 319 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 320 // for more information on using Contexts. 321 func (c *SSOOIDC) StartDeviceAuthorizationWithContext(ctx aws.Context, input *StartDeviceAuthorizationInput, opts ...request.Option) (*StartDeviceAuthorizationOutput, error) { 322 req, out := c.StartDeviceAuthorizationRequest(input) 323 req.SetContext(ctx) 324 req.ApplyOptions(opts...) 325 return out, req.Send() 326 } 327 328 // You do not have sufficient access to perform this action. 329 type AccessDeniedException struct { 330 _ struct{} `type:"structure"` 331 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 332 333 Error_ *string `locationName:"error" type:"string"` 334 335 Error_description *string `locationName:"error_description" type:"string"` 336 337 Message_ *string `locationName:"message" type:"string"` 338 } 339 340 // String returns the string representation. 341 // 342 // API parameter values that are decorated as "sensitive" in the API will not 343 // be included in the string output. The member name will be present, but the 344 // value will be replaced with "sensitive". 345 func (s AccessDeniedException) String() string { 346 return awsutil.Prettify(s) 347 } 348 349 // GoString returns the string representation. 350 // 351 // API parameter values that are decorated as "sensitive" in the API will not 352 // be included in the string output. The member name will be present, but the 353 // value will be replaced with "sensitive". 354 func (s AccessDeniedException) GoString() string { 355 return s.String() 356 } 357 358 func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { 359 return &AccessDeniedException{ 360 RespMetadata: v, 361 } 362 } 363 364 // Code returns the exception type name. 365 func (s *AccessDeniedException) Code() string { 366 return "AccessDeniedException" 367 } 368 369 // Message returns the exception's message. 370 func (s *AccessDeniedException) Message() string { 371 if s.Message_ != nil { 372 return *s.Message_ 373 } 374 return "" 375 } 376 377 // OrigErr always returns nil, satisfies awserr.Error interface. 378 func (s *AccessDeniedException) OrigErr() error { 379 return nil 380 } 381 382 func (s *AccessDeniedException) Error() string { 383 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 384 } 385 386 // Status code returns the HTTP status code for the request's response error. 387 func (s *AccessDeniedException) StatusCode() int { 388 return s.RespMetadata.StatusCode 389 } 390 391 // RequestID returns the service's response RequestID for request. 392 func (s *AccessDeniedException) RequestID() string { 393 return s.RespMetadata.RequestID 394 } 395 396 // Indicates that a request to authorize a client with an access user session 397 // token is pending. 398 type AuthorizationPendingException struct { 399 _ struct{} `type:"structure"` 400 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 401 402 Error_ *string `locationName:"error" type:"string"` 403 404 Error_description *string `locationName:"error_description" type:"string"` 405 406 Message_ *string `locationName:"message" type:"string"` 407 } 408 409 // String returns the string representation. 410 // 411 // API parameter values that are decorated as "sensitive" in the API will not 412 // be included in the string output. The member name will be present, but the 413 // value will be replaced with "sensitive". 414 func (s AuthorizationPendingException) String() string { 415 return awsutil.Prettify(s) 416 } 417 418 // GoString returns the string representation. 419 // 420 // API parameter values that are decorated as "sensitive" in the API will not 421 // be included in the string output. The member name will be present, but the 422 // value will be replaced with "sensitive". 423 func (s AuthorizationPendingException) GoString() string { 424 return s.String() 425 } 426 427 func newErrorAuthorizationPendingException(v protocol.ResponseMetadata) error { 428 return &AuthorizationPendingException{ 429 RespMetadata: v, 430 } 431 } 432 433 // Code returns the exception type name. 434 func (s *AuthorizationPendingException) Code() string { 435 return "AuthorizationPendingException" 436 } 437 438 // Message returns the exception's message. 439 func (s *AuthorizationPendingException) Message() string { 440 if s.Message_ != nil { 441 return *s.Message_ 442 } 443 return "" 444 } 445 446 // OrigErr always returns nil, satisfies awserr.Error interface. 447 func (s *AuthorizationPendingException) OrigErr() error { 448 return nil 449 } 450 451 func (s *AuthorizationPendingException) Error() string { 452 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 453 } 454 455 // Status code returns the HTTP status code for the request's response error. 456 func (s *AuthorizationPendingException) StatusCode() int { 457 return s.RespMetadata.StatusCode 458 } 459 460 // RequestID returns the service's response RequestID for request. 461 func (s *AuthorizationPendingException) RequestID() string { 462 return s.RespMetadata.RequestID 463 } 464 465 type CreateTokenInput struct { 466 _ struct{} `type:"structure"` 467 468 // The unique identifier string for each client. This value should come from 469 // the persisted result of the RegisterClient API. 470 // 471 // ClientId is a required field 472 ClientId *string `locationName:"clientId" type:"string" required:"true"` 473 474 // A secret string generated for the client. This value should come from the 475 // persisted result of the RegisterClient API. 476 // 477 // ClientSecret is a required field 478 ClientSecret *string `locationName:"clientSecret" type:"string" required:"true"` 479 480 // The authorization code received from the authorization service. This parameter 481 // is required to perform an authorization grant request to get access to a 482 // token. 483 Code *string `locationName:"code" type:"string"` 484 485 // Used only when calling this API for the device code grant type. This short-term 486 // code is used to identify this authentication attempt. This should come from 487 // an in-memory reference to the result of the StartDeviceAuthorization API. 488 // 489 // DeviceCode is a required field 490 DeviceCode *string `locationName:"deviceCode" type:"string" required:"true"` 491 492 // Supports grant types for authorization code, refresh token, and device code 493 // request. 494 // 495 // GrantType is a required field 496 GrantType *string `locationName:"grantType" type:"string" required:"true"` 497 498 // The location of the application that will receive the authorization code. 499 // Users authorize the service to send the request to this location. 500 RedirectUri *string `locationName:"redirectUri" type:"string"` 501 502 // The token used to obtain an access token in the event that the access token 503 // is invalid or expired. This token is not issued by the service. 504 RefreshToken *string `locationName:"refreshToken" type:"string"` 505 506 // The list of scopes that is defined by the client. Upon authorization, this 507 // list is used to restrict permissions when granting an access token. 508 Scope []*string `locationName:"scope" type:"list"` 509 } 510 511 // String returns the string representation. 512 // 513 // API parameter values that are decorated as "sensitive" in the API will not 514 // be included in the string output. The member name will be present, but the 515 // value will be replaced with "sensitive". 516 func (s CreateTokenInput) String() string { 517 return awsutil.Prettify(s) 518 } 519 520 // GoString returns the string representation. 521 // 522 // API parameter values that are decorated as "sensitive" in the API will not 523 // be included in the string output. The member name will be present, but the 524 // value will be replaced with "sensitive". 525 func (s CreateTokenInput) GoString() string { 526 return s.String() 527 } 528 529 // Validate inspects the fields of the type to determine if they are valid. 530 func (s *CreateTokenInput) Validate() error { 531 invalidParams := request.ErrInvalidParams{Context: "CreateTokenInput"} 532 if s.ClientId == nil { 533 invalidParams.Add(request.NewErrParamRequired("ClientId")) 534 } 535 if s.ClientSecret == nil { 536 invalidParams.Add(request.NewErrParamRequired("ClientSecret")) 537 } 538 if s.DeviceCode == nil { 539 invalidParams.Add(request.NewErrParamRequired("DeviceCode")) 540 } 541 if s.GrantType == nil { 542 invalidParams.Add(request.NewErrParamRequired("GrantType")) 543 } 544 545 if invalidParams.Len() > 0 { 546 return invalidParams 547 } 548 return nil 549 } 550 551 // SetClientId sets the ClientId field's value. 552 func (s *CreateTokenInput) SetClientId(v string) *CreateTokenInput { 553 s.ClientId = &v 554 return s 555 } 556 557 // SetClientSecret sets the ClientSecret field's value. 558 func (s *CreateTokenInput) SetClientSecret(v string) *CreateTokenInput { 559 s.ClientSecret = &v 560 return s 561 } 562 563 // SetCode sets the Code field's value. 564 func (s *CreateTokenInput) SetCode(v string) *CreateTokenInput { 565 s.Code = &v 566 return s 567 } 568 569 // SetDeviceCode sets the DeviceCode field's value. 570 func (s *CreateTokenInput) SetDeviceCode(v string) *CreateTokenInput { 571 s.DeviceCode = &v 572 return s 573 } 574 575 // SetGrantType sets the GrantType field's value. 576 func (s *CreateTokenInput) SetGrantType(v string) *CreateTokenInput { 577 s.GrantType = &v 578 return s 579 } 580 581 // SetRedirectUri sets the RedirectUri field's value. 582 func (s *CreateTokenInput) SetRedirectUri(v string) *CreateTokenInput { 583 s.RedirectUri = &v 584 return s 585 } 586 587 // SetRefreshToken sets the RefreshToken field's value. 588 func (s *CreateTokenInput) SetRefreshToken(v string) *CreateTokenInput { 589 s.RefreshToken = &v 590 return s 591 } 592 593 // SetScope sets the Scope field's value. 594 func (s *CreateTokenInput) SetScope(v []*string) *CreateTokenInput { 595 s.Scope = v 596 return s 597 } 598 599 type CreateTokenOutput struct { 600 _ struct{} `type:"structure"` 601 602 // An opaque token to access AWS SSO resources assigned to a user. 603 AccessToken *string `locationName:"accessToken" type:"string"` 604 605 // Indicates the time in seconds when an access token will expire. 606 ExpiresIn *int64 `locationName:"expiresIn" type:"integer"` 607 608 // The identifier of the user that associated with the access token, if present. 609 IdToken *string `locationName:"idToken" type:"string"` 610 611 // A token that, if present, can be used to refresh a previously issued access 612 // token that might have expired. 613 RefreshToken *string `locationName:"refreshToken" type:"string"` 614 615 // Used to notify the client that the returned token is an access token. The 616 // supported type is BearerToken. 617 TokenType *string `locationName:"tokenType" type:"string"` 618 } 619 620 // String returns the string representation. 621 // 622 // API parameter values that are decorated as "sensitive" in the API will not 623 // be included in the string output. The member name will be present, but the 624 // value will be replaced with "sensitive". 625 func (s CreateTokenOutput) String() string { 626 return awsutil.Prettify(s) 627 } 628 629 // GoString returns the string representation. 630 // 631 // API parameter values that are decorated as "sensitive" in the API will not 632 // be included in the string output. The member name will be present, but the 633 // value will be replaced with "sensitive". 634 func (s CreateTokenOutput) GoString() string { 635 return s.String() 636 } 637 638 // SetAccessToken sets the AccessToken field's value. 639 func (s *CreateTokenOutput) SetAccessToken(v string) *CreateTokenOutput { 640 s.AccessToken = &v 641 return s 642 } 643 644 // SetExpiresIn sets the ExpiresIn field's value. 645 func (s *CreateTokenOutput) SetExpiresIn(v int64) *CreateTokenOutput { 646 s.ExpiresIn = &v 647 return s 648 } 649 650 // SetIdToken sets the IdToken field's value. 651 func (s *CreateTokenOutput) SetIdToken(v string) *CreateTokenOutput { 652 s.IdToken = &v 653 return s 654 } 655 656 // SetRefreshToken sets the RefreshToken field's value. 657 func (s *CreateTokenOutput) SetRefreshToken(v string) *CreateTokenOutput { 658 s.RefreshToken = &v 659 return s 660 } 661 662 // SetTokenType sets the TokenType field's value. 663 func (s *CreateTokenOutput) SetTokenType(v string) *CreateTokenOutput { 664 s.TokenType = &v 665 return s 666 } 667 668 // Indicates that the token issued by the service is expired and is no longer 669 // valid. 670 type ExpiredTokenException struct { 671 _ struct{} `type:"structure"` 672 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 673 674 Error_ *string `locationName:"error" type:"string"` 675 676 Error_description *string `locationName:"error_description" type:"string"` 677 678 Message_ *string `locationName:"message" type:"string"` 679 } 680 681 // String returns the string representation. 682 // 683 // API parameter values that are decorated as "sensitive" in the API will not 684 // be included in the string output. The member name will be present, but the 685 // value will be replaced with "sensitive". 686 func (s ExpiredTokenException) String() string { 687 return awsutil.Prettify(s) 688 } 689 690 // GoString returns the string representation. 691 // 692 // API parameter values that are decorated as "sensitive" in the API will not 693 // be included in the string output. The member name will be present, but the 694 // value will be replaced with "sensitive". 695 func (s ExpiredTokenException) GoString() string { 696 return s.String() 697 } 698 699 func newErrorExpiredTokenException(v protocol.ResponseMetadata) error { 700 return &ExpiredTokenException{ 701 RespMetadata: v, 702 } 703 } 704 705 // Code returns the exception type name. 706 func (s *ExpiredTokenException) Code() string { 707 return "ExpiredTokenException" 708 } 709 710 // Message returns the exception's message. 711 func (s *ExpiredTokenException) Message() string { 712 if s.Message_ != nil { 713 return *s.Message_ 714 } 715 return "" 716 } 717 718 // OrigErr always returns nil, satisfies awserr.Error interface. 719 func (s *ExpiredTokenException) OrigErr() error { 720 return nil 721 } 722 723 func (s *ExpiredTokenException) Error() string { 724 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 725 } 726 727 // Status code returns the HTTP status code for the request's response error. 728 func (s *ExpiredTokenException) StatusCode() int { 729 return s.RespMetadata.StatusCode 730 } 731 732 // RequestID returns the service's response RequestID for request. 733 func (s *ExpiredTokenException) RequestID() string { 734 return s.RespMetadata.RequestID 735 } 736 737 // Indicates that an error from the service occurred while trying to process 738 // a request. 739 type InternalServerException struct { 740 _ struct{} `type:"structure"` 741 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 742 743 Error_ *string `locationName:"error" type:"string"` 744 745 Error_description *string `locationName:"error_description" type:"string"` 746 747 Message_ *string `locationName:"message" type:"string"` 748 } 749 750 // String returns the string representation. 751 // 752 // API parameter values that are decorated as "sensitive" in the API will not 753 // be included in the string output. The member name will be present, but the 754 // value will be replaced with "sensitive". 755 func (s InternalServerException) String() string { 756 return awsutil.Prettify(s) 757 } 758 759 // GoString returns the string representation. 760 // 761 // API parameter values that are decorated as "sensitive" in the API will not 762 // be included in the string output. The member name will be present, but the 763 // value will be replaced with "sensitive". 764 func (s InternalServerException) GoString() string { 765 return s.String() 766 } 767 768 func newErrorInternalServerException(v protocol.ResponseMetadata) error { 769 return &InternalServerException{ 770 RespMetadata: v, 771 } 772 } 773 774 // Code returns the exception type name. 775 func (s *InternalServerException) Code() string { 776 return "InternalServerException" 777 } 778 779 // Message returns the exception's message. 780 func (s *InternalServerException) Message() string { 781 if s.Message_ != nil { 782 return *s.Message_ 783 } 784 return "" 785 } 786 787 // OrigErr always returns nil, satisfies awserr.Error interface. 788 func (s *InternalServerException) OrigErr() error { 789 return nil 790 } 791 792 func (s *InternalServerException) Error() string { 793 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 794 } 795 796 // Status code returns the HTTP status code for the request's response error. 797 func (s *InternalServerException) StatusCode() int { 798 return s.RespMetadata.StatusCode 799 } 800 801 // RequestID returns the service's response RequestID for request. 802 func (s *InternalServerException) RequestID() string { 803 return s.RespMetadata.RequestID 804 } 805 806 // Indicates that the clientId or clientSecret in the request is invalid. For 807 // example, this can occur when a client sends an incorrect clientId or an expired 808 // clientSecret. 809 type InvalidClientException struct { 810 _ struct{} `type:"structure"` 811 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 812 813 Error_ *string `locationName:"error" type:"string"` 814 815 Error_description *string `locationName:"error_description" type:"string"` 816 817 Message_ *string `locationName:"message" type:"string"` 818 } 819 820 // String returns the string representation. 821 // 822 // API parameter values that are decorated as "sensitive" in the API will not 823 // be included in the string output. The member name will be present, but the 824 // value will be replaced with "sensitive". 825 func (s InvalidClientException) String() string { 826 return awsutil.Prettify(s) 827 } 828 829 // GoString returns the string representation. 830 // 831 // API parameter values that are decorated as "sensitive" in the API will not 832 // be included in the string output. The member name will be present, but the 833 // value will be replaced with "sensitive". 834 func (s InvalidClientException) GoString() string { 835 return s.String() 836 } 837 838 func newErrorInvalidClientException(v protocol.ResponseMetadata) error { 839 return &InvalidClientException{ 840 RespMetadata: v, 841 } 842 } 843 844 // Code returns the exception type name. 845 func (s *InvalidClientException) Code() string { 846 return "InvalidClientException" 847 } 848 849 // Message returns the exception's message. 850 func (s *InvalidClientException) Message() string { 851 if s.Message_ != nil { 852 return *s.Message_ 853 } 854 return "" 855 } 856 857 // OrigErr always returns nil, satisfies awserr.Error interface. 858 func (s *InvalidClientException) OrigErr() error { 859 return nil 860 } 861 862 func (s *InvalidClientException) Error() string { 863 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 864 } 865 866 // Status code returns the HTTP status code for the request's response error. 867 func (s *InvalidClientException) StatusCode() int { 868 return s.RespMetadata.StatusCode 869 } 870 871 // RequestID returns the service's response RequestID for request. 872 func (s *InvalidClientException) RequestID() string { 873 return s.RespMetadata.RequestID 874 } 875 876 // Indicates that the client information sent in the request during registration 877 // is invalid. 878 type InvalidClientMetadataException struct { 879 _ struct{} `type:"structure"` 880 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 881 882 Error_ *string `locationName:"error" type:"string"` 883 884 Error_description *string `locationName:"error_description" type:"string"` 885 886 Message_ *string `locationName:"message" type:"string"` 887 } 888 889 // String returns the string representation. 890 // 891 // API parameter values that are decorated as "sensitive" in the API will not 892 // be included in the string output. The member name will be present, but the 893 // value will be replaced with "sensitive". 894 func (s InvalidClientMetadataException) String() string { 895 return awsutil.Prettify(s) 896 } 897 898 // GoString returns the string representation. 899 // 900 // API parameter values that are decorated as "sensitive" in the API will not 901 // be included in the string output. The member name will be present, but the 902 // value will be replaced with "sensitive". 903 func (s InvalidClientMetadataException) GoString() string { 904 return s.String() 905 } 906 907 func newErrorInvalidClientMetadataException(v protocol.ResponseMetadata) error { 908 return &InvalidClientMetadataException{ 909 RespMetadata: v, 910 } 911 } 912 913 // Code returns the exception type name. 914 func (s *InvalidClientMetadataException) Code() string { 915 return "InvalidClientMetadataException" 916 } 917 918 // Message returns the exception's message. 919 func (s *InvalidClientMetadataException) Message() string { 920 if s.Message_ != nil { 921 return *s.Message_ 922 } 923 return "" 924 } 925 926 // OrigErr always returns nil, satisfies awserr.Error interface. 927 func (s *InvalidClientMetadataException) OrigErr() error { 928 return nil 929 } 930 931 func (s *InvalidClientMetadataException) Error() string { 932 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 933 } 934 935 // Status code returns the HTTP status code for the request's response error. 936 func (s *InvalidClientMetadataException) StatusCode() int { 937 return s.RespMetadata.StatusCode 938 } 939 940 // RequestID returns the service's response RequestID for request. 941 func (s *InvalidClientMetadataException) RequestID() string { 942 return s.RespMetadata.RequestID 943 } 944 945 // Indicates that a request contains an invalid grant. This can occur if a client 946 // makes a CreateToken request with an invalid grant type. 947 type InvalidGrantException struct { 948 _ struct{} `type:"structure"` 949 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 950 951 Error_ *string `locationName:"error" type:"string"` 952 953 Error_description *string `locationName:"error_description" type:"string"` 954 955 Message_ *string `locationName:"message" type:"string"` 956 } 957 958 // String returns the string representation. 959 // 960 // API parameter values that are decorated as "sensitive" in the API will not 961 // be included in the string output. The member name will be present, but the 962 // value will be replaced with "sensitive". 963 func (s InvalidGrantException) String() string { 964 return awsutil.Prettify(s) 965 } 966 967 // GoString returns the string representation. 968 // 969 // API parameter values that are decorated as "sensitive" in the API will not 970 // be included in the string output. The member name will be present, but the 971 // value will be replaced with "sensitive". 972 func (s InvalidGrantException) GoString() string { 973 return s.String() 974 } 975 976 func newErrorInvalidGrantException(v protocol.ResponseMetadata) error { 977 return &InvalidGrantException{ 978 RespMetadata: v, 979 } 980 } 981 982 // Code returns the exception type name. 983 func (s *InvalidGrantException) Code() string { 984 return "InvalidGrantException" 985 } 986 987 // Message returns the exception's message. 988 func (s *InvalidGrantException) Message() string { 989 if s.Message_ != nil { 990 return *s.Message_ 991 } 992 return "" 993 } 994 995 // OrigErr always returns nil, satisfies awserr.Error interface. 996 func (s *InvalidGrantException) OrigErr() error { 997 return nil 998 } 999 1000 func (s *InvalidGrantException) Error() string { 1001 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1002 } 1003 1004 // Status code returns the HTTP status code for the request's response error. 1005 func (s *InvalidGrantException) StatusCode() int { 1006 return s.RespMetadata.StatusCode 1007 } 1008 1009 // RequestID returns the service's response RequestID for request. 1010 func (s *InvalidGrantException) RequestID() string { 1011 return s.RespMetadata.RequestID 1012 } 1013 1014 // Indicates that something is wrong with the input to the request. For example, 1015 // a required parameter might be missing or out of range. 1016 type InvalidRequestException struct { 1017 _ struct{} `type:"structure"` 1018 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1019 1020 Error_ *string `locationName:"error" type:"string"` 1021 1022 Error_description *string `locationName:"error_description" type:"string"` 1023 1024 Message_ *string `locationName:"message" type:"string"` 1025 } 1026 1027 // String returns the string representation. 1028 // 1029 // API parameter values that are decorated as "sensitive" in the API will not 1030 // be included in the string output. The member name will be present, but the 1031 // value will be replaced with "sensitive". 1032 func (s InvalidRequestException) String() string { 1033 return awsutil.Prettify(s) 1034 } 1035 1036 // GoString returns the string representation. 1037 // 1038 // API parameter values that are decorated as "sensitive" in the API will not 1039 // be included in the string output. The member name will be present, but the 1040 // value will be replaced with "sensitive". 1041 func (s InvalidRequestException) GoString() string { 1042 return s.String() 1043 } 1044 1045 func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { 1046 return &InvalidRequestException{ 1047 RespMetadata: v, 1048 } 1049 } 1050 1051 // Code returns the exception type name. 1052 func (s *InvalidRequestException) Code() string { 1053 return "InvalidRequestException" 1054 } 1055 1056 // Message returns the exception's message. 1057 func (s *InvalidRequestException) Message() string { 1058 if s.Message_ != nil { 1059 return *s.Message_ 1060 } 1061 return "" 1062 } 1063 1064 // OrigErr always returns nil, satisfies awserr.Error interface. 1065 func (s *InvalidRequestException) OrigErr() error { 1066 return nil 1067 } 1068 1069 func (s *InvalidRequestException) Error() string { 1070 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1071 } 1072 1073 // Status code returns the HTTP status code for the request's response error. 1074 func (s *InvalidRequestException) StatusCode() int { 1075 return s.RespMetadata.StatusCode 1076 } 1077 1078 // RequestID returns the service's response RequestID for request. 1079 func (s *InvalidRequestException) RequestID() string { 1080 return s.RespMetadata.RequestID 1081 } 1082 1083 // Indicates that the scope provided in the request is invalid. 1084 type InvalidScopeException struct { 1085 _ struct{} `type:"structure"` 1086 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1087 1088 Error_ *string `locationName:"error" type:"string"` 1089 1090 Error_description *string `locationName:"error_description" type:"string"` 1091 1092 Message_ *string `locationName:"message" type:"string"` 1093 } 1094 1095 // String returns the string representation. 1096 // 1097 // API parameter values that are decorated as "sensitive" in the API will not 1098 // be included in the string output. The member name will be present, but the 1099 // value will be replaced with "sensitive". 1100 func (s InvalidScopeException) String() string { 1101 return awsutil.Prettify(s) 1102 } 1103 1104 // GoString returns the string representation. 1105 // 1106 // API parameter values that are decorated as "sensitive" in the API will not 1107 // be included in the string output. The member name will be present, but the 1108 // value will be replaced with "sensitive". 1109 func (s InvalidScopeException) GoString() string { 1110 return s.String() 1111 } 1112 1113 func newErrorInvalidScopeException(v protocol.ResponseMetadata) error { 1114 return &InvalidScopeException{ 1115 RespMetadata: v, 1116 } 1117 } 1118 1119 // Code returns the exception type name. 1120 func (s *InvalidScopeException) Code() string { 1121 return "InvalidScopeException" 1122 } 1123 1124 // Message returns the exception's message. 1125 func (s *InvalidScopeException) Message() string { 1126 if s.Message_ != nil { 1127 return *s.Message_ 1128 } 1129 return "" 1130 } 1131 1132 // OrigErr always returns nil, satisfies awserr.Error interface. 1133 func (s *InvalidScopeException) OrigErr() error { 1134 return nil 1135 } 1136 1137 func (s *InvalidScopeException) Error() string { 1138 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1139 } 1140 1141 // Status code returns the HTTP status code for the request's response error. 1142 func (s *InvalidScopeException) StatusCode() int { 1143 return s.RespMetadata.StatusCode 1144 } 1145 1146 // RequestID returns the service's response RequestID for request. 1147 func (s *InvalidScopeException) RequestID() string { 1148 return s.RespMetadata.RequestID 1149 } 1150 1151 type RegisterClientInput struct { 1152 _ struct{} `type:"structure"` 1153 1154 // The friendly name of the client. 1155 // 1156 // ClientName is a required field 1157 ClientName *string `locationName:"clientName" type:"string" required:"true"` 1158 1159 // The type of client. The service supports only public as a client type. Anything 1160 // other than public will be rejected by the service. 1161 // 1162 // ClientType is a required field 1163 ClientType *string `locationName:"clientType" type:"string" required:"true"` 1164 1165 // The list of scopes that are defined by the client. Upon authorization, this 1166 // list is used to restrict permissions when granting an access token. 1167 Scopes []*string `locationName:"scopes" type:"list"` 1168 } 1169 1170 // String returns the string representation. 1171 // 1172 // API parameter values that are decorated as "sensitive" in the API will not 1173 // be included in the string output. The member name will be present, but the 1174 // value will be replaced with "sensitive". 1175 func (s RegisterClientInput) String() string { 1176 return awsutil.Prettify(s) 1177 } 1178 1179 // GoString returns the string representation. 1180 // 1181 // API parameter values that are decorated as "sensitive" in the API will not 1182 // be included in the string output. The member name will be present, but the 1183 // value will be replaced with "sensitive". 1184 func (s RegisterClientInput) GoString() string { 1185 return s.String() 1186 } 1187 1188 // Validate inspects the fields of the type to determine if they are valid. 1189 func (s *RegisterClientInput) Validate() error { 1190 invalidParams := request.ErrInvalidParams{Context: "RegisterClientInput"} 1191 if s.ClientName == nil { 1192 invalidParams.Add(request.NewErrParamRequired("ClientName")) 1193 } 1194 if s.ClientType == nil { 1195 invalidParams.Add(request.NewErrParamRequired("ClientType")) 1196 } 1197 1198 if invalidParams.Len() > 0 { 1199 return invalidParams 1200 } 1201 return nil 1202 } 1203 1204 // SetClientName sets the ClientName field's value. 1205 func (s *RegisterClientInput) SetClientName(v string) *RegisterClientInput { 1206 s.ClientName = &v 1207 return s 1208 } 1209 1210 // SetClientType sets the ClientType field's value. 1211 func (s *RegisterClientInput) SetClientType(v string) *RegisterClientInput { 1212 s.ClientType = &v 1213 return s 1214 } 1215 1216 // SetScopes sets the Scopes field's value. 1217 func (s *RegisterClientInput) SetScopes(v []*string) *RegisterClientInput { 1218 s.Scopes = v 1219 return s 1220 } 1221 1222 type RegisterClientOutput struct { 1223 _ struct{} `type:"structure"` 1224 1225 // The endpoint where the client can request authorization. 1226 AuthorizationEndpoint *string `locationName:"authorizationEndpoint" type:"string"` 1227 1228 // The unique identifier string for each client. This client uses this identifier 1229 // to get authenticated by the service in subsequent calls. 1230 ClientId *string `locationName:"clientId" type:"string"` 1231 1232 // Indicates the time at which the clientId and clientSecret were issued. 1233 ClientIdIssuedAt *int64 `locationName:"clientIdIssuedAt" type:"long"` 1234 1235 // A secret string generated for the client. The client will use this string 1236 // to get authenticated by the service in subsequent calls. 1237 ClientSecret *string `locationName:"clientSecret" type:"string"` 1238 1239 // Indicates the time at which the clientId and clientSecret will become invalid. 1240 ClientSecretExpiresAt *int64 `locationName:"clientSecretExpiresAt" type:"long"` 1241 1242 // The endpoint where the client can get an access token. 1243 TokenEndpoint *string `locationName:"tokenEndpoint" type:"string"` 1244 } 1245 1246 // String returns the string representation. 1247 // 1248 // API parameter values that are decorated as "sensitive" in the API will not 1249 // be included in the string output. The member name will be present, but the 1250 // value will be replaced with "sensitive". 1251 func (s RegisterClientOutput) String() string { 1252 return awsutil.Prettify(s) 1253 } 1254 1255 // GoString returns the string representation. 1256 // 1257 // API parameter values that are decorated as "sensitive" in the API will not 1258 // be included in the string output. The member name will be present, but the 1259 // value will be replaced with "sensitive". 1260 func (s RegisterClientOutput) GoString() string { 1261 return s.String() 1262 } 1263 1264 // SetAuthorizationEndpoint sets the AuthorizationEndpoint field's value. 1265 func (s *RegisterClientOutput) SetAuthorizationEndpoint(v string) *RegisterClientOutput { 1266 s.AuthorizationEndpoint = &v 1267 return s 1268 } 1269 1270 // SetClientId sets the ClientId field's value. 1271 func (s *RegisterClientOutput) SetClientId(v string) *RegisterClientOutput { 1272 s.ClientId = &v 1273 return s 1274 } 1275 1276 // SetClientIdIssuedAt sets the ClientIdIssuedAt field's value. 1277 func (s *RegisterClientOutput) SetClientIdIssuedAt(v int64) *RegisterClientOutput { 1278 s.ClientIdIssuedAt = &v 1279 return s 1280 } 1281 1282 // SetClientSecret sets the ClientSecret field's value. 1283 func (s *RegisterClientOutput) SetClientSecret(v string) *RegisterClientOutput { 1284 s.ClientSecret = &v 1285 return s 1286 } 1287 1288 // SetClientSecretExpiresAt sets the ClientSecretExpiresAt field's value. 1289 func (s *RegisterClientOutput) SetClientSecretExpiresAt(v int64) *RegisterClientOutput { 1290 s.ClientSecretExpiresAt = &v 1291 return s 1292 } 1293 1294 // SetTokenEndpoint sets the TokenEndpoint field's value. 1295 func (s *RegisterClientOutput) SetTokenEndpoint(v string) *RegisterClientOutput { 1296 s.TokenEndpoint = &v 1297 return s 1298 } 1299 1300 // Indicates that the client is making the request too frequently and is more 1301 // than the service can handle. 1302 type SlowDownException struct { 1303 _ struct{} `type:"structure"` 1304 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1305 1306 Error_ *string `locationName:"error" type:"string"` 1307 1308 Error_description *string `locationName:"error_description" type:"string"` 1309 1310 Message_ *string `locationName:"message" type:"string"` 1311 } 1312 1313 // String returns the string representation. 1314 // 1315 // API parameter values that are decorated as "sensitive" in the API will not 1316 // be included in the string output. The member name will be present, but the 1317 // value will be replaced with "sensitive". 1318 func (s SlowDownException) String() string { 1319 return awsutil.Prettify(s) 1320 } 1321 1322 // GoString returns the string representation. 1323 // 1324 // API parameter values that are decorated as "sensitive" in the API will not 1325 // be included in the string output. The member name will be present, but the 1326 // value will be replaced with "sensitive". 1327 func (s SlowDownException) GoString() string { 1328 return s.String() 1329 } 1330 1331 func newErrorSlowDownException(v protocol.ResponseMetadata) error { 1332 return &SlowDownException{ 1333 RespMetadata: v, 1334 } 1335 } 1336 1337 // Code returns the exception type name. 1338 func (s *SlowDownException) Code() string { 1339 return "SlowDownException" 1340 } 1341 1342 // Message returns the exception's message. 1343 func (s *SlowDownException) Message() string { 1344 if s.Message_ != nil { 1345 return *s.Message_ 1346 } 1347 return "" 1348 } 1349 1350 // OrigErr always returns nil, satisfies awserr.Error interface. 1351 func (s *SlowDownException) OrigErr() error { 1352 return nil 1353 } 1354 1355 func (s *SlowDownException) Error() string { 1356 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1357 } 1358 1359 // Status code returns the HTTP status code for the request's response error. 1360 func (s *SlowDownException) StatusCode() int { 1361 return s.RespMetadata.StatusCode 1362 } 1363 1364 // RequestID returns the service's response RequestID for request. 1365 func (s *SlowDownException) RequestID() string { 1366 return s.RespMetadata.RequestID 1367 } 1368 1369 type StartDeviceAuthorizationInput struct { 1370 _ struct{} `type:"structure"` 1371 1372 // The unique identifier string for the client that is registered with AWS SSO. 1373 // This value should come from the persisted result of the RegisterClient API 1374 // operation. 1375 // 1376 // ClientId is a required field 1377 ClientId *string `locationName:"clientId" type:"string" required:"true"` 1378 1379 // A secret string that is generated for the client. This value should come 1380 // from the persisted result of the RegisterClient API operation. 1381 // 1382 // ClientSecret is a required field 1383 ClientSecret *string `locationName:"clientSecret" type:"string" required:"true"` 1384 1385 // The URL for the AWS SSO user portal. For more information, see Using the 1386 // User Portal (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html) 1387 // in the AWS Single Sign-On User Guide. 1388 // 1389 // StartUrl is a required field 1390 StartUrl *string `locationName:"startUrl" type:"string" required:"true"` 1391 } 1392 1393 // String returns the string representation. 1394 // 1395 // API parameter values that are decorated as "sensitive" in the API will not 1396 // be included in the string output. The member name will be present, but the 1397 // value will be replaced with "sensitive". 1398 func (s StartDeviceAuthorizationInput) String() string { 1399 return awsutil.Prettify(s) 1400 } 1401 1402 // GoString returns the string representation. 1403 // 1404 // API parameter values that are decorated as "sensitive" in the API will not 1405 // be included in the string output. The member name will be present, but the 1406 // value will be replaced with "sensitive". 1407 func (s StartDeviceAuthorizationInput) GoString() string { 1408 return s.String() 1409 } 1410 1411 // Validate inspects the fields of the type to determine if they are valid. 1412 func (s *StartDeviceAuthorizationInput) Validate() error { 1413 invalidParams := request.ErrInvalidParams{Context: "StartDeviceAuthorizationInput"} 1414 if s.ClientId == nil { 1415 invalidParams.Add(request.NewErrParamRequired("ClientId")) 1416 } 1417 if s.ClientSecret == nil { 1418 invalidParams.Add(request.NewErrParamRequired("ClientSecret")) 1419 } 1420 if s.StartUrl == nil { 1421 invalidParams.Add(request.NewErrParamRequired("StartUrl")) 1422 } 1423 1424 if invalidParams.Len() > 0 { 1425 return invalidParams 1426 } 1427 return nil 1428 } 1429 1430 // SetClientId sets the ClientId field's value. 1431 func (s *StartDeviceAuthorizationInput) SetClientId(v string) *StartDeviceAuthorizationInput { 1432 s.ClientId = &v 1433 return s 1434 } 1435 1436 // SetClientSecret sets the ClientSecret field's value. 1437 func (s *StartDeviceAuthorizationInput) SetClientSecret(v string) *StartDeviceAuthorizationInput { 1438 s.ClientSecret = &v 1439 return s 1440 } 1441 1442 // SetStartUrl sets the StartUrl field's value. 1443 func (s *StartDeviceAuthorizationInput) SetStartUrl(v string) *StartDeviceAuthorizationInput { 1444 s.StartUrl = &v 1445 return s 1446 } 1447 1448 type StartDeviceAuthorizationOutput struct { 1449 _ struct{} `type:"structure"` 1450 1451 // The short-lived code that is used by the device when polling for a session 1452 // token. 1453 DeviceCode *string `locationName:"deviceCode" type:"string"` 1454 1455 // Indicates the number of seconds in which the verification code will become 1456 // invalid. 1457 ExpiresIn *int64 `locationName:"expiresIn" type:"integer"` 1458 1459 // Indicates the number of seconds the client must wait between attempts when 1460 // polling for a session. 1461 Interval *int64 `locationName:"interval" type:"integer"` 1462 1463 // A one-time user verification code. This is needed to authorize an in-use 1464 // device. 1465 UserCode *string `locationName:"userCode" type:"string"` 1466 1467 // The URI of the verification page that takes the userCode to authorize the 1468 // device. 1469 VerificationUri *string `locationName:"verificationUri" type:"string"` 1470 1471 // An alternate URL that the client can use to automatically launch a browser. 1472 // This process skips the manual step in which the user visits the verification 1473 // page and enters their code. 1474 VerificationUriComplete *string `locationName:"verificationUriComplete" type:"string"` 1475 } 1476 1477 // String returns the string representation. 1478 // 1479 // API parameter values that are decorated as "sensitive" in the API will not 1480 // be included in the string output. The member name will be present, but the 1481 // value will be replaced with "sensitive". 1482 func (s StartDeviceAuthorizationOutput) String() string { 1483 return awsutil.Prettify(s) 1484 } 1485 1486 // GoString returns the string representation. 1487 // 1488 // API parameter values that are decorated as "sensitive" in the API will not 1489 // be included in the string output. The member name will be present, but the 1490 // value will be replaced with "sensitive". 1491 func (s StartDeviceAuthorizationOutput) GoString() string { 1492 return s.String() 1493 } 1494 1495 // SetDeviceCode sets the DeviceCode field's value. 1496 func (s *StartDeviceAuthorizationOutput) SetDeviceCode(v string) *StartDeviceAuthorizationOutput { 1497 s.DeviceCode = &v 1498 return s 1499 } 1500 1501 // SetExpiresIn sets the ExpiresIn field's value. 1502 func (s *StartDeviceAuthorizationOutput) SetExpiresIn(v int64) *StartDeviceAuthorizationOutput { 1503 s.ExpiresIn = &v 1504 return s 1505 } 1506 1507 // SetInterval sets the Interval field's value. 1508 func (s *StartDeviceAuthorizationOutput) SetInterval(v int64) *StartDeviceAuthorizationOutput { 1509 s.Interval = &v 1510 return s 1511 } 1512 1513 // SetUserCode sets the UserCode field's value. 1514 func (s *StartDeviceAuthorizationOutput) SetUserCode(v string) *StartDeviceAuthorizationOutput { 1515 s.UserCode = &v 1516 return s 1517 } 1518 1519 // SetVerificationUri sets the VerificationUri field's value. 1520 func (s *StartDeviceAuthorizationOutput) SetVerificationUri(v string) *StartDeviceAuthorizationOutput { 1521 s.VerificationUri = &v 1522 return s 1523 } 1524 1525 // SetVerificationUriComplete sets the VerificationUriComplete field's value. 1526 func (s *StartDeviceAuthorizationOutput) SetVerificationUriComplete(v string) *StartDeviceAuthorizationOutput { 1527 s.VerificationUriComplete = &v 1528 return s 1529 } 1530 1531 // Indicates that the client is not currently authorized to make the request. 1532 // This can happen when a clientId is not issued for a public client. 1533 type UnauthorizedClientException struct { 1534 _ struct{} `type:"structure"` 1535 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1536 1537 Error_ *string `locationName:"error" type:"string"` 1538 1539 Error_description *string `locationName:"error_description" type:"string"` 1540 1541 Message_ *string `locationName:"message" type:"string"` 1542 } 1543 1544 // String returns the string representation. 1545 // 1546 // API parameter values that are decorated as "sensitive" in the API will not 1547 // be included in the string output. The member name will be present, but the 1548 // value will be replaced with "sensitive". 1549 func (s UnauthorizedClientException) String() string { 1550 return awsutil.Prettify(s) 1551 } 1552 1553 // GoString returns the string representation. 1554 // 1555 // API parameter values that are decorated as "sensitive" in the API will not 1556 // be included in the string output. The member name will be present, but the 1557 // value will be replaced with "sensitive". 1558 func (s UnauthorizedClientException) GoString() string { 1559 return s.String() 1560 } 1561 1562 func newErrorUnauthorizedClientException(v protocol.ResponseMetadata) error { 1563 return &UnauthorizedClientException{ 1564 RespMetadata: v, 1565 } 1566 } 1567 1568 // Code returns the exception type name. 1569 func (s *UnauthorizedClientException) Code() string { 1570 return "UnauthorizedClientException" 1571 } 1572 1573 // Message returns the exception's message. 1574 func (s *UnauthorizedClientException) Message() string { 1575 if s.Message_ != nil { 1576 return *s.Message_ 1577 } 1578 return "" 1579 } 1580 1581 // OrigErr always returns nil, satisfies awserr.Error interface. 1582 func (s *UnauthorizedClientException) OrigErr() error { 1583 return nil 1584 } 1585 1586 func (s *UnauthorizedClientException) Error() string { 1587 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1588 } 1589 1590 // Status code returns the HTTP status code for the request's response error. 1591 func (s *UnauthorizedClientException) StatusCode() int { 1592 return s.RespMetadata.StatusCode 1593 } 1594 1595 // RequestID returns the service's response RequestID for request. 1596 func (s *UnauthorizedClientException) RequestID() string { 1597 return s.RespMetadata.RequestID 1598 } 1599 1600 // Indicates that the grant type in the request is not supported by the service. 1601 type UnsupportedGrantTypeException struct { 1602 _ struct{} `type:"structure"` 1603 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1604 1605 Error_ *string `locationName:"error" type:"string"` 1606 1607 Error_description *string `locationName:"error_description" type:"string"` 1608 1609 Message_ *string `locationName:"message" type:"string"` 1610 } 1611 1612 // String returns the string representation. 1613 // 1614 // API parameter values that are decorated as "sensitive" in the API will not 1615 // be included in the string output. The member name will be present, but the 1616 // value will be replaced with "sensitive". 1617 func (s UnsupportedGrantTypeException) String() string { 1618 return awsutil.Prettify(s) 1619 } 1620 1621 // GoString returns the string representation. 1622 // 1623 // API parameter values that are decorated as "sensitive" in the API will not 1624 // be included in the string output. The member name will be present, but the 1625 // value will be replaced with "sensitive". 1626 func (s UnsupportedGrantTypeException) GoString() string { 1627 return s.String() 1628 } 1629 1630 func newErrorUnsupportedGrantTypeException(v protocol.ResponseMetadata) error { 1631 return &UnsupportedGrantTypeException{ 1632 RespMetadata: v, 1633 } 1634 } 1635 1636 // Code returns the exception type name. 1637 func (s *UnsupportedGrantTypeException) Code() string { 1638 return "UnsupportedGrantTypeException" 1639 } 1640 1641 // Message returns the exception's message. 1642 func (s *UnsupportedGrantTypeException) Message() string { 1643 if s.Message_ != nil { 1644 return *s.Message_ 1645 } 1646 return "" 1647 } 1648 1649 // OrigErr always returns nil, satisfies awserr.Error interface. 1650 func (s *UnsupportedGrantTypeException) OrigErr() error { 1651 return nil 1652 } 1653 1654 func (s *UnsupportedGrantTypeException) Error() string { 1655 return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) 1656 } 1657 1658 // Status code returns the HTTP status code for the request's response error. 1659 func (s *UnsupportedGrantTypeException) StatusCode() int { 1660 return s.RespMetadata.StatusCode 1661 } 1662 1663 // RequestID returns the service's response RequestID for request. 1664 func (s *UnsupportedGrantTypeException) RequestID() string { 1665 return s.RespMetadata.RequestID 1666 }