Class: NgrokAPI::Models::KubernetesOperator

Inherits:
Object
  • Object
show all
Defined in:
lib/ngrokapi/models/kubernetes_operator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, attrs: {}) ⇒ KubernetesOperator

Returns a new instance of KubernetesOperator.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 24

def initialize(client: nil, attrs: {})
  @client = client
  @attrs = attrs
  @id = @attrs['id']
  unless @attrs['uri'].nil?
    @uri = URI(@attrs['uri'])
  end
  @created_at = @attrs['created_at']
  @updated_at = @attrs['updated_at']
  @description = @attrs['description']
  @metadata = @attrs['metadata']
  @principal = @attrs['principal']
  @enabled_features = @attrs['enabled_features']
  @region = @attrs['region']
  @deployment = @attrs['deployment']
  @binding = @attrs['binding']
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def attrs
  @attrs
end

#bindingObject (readonly)

Returns the value of attribute binding.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def binding
  @binding
end

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def client
  @client
end

#created_atObject (readonly)

Returns the value of attribute created_at.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def created_at
  @created_at
end

#deploymentObject (readonly)

Returns the value of attribute deployment.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def deployment
  @deployment
end

#descriptionObject (readonly)

Returns the value of attribute description.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def description
  @description
end

#enabled_featuresObject (readonly)

Returns the value of attribute enabled_features.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def enabled_features
  @enabled_features
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def 
  @metadata
end

#principalObject (readonly)

Returns the value of attribute principal.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def principal
  @principal
end

#regionObject (readonly)

Returns the value of attribute region.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def region
  @region
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def updated_at
  @updated_at
end

#uriObject (readonly)

Returns the value of attribute uri.



10
11
12
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 10

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object



42
43
44
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 42

def ==(other)
  @attrs == other.attrs
end

#deleteObject



87
88
89
90
91
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 87

def delete
  @client.delete(
    id: @id
  )
end

#to_hObject



50
51
52
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 50

def to_h
  @attrs.to_h
end

#to_sObject



46
47
48
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 46

def to_s
  @attrs.to_s
end

#update(description: nil, metadata: nil, enabled_features: nil, region: nil, binding: nil, deployment: nil) ⇒ Object

Update an existing Kubernetes operator by ID.

ngrok.com/docs/api#api-kubernetes-operators-update



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/ngrokapi/models/kubernetes_operator.rb', line 58

def update(
  description: nil,
  metadata: nil,
  enabled_features: nil,
  region: nil,
  binding: nil,
  deployment: nil
)
  @description = description if description
  @metadata =  if 
  @enabled_features = enabled_features if enabled_features
  @region = region if region
  @binding = binding if binding
  @deployment = deployment if deployment
  @client.update(
    id: @id,
    description: description,
    metadata: ,
    enabled_features: enabled_features,
    region: region,
    binding: binding,
    deployment: deployment
  )
end