Class: Hook0::Generated::SubscriptionPost
- Inherits:
-
Object
- Object
- Hook0::Generated::SubscriptionPost
- Defined in:
- lib/hook0/generated/models.rb
Overview
The SubscriptionPost the API declares.
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#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.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Class Method Summary collapse
-
.from_json(value) ⇒ SubscriptionPost
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:, event_types:, is_enabled:, target:, dedicated_workers: nil, description: nil, label_key: nil, label_value: nil, labels: nil, metadata: nil) ⇒ SubscriptionPost
constructor
A new instance of SubscriptionPost.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(application_id:, event_types:, is_enabled:, target:, dedicated_workers: nil, description: nil, label_key: nil, label_value: nil, labels: nil, metadata: nil) ⇒ SubscriptionPost
Returns a new instance of SubscriptionPost.
2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 |
# File 'lib/hook0/generated/models.rb', line 2889 def initialize( application_id:, event_types:, is_enabled:, target:, dedicated_workers: nil, description: nil, label_key: nil, label_value: nil, labels: nil, metadata: nil ) @application_id = application_id @event_types = event_types @is_enabled = is_enabled @target = target @dedicated_workers = dedicated_workers @description = description @label_key = label_key @label_value = label_value @labels = labels @metadata = freeze end |
Instance Attribute Details
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def application_id @application_id end |
#dedicated_workers ⇒ Object (readonly)
Returns the value of attribute dedicated_workers.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def dedicated_workers @dedicated_workers end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def description @description end |
#event_types ⇒ Object (readonly)
Returns the value of attribute event_types.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def event_types @event_types end |
#is_enabled ⇒ Object (readonly)
Returns the value of attribute is_enabled.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def is_enabled @is_enabled end |
#label_key ⇒ Object (readonly)
Returns the value of attribute label_key.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def label_key @label_key end |
#label_value ⇒ Object (readonly)
Returns the value of attribute label_value.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def label_value @label_value end |
#labels ⇒ Object (readonly)
Returns the value of attribute labels.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def labels @labels end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def @metadata end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
2867 2868 2869 |
# File 'lib/hook0/generated/models.rb', line 2867 def target @target end |
Class Method Details
.from_json(value) ⇒ SubscriptionPost
Read one out of what the API answered.
2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 |
# File 'lib/hook0/generated/models.rb', line 2918 def self.from_json(value) fields = Runtime.as_fields(value, "SubscriptionPost") new( application_id: Runtime.read(fields, "application_id", Runtime::UUID), event_types: Runtime.read(fields, "event_types", Runtime.list(Runtime::TEXT)), is_enabled: Runtime.read(fields, "is_enabled", Runtime::BOOLEAN), target: Runtime.read(fields, "target", SubscriptionPostTarget.method(:from_json)), dedicated_workers: Runtime.maybe(fields, "dedicated_workers", Runtime.list(Runtime::TEXT)), description: Runtime.maybe(fields, "description", Runtime::TEXT), label_key: Runtime.maybe(fields, "label_key", Runtime::TEXT), label_value: Runtime.maybe(fields, "label_value", Runtime::TEXT), labels: Runtime.maybe(fields, "labels", Runtime.map(Runtime::TEXT)), metadata: Runtime.maybe(fields, "metadata", Runtime.map(Runtime::TEXT)) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2956 2957 2958 |
# File 'lib/hook0/generated/models.rb', line 2956 def ==(other) other.is_a?(SubscriptionPost) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2964 2965 2966 |
# File 'lib/hook0/generated/models.rb', line 2964 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 |
# File 'lib/hook0/generated/models.rb', line 2937 def to_h out = {} out["application_id"] = @application_id out["event_types"] = @event_types out["is_enabled"] = @is_enabled out["target"] = @target.to_h out["dedicated_workers"] = @dedicated_workers unless @dedicated_workers.nil? out["description"] = @description unless @description.nil? out["label_key"] = @label_key unless @label_key.nil? out["label_value"] = @label_value unless @label_value.nil? out["labels"] = @labels unless @labels.nil? out["metadata"] = @metadata unless @metadata.nil? out end |