Class: LockstepSdk::ConnectorInfoModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/connector_info_model.rb

Overview

Represents all possible data required to set up an app enrollment for a connector. Only send required fields for the given connector.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ ConnectorInfoModel

Initialize the ConnectorInfoModel using the provided prototype



28
29
30
31
32
33
34
35
36
37
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 28

def initialize(params = {})
    @auth_code = params.dig(:auth_code)
    @realm_id = params.dig(:realm_id)
    @redirect_uri = params.dig(:redirect_uri)
    @email = params.dig(:email)
    @username = params.dig(:username)
    @password = params.dig(:password)
    @server_name = params.dig(:server_name)
    @server_port = params.dig(:server_port)
end

Instance Attribute Details

#auth_codeString

Returns The authorization code returned from the first step of the OAuth2 flow oauth.net/2/grant-types/authorization-code/.

Returns:



41
42
43
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 41

def auth_code
  @auth_code
end

#emailString

Returns The email an email connection is being created for.

Returns:

  • (String)

    The email an email connection is being created for.



53
54
55
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 53

def email
  @email
end

#passwordString

Returns The password for the web services account with access permissions.

Returns:

  • (String)

    The password for the web services account with access permissions.



61
62
63
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 61

def password
  @password
end

#realm_idString

Returns The realm id of the account being granted permissions to access.

Returns:

  • (String)

    The realm id of the account being granted permissions to access



45
46
47
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 45

def realm_id
  @realm_id
end

#redirect_uriString

Returns The redirect uri used for step one of the OAuth2.0 flow.

Returns:

  • (String)

    The redirect uri used for step one of the OAuth2.0 flow.



49
50
51
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 49

def redirect_uri
  @redirect_uri
end

#server_nameString

Returns The server name a connection is being created for.

Returns:

  • (String)

    The server name a connection is being created for.



65
66
67
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 65

def server_name
  @server_name
end

#server_portInt32

Returns The port number of the server a connection is being created for.

Returns:

  • (Int32)

    The port number of the server a connection is being created for.



69
70
71
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 69

def server_port
  @server_port
end

#usernameString

Returns The username of the web services account with access permissions.

Returns:

  • (String)

    The username of the web services account with access permissions.



57
58
59
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 57

def username
  @username
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 73

def as_json(options={})
    {
        'authCode' => @auth_code,
        'realmId' => @realm_id,
        'redirectUri' => @redirect_uri,
        'email' => @email,
        'username' => @username,
        'password' => @password,
        'serverName' => @server_name,
        'serverPort' => @server_port,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



88
89
90
# File 'lib/lockstep_sdk/models/connector_info_model.rb', line 88

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end