Sha256: def4b9eb475fb17ab278dda0ac87070023ae56b0d0d2490a3a6a1fc75d4b0c3e
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
# -*- encoding: utf-8 -*- module SendGrid4r::REST module MarketingCampaigns module Contacts # # SendGrid Web API v3 Contacts - Reserved Fields # module ReservedFields include Request Field = Struct.new(:name, :type) do def eql?(other) name.eql?(other.name) end def hash name.hash end end Fields = Struct.new(:reserved_fields) def self.create_fields(resp) return resp if resp.nil? reserved_fields = resp['reserved_fields'].map do |field| Contacts::ReservedFields.create_field(field) end Fields.new(reserved_fields) end def self.create_field(resp) return resp if resp.nil? Field.new(resp['name'], resp['type']) end def get_reserved_fields(&block) resp = get(@auth, "#{BASE_URL}/contactdb/reserved_fields", &block) Contacts::ReservedFields.create_fields(resp) end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sendgrid4r-1.11.0 | lib/sendgrid4r/rest/marketing_campaigns/contacts/reserved_fields.rb |
sendgrid4r-1.10.0 | lib/sendgrid4r/rest/marketing_campaigns/contacts/reserved_fields.rb |