Class: Hook0::Generated::Subscription
- Inherits:
-
Object
- Object
- Hook0::Generated::Subscription
- Defined in:
- lib/hook0/generated/models.rb
Overview
The Subscription the API declares.
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#dedicated_workers ⇒ Object
readonly
Returns the value of attribute dedicated_workers.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#event_types ⇒ Object
readonly
Returns the value of attribute event_types.
-
#is_enabled ⇒ Object
readonly
Returns the value of attribute is_enabled.
-
#label_key ⇒ Object
readonly
Returns the value of attribute label_key.
-
#label_value ⇒ Object
readonly
Returns the value of attribute label_value.
-
#labels ⇒ Object
readonly
Returns the value of attribute labels.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#subscription_id ⇒ Object
readonly
Returns the value of attribute subscription_id.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.from_json(value) ⇒ Subscription
Read one out of what the API answered.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Whether that value carries the same members as this one.
-
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
-
#initialize(application_id:, created_at:, dedicated_workers:, event_types:, is_enabled:, label_key:, label_value:, labels:, metadata:, secret:, subscription_id:, target:, updated_at:, description: nil) ⇒ Subscription
constructor
A new instance of Subscription.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(application_id:, created_at:, dedicated_workers:, event_types:, is_enabled:, label_key:, label_value:, labels:, metadata:, secret:, subscription_id:, target:, updated_at:, description: nil) ⇒ Subscription
Returns a new instance of Subscription.
2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 |
# File 'lib/hook0/generated/models.rb', line 2769 def initialize( application_id:, created_at:, dedicated_workers:, event_types:, is_enabled:, label_key:, label_value:, labels:, metadata:, secret:, subscription_id:, target:, updated_at:, description: nil ) @application_id = application_id @created_at = created_at @dedicated_workers = dedicated_workers @event_types = event_types @is_enabled = is_enabled @label_key = label_key @label_value = label_value @labels = labels @metadata = @secret = secret @subscription_id = subscription_id @target = target @updated_at = updated_at @description = description freeze end |
Instance Attribute Details
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def application_id @application_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def created_at @created_at end |
#dedicated_workers ⇒ Object (readonly)
Returns the value of attribute dedicated_workers.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def dedicated_workers @dedicated_workers end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def description @description end |
#event_types ⇒ Object (readonly)
Returns the value of attribute event_types.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def event_types @event_types end |
#is_enabled ⇒ Object (readonly)
Returns the value of attribute is_enabled.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def is_enabled @is_enabled end |
#label_key ⇒ Object (readonly)
Returns the value of attribute label_key.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def label_key @label_key end |
#label_value ⇒ Object (readonly)
Returns the value of attribute label_value.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def label_value @label_value end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def labels @labels end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def @metadata end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def secret @secret end |
#subscription_id ⇒ Object (readonly)
Returns the value of attribute subscription_id.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def subscription_id @subscription_id end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def target @target end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
2740 2741 2742 |
# File 'lib/hook0/generated/models.rb', line 2740 def updated_at @updated_at end |
Class Method Details
.from_json(value) ⇒ Subscription
Read one out of what the API answered.
2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 |
# File 'lib/hook0/generated/models.rb', line 2806 def self.from_json(value) fields = Runtime.as_fields(value, "Subscription") new( application_id: Runtime.read(fields, "application_id", Runtime::UUID), created_at: Runtime.read(fields, "created_at", Runtime::DATE_TIME), dedicated_workers: Runtime.read(fields, "dedicated_workers", Runtime.list(Runtime::TEXT)), event_types: Runtime.read(fields, "event_types", Runtime.list(Runtime::TEXT)), is_enabled: Runtime.read(fields, "is_enabled", Runtime::BOOLEAN), label_key: Runtime.read(fields, "label_key", Runtime::TEXT), label_value: Runtime.read(fields, "label_value", Runtime::TEXT), labels: Runtime.read(fields, "labels", Runtime.map(Runtime::TEXT)), metadata: Runtime.read(fields, "metadata", Runtime.map(Runtime::TEXT)), secret: Runtime.read(fields, "secret", Runtime::UUID), subscription_id: Runtime.read(fields, "subscription_id", Runtime::UUID), target: Runtime.read(fields, "target", SubscriptionTarget.method(:from_json)), updated_at: Runtime.read(fields, "updated_at", Runtime::DATE_TIME), description: Runtime.maybe(fields, "description", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2852 2853 2854 |
# File 'lib/hook0/generated/models.rb', line 2852 def ==(other) other.is_a?(Subscription) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2860 2861 2862 |
# File 'lib/hook0/generated/models.rb', line 2860 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 |
# File 'lib/hook0/generated/models.rb', line 2829 def to_h out = {} out["application_id"] = @application_id out["created_at"] = Runtime.moment(@created_at) out["dedicated_workers"] = @dedicated_workers out["event_types"] = @event_types out["is_enabled"] = @is_enabled out["label_key"] = @label_key out["label_value"] = @label_value out["labels"] = @labels out["metadata"] = @metadata out["secret"] = @secret out["subscription_id"] = @subscription_id out["target"] = @target.to_h out["updated_at"] = Runtime.moment(@updated_at) out["description"] = @description unless @description.nil? out end |