Class: Svix::ConnectorIn

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ConnectorIn

Returns a new instance of ConnectorIn.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/svix/models/connector_in.rb', line 33

def initialize(attributes = {})
  unless attributes.is_a?(Hash)
    fail(ArgumentError, "The input argument (attributes) must be a hash in `Svix::ConnectorIn` 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::ConnectorIn")
    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_in.rb', line 7

def allowed_event_types
  @allowed_event_types
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#feature_flagsObject

Returns the value of attribute feature_flags.



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

def feature_flags
  @feature_flags
end

#instructionsObject

Returns the value of attribute instructions.



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

def instructions
  @instructions
end

#kindObject

Returns the value of attribute kind.



11
12
13
# File 'lib/svix/models/connector_in.rb', line 11

def kind
  @kind
end

#logoObject

Returns the value of attribute logo.



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

def 
  
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#product_typeObject

Returns the value of attribute product_type.



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

def product_type
  @product_type
end

#transformationObject

Returns the value of attribute transformation.



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

def transformation
  @transformation
end

#uidObject

The Connector’s UID.



17
18
19
# File 'lib/svix/models/connector_in.rb', line 17

def uid
  @uid
end

Class Method Details

.deserialize(attributes = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/svix/models/connector_in.rb', line 48

def self.deserialize(attributes = {})
  attributes = attributes.transform_keys(&:to_s)
  attrs = Hash.new
  attrs["allowed_event_types"] = attributes["allowedEventTypes"]
  attrs["description"] = attributes["description"]
  attrs["feature_flags"] = attributes["featureFlags"]
  attrs["instructions"] = attributes["instructions"]
  attrs["kind"] = Svix::ConnectorKind.deserialize(attributes["kind"]) if attributes["kind"]
  attrs["logo"] = attributes["logo"]
  attrs["name"] = attributes["name"]
  if attributes["productType"]
    attrs["product_type"] = Svix::ConnectorProduct.deserialize(attributes["productType"])
  end

  attrs["transformation"] = attributes["transformation"]
  attrs["uid"] = attributes["uid"]
  new(attrs)
end

Instance Method Details

#serializeObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/svix/models/connector_in.rb', line 67

def serialize
  out = Hash.new
  out["allowedEventTypes"] = Svix::serialize_primitive(@allowed_event_types) if @allowed_event_types
  out["description"] = Svix::serialize_primitive(@description) if @description
  out["featureFlags"] = Svix::serialize_primitive(@feature_flags) if @feature_flags
  out["instructions"] = Svix::serialize_primitive(@instructions) if @instructions
  out["kind"] = Svix::serialize_schema_ref(@kind) if @kind
  out["logo"] = Svix::serialize_primitive() if 
  out["name"] = Svix::serialize_primitive(@name) if @name
  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
end

#to_jsonObject

Serializes the object to a json string

Returns:

  • String



84
85
86
# File 'lib/svix/models/connector_in.rb', line 84

def to_json
  JSON.dump(serialize)
end