Class: Svix::ConnectorOut

Inherits:
Object
  • Object
show all
Defined in:
lib/svix/models/connector_out.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ConnectorOut

Returns a new instance of ConnectorOut.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/svix/models/connector_out.rb', line 43

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::ConnectorOut` new method")
  end

  attributes.each do |k, v|
    unless ALL_FIELD.include?(k.to_s)
      fail(ArgumentError, "The field #{k} is not part of Svix::ConnectorOut")
    end

    instance_variable_set("@#{k}", v)
    instance_variable_set("@__#{k}_is_defined", true)
  end
end

Instance Attribute Details

#allowed_event_typesObject

Returns the value of attribute allowed_event_types.



7
8
9
# File 'lib/svix/models/connector_out.rb', line 7

def allowed_event_types
  @allowed_event_types
end

#created_atObject

Returns the value of attribute created_at.



8
9
10
# File 'lib/svix/models/connector_out.rb', line 8

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/svix/models/connector_out.rb', line 9

def description
  @description
end

#feature_flagsObject

Returns the value of attribute feature_flags.



10
11
12
# File 'lib/svix/models/connector_out.rb', line 10

def feature_flags
  @feature_flags
end

#idObject

The Connector’s ID.



12
13
14
# File 'lib/svix/models/connector_out.rb', line 12

def id
  @id
end

#instructionsObject

Returns the value of attribute instructions.



13
14
15
# File 'lib/svix/models/connector_out.rb', line 13

def instructions
  @instructions
end

#kindObject

Returns the value of attribute kind.



14
15
16
# File 'lib/svix/models/connector_out.rb', line 14

def kind
  @kind
end

#logoObject

Returns the value of attribute logo.



15
16
17
# File 'lib/svix/models/connector_out.rb', line 15

def 
  @logo
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/svix/models/connector_out.rb', line 16

def name
  @name
end

#org_idObject

The Environment’s ID.



18
19
20
# File 'lib/svix/models/connector_out.rb', line 18

def org_id
  @org_id
end

#product_typeObject

Returns the value of attribute product_type.



19
20
21
# File 'lib/svix/models/connector_out.rb', line 19

def product_type
  @product_type
end

#transformationObject

Returns the value of attribute transformation.



20
21
22
# File 'lib/svix/models/connector_out.rb', line 20

def transformation
  @transformation
end

#uidObject

The Connector’s UID.



22
23
24
# File 'lib/svix/models/connector_out.rb', line 22

def uid
  @uid
end

#updated_atObject

Returns the value of attribute updated_at.



23
24
25
# File 'lib/svix/models/connector_out.rb', line 23

def updated_at
  @updated_at
end

Class Method Details

.deserialize(attributes = {}) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/svix/models/connector_out.rb', line 58

def self.deserialize(attributes = {})
  attributes = attributes.transform_keys(&:to_s)
  attrs = Hash.new
  attrs["allowed_event_types"] = attributes["allowedEventTypes"]
  attrs["created_at"] = DateTime.rfc3339(attributes["createdAt"]).to_time
  attrs["description"] = attributes["description"]
  attrs["feature_flags"] = attributes["featureFlags"]
  attrs["id"] = attributes["id"]
  attrs["instructions"] = attributes["instructions"]
  attrs["kind"] = Svix::ConnectorKind.deserialize(attributes["kind"])
  attrs["logo"] = attributes["logo"]
  attrs["name"] = attributes["name"]
  attrs["org_id"] = attributes["orgId"]
  attrs["product_type"] = Svix::ConnectorProduct.deserialize(attributes["productType"])
  attrs["transformation"] = attributes["transformation"]
  attrs["uid"] = attributes["uid"]
  attrs["updated_at"] = DateTime.rfc3339(attributes["updatedAt"]).to_time
  new(attrs)
end

Instance Method Details

#serializeObject



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/svix/models/connector_out.rb', line 78

def serialize
  out = Hash.new
  out["allowedEventTypes"] = Svix::serialize_primitive(@allowed_event_types) if @allowed_event_types
  out["createdAt"] = Svix::serialize_primitive(@created_at) if @created_at
  out["description"] = Svix::serialize_primitive(@description) if @description
  out["featureFlags"] = Svix::serialize_primitive(@feature_flags) if @feature_flags
  out["id"] = Svix::serialize_primitive(@id) if @id
  out["instructions"] = Svix::serialize_primitive(@instructions) if @instructions
  out["kind"] = Svix::serialize_schema_ref(@kind) if @kind
  out["logo"] = Svix::serialize_primitive(@logo) if @logo
  out["name"] = Svix::serialize_primitive(@name) if @name
  out["orgId"] = Svix::serialize_primitive(@org_id) if @org_id
  out["productType"] = Svix::serialize_schema_ref(@product_type) if @product_type
  out["transformation"] = Svix::serialize_primitive(@transformation) if @transformation
  out["uid"] = Svix::serialize_primitive(@uid) if @uid
  out["updatedAt"] = Svix::serialize_primitive(@updated_at) if @updated_at
  out
end

#to_jsonObject

Serializes the object to a json string

Returns:

  • String



99
100
101
# File 'lib/svix/models/connector_out.rb', line 99

def to_json
  JSON.dump(serialize)
end