Class: OCI::MediaServices::Models::AkamaiManualStreamCdnConfig

Inherits:
StreamCdnConfigSection show all
Defined in:
lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb

Overview

Configuration fields for manual Akamai configuration.

Constant Summary collapse

ORIGIN_AUTH_SIGN_TYPE_ENUM =
[
  ORIGIN_AUTH_SIGN_TYPE_FORWARD_URL = 'ForwardURL'.freeze,
  ORIGIN_AUTH_SIGN_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ORIGIN_AUTH_SIGN_ENCRYPTION_ENUM =
[
  ORIGIN_AUTH_SIGN_ENCRYPTION_SHA256_HMAC = 'SHA256-HMAC'.freeze,
  ORIGIN_AUTH_SIGN_ENCRYPTION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from StreamCdnConfigSection

StreamCdnConfigSection::TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from StreamCdnConfigSection

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from StreamCdnConfigSection

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ AkamaiManualStreamCdnConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 124

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

  attributes['type'] = 'AKAMAI_MANUAL'

  super(attributes)

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

  self.origin_auth_sign_type = attributes[:'originAuthSignType'] if attributes[:'originAuthSignType']
  self.origin_auth_sign_type = "ForwardURL" if origin_auth_sign_type.nil? && !attributes.key?(:'originAuthSignType') # rubocop:disable Style/StringLiterals

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

  self.origin_auth_sign_type = attributes[:'origin_auth_sign_type'] if attributes[:'origin_auth_sign_type']
  self.origin_auth_sign_type = "ForwardURL" if origin_auth_sign_type.nil? && !attributes.key?(:'originAuthSignType') && !attributes.key?(:'origin_auth_sign_type') # rubocop:disable Style/StringLiterals

  self.origin_auth_sign_encryption = attributes[:'originAuthSignEncryption'] if attributes[:'originAuthSignEncryption']
  self.origin_auth_sign_encryption = "SHA256-HMAC" if origin_auth_sign_encryption.nil? && !attributes.key?(:'originAuthSignEncryption') # rubocop:disable Style/StringLiterals

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

  self.origin_auth_sign_encryption = attributes[:'origin_auth_sign_encryption'] if attributes[:'origin_auth_sign_encryption']
  self.origin_auth_sign_encryption = "SHA256-HMAC" if origin_auth_sign_encryption.nil? && !attributes.key?(:'originAuthSignEncryption') && !attributes.key?(:'origin_auth_sign_encryption') # rubocop:disable Style/StringLiterals

  self.origin_auth_secret_key_a = attributes[:'originAuthSecretKeyA'] if attributes[:'originAuthSecretKeyA']

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

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

  self.origin_auth_secret_key_nonce_a = attributes[:'originAuthSecretKeyNonceA'] if attributes[:'originAuthSecretKeyNonceA']
  self.origin_auth_secret_key_nonce_a = "nonceKeyA" if origin_auth_secret_key_nonce_a.nil? && !attributes.key?(:'originAuthSecretKeyNonceA') # rubocop:disable Style/StringLiterals

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

  self.origin_auth_secret_key_nonce_a = attributes[:'origin_auth_secret_key_nonce_a'] if attributes[:'origin_auth_secret_key_nonce_a']
  self.origin_auth_secret_key_nonce_a = "nonceKeyA" if origin_auth_secret_key_nonce_a.nil? && !attributes.key?(:'originAuthSecretKeyNonceA') && !attributes.key?(:'origin_auth_secret_key_nonce_a') # rubocop:disable Style/StringLiterals

  self.origin_auth_secret_key_b = attributes[:'originAuthSecretKeyB'] if attributes[:'originAuthSecretKeyB']

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

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

  self.origin_auth_secret_key_nonce_b = attributes[:'originAuthSecretKeyNonceB'] if attributes[:'originAuthSecretKeyNonceB']
  self.origin_auth_secret_key_nonce_b = "nonceKeyB" if origin_auth_secret_key_nonce_b.nil? && !attributes.key?(:'originAuthSecretKeyNonceB') # rubocop:disable Style/StringLiterals

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

  self.origin_auth_secret_key_nonce_b = attributes[:'origin_auth_secret_key_nonce_b'] if attributes[:'origin_auth_secret_key_nonce_b']
  self.origin_auth_secret_key_nonce_b = "nonceKeyB" if origin_auth_secret_key_nonce_b.nil? && !attributes.key?(:'originAuthSecretKeyNonceB') && !attributes.key?(:'origin_auth_secret_key_nonce_b') # rubocop:disable Style/StringLiterals

  self.edge_hostname = attributes[:'edgeHostname'] if attributes[:'edgeHostname']

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

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

  self.edge_path_prefix = attributes[:'edgePathPrefix'] if attributes[:'edgePathPrefix']

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

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

  self.is_edge_token_auth = attributes[:'isEdgeTokenAuth'] unless attributes[:'isEdgeTokenAuth'].nil?

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

  self.is_edge_token_auth = attributes[:'is_edge_token_auth'] unless attributes[:'is_edge_token_auth'].nil?

  self.edge_token_key = attributes[:'edgeTokenKey'] if attributes[:'edgeTokenKey']

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

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

  self.edge_token_salt = attributes[:'edgeTokenSalt'] if attributes[:'edgeTokenSalt']

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

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

Instance Attribute Details

#edge_hostnameString

The hostname of the CDN edge server to use when building CDN URLs.

Returns:

  • (String)


49
50
51
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 49

def edge_hostname
  @edge_hostname
end

#edge_path_prefixString

The path to prepend when building CDN URLs.

Returns:

  • (String)


53
54
55
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 53

def edge_path_prefix
  @edge_path_prefix
end

#edge_token_keyString

The encryption key to use for edge token authentication.

Returns:

  • (String)


61
62
63
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 61

def edge_token_key
  @edge_token_key
end

#edge_token_saltString

Salt to use when encrypting authentication token.

Returns:

  • (String)


65
66
67
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 65

def edge_token_salt
  @edge_token_salt
end

#is_edge_token_authBOOLEAN

Whether token authentication should be used at the CDN edge.

Returns:

  • (BOOLEAN)


57
58
59
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 57

def is_edge_token_auth
  @is_edge_token_auth
end

#origin_auth_secret_key_aString

The shared secret key A, two for errorless key rotation.

Returns:

  • (String)


33
34
35
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 33

def origin_auth_secret_key_a
  @origin_auth_secret_key_a
end

#origin_auth_secret_key_bString

The shared secret key B, two for errorless key rotation.

Returns:

  • (String)


41
42
43
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 41

def origin_auth_secret_key_b
  @origin_auth_secret_key_b
end

#origin_auth_secret_key_nonce_aString

Nonce identifier for originAuthSecretKeyA (used to determine key used to sign).

Returns:

  • (String)


37
38
39
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 37

def origin_auth_secret_key_nonce_a
  @origin_auth_secret_key_nonce_a
end

#origin_auth_secret_key_nonce_bString

Nonce identifier for originAuthSecretKeyB (used to determine key used to sign).

Returns:

  • (String)


45
46
47
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 45

def origin_auth_secret_key_nonce_b
  @origin_auth_secret_key_nonce_b
end

#origin_auth_sign_encryptionString

The type of encryption used to compute the signature.

Returns:

  • (String)


29
30
31
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 29

def origin_auth_sign_encryption
  @origin_auth_sign_encryption
end

#origin_auth_sign_typeString

The type of data used to compute the signature.

Returns:

  • (String)


25
26
27
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 25

def origin_auth_sign_type
  @origin_auth_sign_type
end

Class Method Details

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 68

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'type',
    'origin_auth_sign_type': :'originAuthSignType',
    'origin_auth_sign_encryption': :'originAuthSignEncryption',
    'origin_auth_secret_key_a': :'originAuthSecretKeyA',
    'origin_auth_secret_key_nonce_a': :'originAuthSecretKeyNonceA',
    'origin_auth_secret_key_b': :'originAuthSecretKeyB',
    'origin_auth_secret_key_nonce_b': :'originAuthSecretKeyNonceB',
    'edge_hostname': :'edgeHostname',
    'edge_path_prefix': :'edgePathPrefix',
    'is_edge_token_auth': :'isEdgeTokenAuth',
    'edge_token_key': :'edgeTokenKey',
    'edge_token_salt': :'edgeTokenSalt'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 88

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type': :'String',
    'origin_auth_sign_type': :'String',
    'origin_auth_sign_encryption': :'String',
    'origin_auth_secret_key_a': :'String',
    'origin_auth_secret_key_nonce_a': :'String',
    'origin_auth_secret_key_b': :'String',
    'origin_auth_secret_key_nonce_b': :'String',
    'edge_hostname': :'String',
    'edge_path_prefix': :'String',
    'is_edge_token_auth': :'BOOLEAN',
    'edge_token_key': :'String',
    'edge_token_salt': :'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



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 242

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

  self.class == other.class &&
    type == other.type &&
    origin_auth_sign_type == other.origin_auth_sign_type &&
    origin_auth_sign_encryption == other.origin_auth_sign_encryption &&
    origin_auth_secret_key_a == other.origin_auth_secret_key_a &&
    origin_auth_secret_key_nonce_a == other.origin_auth_secret_key_nonce_a &&
    origin_auth_secret_key_b == other.origin_auth_secret_key_b &&
    origin_auth_secret_key_nonce_b == other.origin_auth_secret_key_nonce_b &&
    edge_hostname == other.edge_hostname &&
    edge_path_prefix == other.edge_path_prefix &&
    is_edge_token_auth == other.is_edge_token_auth &&
    edge_token_key == other.edge_token_key &&
    edge_token_salt == other.edge_token_salt
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



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 283

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


263
264
265
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 263

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



272
273
274
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 272

def hash
  [type, origin_auth_sign_type, origin_auth_sign_encryption, origin_auth_secret_key_a, origin_auth_secret_key_nonce_a, origin_auth_secret_key_b, origin_auth_secret_key_nonce_b, edge_hostname, edge_path_prefix, is_edge_token_auth, edge_token_key, edge_token_salt].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



316
317
318
319
320
321
322
323
324
325
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 316

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



310
311
312
# File 'lib/oci/media_services/models/akamai_manual_stream_cdn_config.rb', line 310

def to_s
  to_hash.to_s
end