Class: ApolloDeploySignalSdk::ApiKeyUsageRecord
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::ApiKeyUsageRecord
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: ApiKeyUsageRecord
Instance Attribute Summary collapse
- #duration_ms ⇒ Integer?
- #id ⇒ String
- #ip ⇒ String?
- #key_id ⇒ String
- #method ⇒ String
- #org_id ⇒ String
- #route ⇒ String
- #status_code ⇒ Integer
- #ts ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ ApiKeyUsageRecord
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(id:, key_id:, org_id:, method:, route:, status_code:, duration_ms:, ip:, ts:) ⇒ ApiKeyUsageRecord
constructor
A new instance of ApiKeyUsageRecord.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(id:, key_id:, org_id:, method:, route:, status_code:, duration_ms:, ip:, ts:) ⇒ ApiKeyUsageRecord
Returns a new instance of ApiKeyUsageRecord.
3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3809 def initialize(id: , key_id: , org_id: , method: , route: , status_code: , duration_ms: , ip: , ts: ) @id = id @key_id = key_id @org_id = org_id @method = method @route = route @status_code = status_code @duration_ms = duration_ms @ip = ip @ts = ts end |
Instance Attribute Details
#duration_ms ⇒ Integer?
3802 3803 3804 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3802 def duration_ms @duration_ms end |
#id ⇒ String
3790 3791 3792 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3790 def id @id end |
#ip ⇒ String?
3804 3805 3806 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3804 def ip @ip end |
#key_id ⇒ String
3792 3793 3794 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3792 def key_id @key_id end |
#method ⇒ String
3796 3797 3798 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3796 def method @method end |
#org_id ⇒ String
3794 3795 3796 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3794 def org_id @org_id end |
#route ⇒ String
3798 3799 3800 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3798 def route @route end |
#status_code ⇒ Integer
3800 3801 3802 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3800 def status_code @status_code end |
#ts ⇒ String
3806 3807 3808 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3806 def ts @ts end |
Class Method Details
.from_json(attributes) ⇒ ApiKeyUsageRecord
Create an instance from a parsed JSON hash.
3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3839 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( id: attributes.key?("id") ? attributes["id"] : attributes[:id], key_id: attributes.key?("keyId") ? attributes["keyId"] : attributes[:key_id], org_id: attributes.key?("orgId") ? attributes["orgId"] : attributes[:org_id], method: attributes.key?("method") ? attributes["method"] : attributes[:method], route: attributes.key?("route") ? attributes["route"] : attributes[:route], status_code: attributes.key?("statusCode") ? attributes["statusCode"] : attributes[:status_code], duration_ms: attributes.key?("durationMs") ? attributes["durationMs"] : attributes[:duration_ms], ip: attributes.key?("ip") ? attributes["ip"] : attributes[:ip], ts: attributes.key?("ts") ? attributes["ts"] : attributes[:ts], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3822 def to_h { id: @id, key_id: @key_id, org_id: @org_id, method: @method, route: @route, status_code: @status_code, duration_ms: @duration_ms, ip: @ip, ts: @ts, }.compact end |