Class: OCI::DataScience::Models::CreateIdcsCustomServiceAuthConfigurationDetails

Inherits:
CreateAuthConfigurationDetails show all
Defined in:
lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb

Overview

Create configuration for existing Oracle Cloud Service

Instance Attribute Summary collapse

Attributes inherited from CreateAuthConfigurationDetails

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateAuthConfigurationDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateIdcsCustomServiceAuthConfigurationDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :audience (String)

    The value to assign to the #audience property

  • :scope (String)

    The value to assign to the #scope property

  • :application_name (String)

    The value to assign to the #application_name property

  • :role_name (String)

    The value to assign to the #role_name property

  • :access_token (String)

    The value to assign to the #access_token property

[View source]

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 71

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['type'] = 'IDCS_CUSTOM_SERVICE'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.audience = attributes[:'audience'] if attributes[:'audience']

  self.scope = attributes[:'scope'] if attributes[:'scope']

  self.application_name = attributes[:'applicationName'] if attributes[:'applicationName']

  raise 'You cannot provide both :applicationName and :application_name' if attributes.key?(:'applicationName') && attributes.key?(:'application_name')

  self.application_name = attributes[:'application_name'] if attributes[:'application_name']

  self.role_name = attributes[:'roleName'] if attributes[:'roleName']
  self.role_name = "DATA SCIENCE APPLICATION INSTANCE PREDICT" if role_name.nil? && !attributes.key?(:'roleName') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :roleName and :role_name' if attributes.key?(:'roleName') && attributes.key?(:'role_name')

  self.role_name = attributes[:'role_name'] if attributes[:'role_name']
  self.role_name = "DATA SCIENCE APPLICATION INSTANCE PREDICT" if role_name.nil? && !attributes.key?(:'roleName') && !attributes.key?(:'role_name') # rubocop:disable Style/StringLiterals

  self.access_token = attributes[:'accessToken'] if attributes[:'accessToken']

  raise 'You cannot provide both :accessToken and :access_token' if attributes.key?(:'accessToken') && attributes.key?(:'access_token')

  self.access_token = attributes[:'access_token'] if attributes[:'access_token']
end

Instance Attribute Details

#access_tokenString

[Required] Bearer token serving as Proof-of-Ownership for referenced IDCS stripe/application

Returns:

  • (String)

30
31
32
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 30

def access_token
  @access_token
end

#application_nameString

[Required] Name of the IDCS application

Returns:

  • (String)

22
23
24
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 22

def application_name
  @application_name
end

#audienceString

[Required] Audience of the IDCS application

Returns:

  • (String)

14
15
16
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 14

def audience
  @audience
end

#role_nameString

Name of the IDCS application role

Returns:

  • (String)

26
27
28
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 26

def role_name
  @role_name
end

#scopeString

[Required] Scope of the IDCS application

Returns:

  • (String)

18
19
20
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 18

def scope
  @scope
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.

[View source]

33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 33

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'audience': :'audience',
    'scope': :'scope',
    'application_name': :'applicationName',
    'role_name': :'roleName',
    'access_token': :'accessToken'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.

[View source]

47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 47

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'audience': :'String',
    'scope': :'String',
    'application_name': :'String',
    'role_name': :'String',
    'access_token': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared

[View source]

113
114
115
116
117
118
119
120
121
122
123
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 113

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    type == other.type &&
    audience == other.audience &&
    scope == other.scope &&
    application_name == other.application_name &&
    role_name == other.role_name &&
    access_token == other.access_token
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself

[View source]

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 148

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method
[View source]

128
129
130
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 128

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code

[View source]

137
138
139
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 137

def hash
  [type, audience, scope, application_name, role_name, access_token].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash

[View source]

181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 181

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object

[View source]

175
176
177
# File 'lib/oci/data_science/models/create_idcs_custom_service_auth_configuration_details.rb', line 175

def to_s
  to_hash.to_s
end