Class: Vapi::AzureBlobStorageBucketPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection_string:, container_name:, path: OMIT, additional_properties: nil) ⇒ Vapi::AzureBlobStorageBucketPlan



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 37

def initialize(connection_string:, container_name:, path: OMIT, additional_properties: nil)
  @connection_string = connection_string
  @container_name = container_name
  @path = path if path != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "connectionString": connection_string,
    "containerName": container_name,
    "path": path
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)



20
21
22
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 20

def additional_properties
  @additional_properties
end

#connection_stringString (readonly)



9
10
11
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 9

def connection_string
  @connection_string
end

#container_nameString (readonly)



11
12
13
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 11

def container_name
  @container_name
end

#pathString (readonly)



18
19
20
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 18

def path
  @path
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::AzureBlobStorageBucketPlan

Deserialize a JSON object to an instance of AzureBlobStorageBucketPlan



55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 55

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  connection_string = parsed_json["connectionString"]
  container_name = parsed_json["containerName"]
  path = parsed_json["path"]
  new(
    connection_string: connection_string,
    container_name: container_name,
    path: path,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given

hash and check each fields type against the current object's property
definitions.


82
83
84
85
86
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 82

def self.validate_raw(obj:)
  obj.connection_string.is_a?(String) != false || raise("Passed value for field obj.connection_string is not the expected type, validation failed.")
  obj.container_name.is_a?(String) != false || raise("Passed value for field obj.container_name is not the expected type, validation failed.")
  obj.path&.is_a?(String) != false || raise("Passed value for field obj.path is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AzureBlobStorageBucketPlan to a JSON object



72
73
74
# File 'lib/vapi_server_sdk/types/azure_blob_storage_bucket_plan.rb', line 72

def to_json(*_args)
  @_field_set&.to_json
end