Class: AWSCDK::Events::OAuthAuthorizationProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
events/o_auth_authorization_props.rb

Overview

Properties for Authorization.oauth().

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_endpoint:, client_id:, client_secret:, http_method:, body_parameters: nil, header_parameters: nil, query_string_parameters: nil) ⇒ OAuthAuthorizationProps

Returns a new instance of OAuthAuthorizationProps.

Parameters:

  • authorization_endpoint (String)

    The URL to the authorization endpoint.

  • client_id (String)

    The client ID to use for OAuth authorization for the connection.

  • client_secret (AWSCDK::SecretValue)

    The client secret associated with the client ID to use for OAuth authorization for the connection.

  • http_method (AWSCDK::Events::HttpMethod)

    The method to use for the authorization request.

  • body_parameters (Hash{String => AWSCDK::Events::HttpParameter}, nil) (defaults to: nil)

    Additional string parameters to add to the OAuth request body.

  • header_parameters (Hash{String => AWSCDK::Events::HttpParameter}, nil) (defaults to: nil)

    Additional string parameters to add to the OAuth request header.

  • query_string_parameters (Hash{String => AWSCDK::Events::HttpParameter}, nil) (defaults to: nil)

    Additional string parameters to add to the OAuth request query string.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'events/o_auth_authorization_props.rb', line 14

def initialize(authorization_endpoint:, client_id:, client_secret:, http_method:, body_parameters: nil, header_parameters: nil, query_string_parameters: nil)
  @authorization_endpoint = authorization_endpoint
  Jsii::Type.check_type(@authorization_endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authorizationEndpoint")
  @client_id = client_id
  Jsii::Type.check_type(@client_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "clientId")
  @client_secret = client_secret
  Jsii::Type.check_type(@client_secret, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TZWNyZXRWYWx1ZSJ9")), "clientSecret")
  @http_method = http_method
  Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLkh0dHBNZXRob2QifQ==")), "httpMethod")
  @body_parameters = body_parameters
  Jsii::Type.check_type(@body_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHMuSHR0cFBhcmFtZXRlciJ9LCJraW5kIjoibWFwIn19")), "bodyParameters") unless @body_parameters.nil?
  @header_parameters = header_parameters
  Jsii::Type.check_type(@header_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHMuSHR0cFBhcmFtZXRlciJ9LCJraW5kIjoibWFwIn19")), "headerParameters") unless @header_parameters.nil?
  @query_string_parameters = query_string_parameters
  Jsii::Type.check_type(@query_string_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19ldmVudHMuSHR0cFBhcmFtZXRlciJ9LCJraW5kIjoibWFwIn19")), "queryStringParameters") unless @query_string_parameters.nil?
end

Instance Attribute Details

#authorization_endpointString (readonly)

The URL to the authorization endpoint.

Returns:

  • (String)


34
35
36
# File 'events/o_auth_authorization_props.rb', line 34

def authorization_endpoint
  @authorization_endpoint
end

#body_parametersHash{String => AWSCDK::Events::HttpParameter}? (readonly)

Note:

Default: - No additional parameters

Additional string parameters to add to the OAuth request body.

Returns:



53
54
55
# File 'events/o_auth_authorization_props.rb', line 53

def body_parameters
  @body_parameters
end

#client_idString (readonly)

The client ID to use for OAuth authorization for the connection.

Returns:

  • (String)


38
39
40
# File 'events/o_auth_authorization_props.rb', line 38

def client_id
  @client_id
end

#client_secretAWSCDK::SecretValue (readonly)

The client secret associated with the client ID to use for OAuth authorization for the connection.

Returns:



42
43
44
# File 'events/o_auth_authorization_props.rb', line 42

def client_secret
  @client_secret
end

#header_parametersHash{String => AWSCDK::Events::HttpParameter}? (readonly)

Note:

Default: - No additional parameters

Additional string parameters to add to the OAuth request header.

Returns:



58
59
60
# File 'events/o_auth_authorization_props.rb', line 58

def header_parameters
  @header_parameters
end

#http_methodAWSCDK::Events::HttpMethod (readonly)

The method to use for the authorization request.

(Can only choose POST, GET or PUT).



48
49
50
# File 'events/o_auth_authorization_props.rb', line 48

def http_method
  @http_method
end

#query_string_parametersHash{String => AWSCDK::Events::HttpParameter}? (readonly)

Note:

Default: - No additional parameters

Additional string parameters to add to the OAuth request query string.

Returns:



63
64
65
# File 'events/o_auth_authorization_props.rb', line 63

def query_string_parameters
  @query_string_parameters
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
74
75
# File 'events/o_auth_authorization_props.rb', line 65

def self.jsii_properties
  {
    :authorization_endpoint => "authorizationEndpoint",
    :client_id => "clientId",
    :client_secret => "clientSecret",
    :http_method => "httpMethod",
    :body_parameters => "bodyParameters",
    :header_parameters => "headerParameters",
    :query_string_parameters => "queryStringParameters",
  }
end

Instance Method Details

#to_jsiiObject



77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'events/o_auth_authorization_props.rb', line 77

def to_jsii
  result = {}
  result.merge!({
    "authorizationEndpoint" => @authorization_endpoint,
    "clientId" => @client_id,
    "clientSecret" => @client_secret,
    "httpMethod" => @http_method,
    "bodyParameters" => @body_parameters,
    "headerParameters" => @header_parameters,
    "queryStringParameters" => @query_string_parameters,
  })
  result.compact
end