constantcontact-ruby 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +2 -0
- data/README.md +136 -0
- data/constantcontact-ruby.gemspec +31 -0
- data/lib/constantcontact/api.rb +1012 -0
- data/lib/constantcontact/auth/oauth2.rb +105 -0
- data/lib/constantcontact/auth/session_data_store.rb +69 -0
- data/lib/constantcontact/components/account/account_address.rb +26 -0
- data/lib/constantcontact/components/account/account_info.rb +38 -0
- data/lib/constantcontact/components/account/verified_email_address.rb +26 -0
- data/lib/constantcontact/components/activities/activity.rb +43 -0
- data/lib/constantcontact/components/activities/activity_error.rb +26 -0
- data/lib/constantcontact/components/activities/add_contacts.rb +127 -0
- data/lib/constantcontact/components/activities/add_contacts_import_data.rb +46 -0
- data/lib/constantcontact/components/activities/export_contacts.rb +30 -0
- data/lib/constantcontact/components/component.rb +48 -0
- data/lib/constantcontact/components/contacts/address.rb +27 -0
- data/lib/constantcontact/components/contacts/contact.rb +92 -0
- data/lib/constantcontact/components/contacts/contact_list.rb +26 -0
- data/lib/constantcontact/components/contacts/custom_field.rb +26 -0
- data/lib/constantcontact/components/contacts/email_address.rb +33 -0
- data/lib/constantcontact/components/contacts/note.rb +26 -0
- data/lib/constantcontact/components/email_marketing/campaign.rb +83 -0
- data/lib/constantcontact/components/email_marketing/campaign_preview.rb +29 -0
- data/lib/constantcontact/components/email_marketing/click_through_details.rb +27 -0
- data/lib/constantcontact/components/email_marketing/message_footer.rb +29 -0
- data/lib/constantcontact/components/email_marketing/schedule.rb +27 -0
- data/lib/constantcontact/components/email_marketing/test_send.rb +45 -0
- data/lib/constantcontact/components/event_spot/contact.rb +27 -0
- data/lib/constantcontact/components/event_spot/event.rb +69 -0
- data/lib/constantcontact/components/event_spot/event_address.rb +29 -0
- data/lib/constantcontact/components/event_spot/event_fee.rb +27 -0
- data/lib/constantcontact/components/event_spot/event_item.rb +36 -0
- data/lib/constantcontact/components/event_spot/event_item_attribute.rb +26 -0
- data/lib/constantcontact/components/event_spot/event_track.rb +31 -0
- data/lib/constantcontact/components/event_spot/guest.rb +31 -0
- data/lib/constantcontact/components/event_spot/guest_section.rb +34 -0
- data/lib/constantcontact/components/event_spot/notification_option.rb +27 -0
- data/lib/constantcontact/components/event_spot/online_meeting.rb +28 -0
- data/lib/constantcontact/components/event_spot/payment_address.rb +29 -0
- data/lib/constantcontact/components/event_spot/payment_summary.rb +33 -0
- data/lib/constantcontact/components/event_spot/promocode.rb +25 -0
- data/lib/constantcontact/components/event_spot/registrant.rb +52 -0
- data/lib/constantcontact/components/event_spot/registrant_fee.rb +29 -0
- data/lib/constantcontact/components/event_spot/registrant_field.rb +27 -0
- data/lib/constantcontact/components/event_spot/registrant_order.rb +39 -0
- data/lib/constantcontact/components/event_spot/registrant_promo_code.rb +31 -0
- data/lib/constantcontact/components/event_spot/registrant_promo_code_info.rb +27 -0
- data/lib/constantcontact/components/event_spot/registrant_section.rb +34 -0
- data/lib/constantcontact/components/event_spot/sale_item.rb +29 -0
- data/lib/constantcontact/components/library/file/library_file.rb +27 -0
- data/lib/constantcontact/components/library/folder/library_folder.rb +26 -0
- data/lib/constantcontact/components/library/info/library_summary.rb +26 -0
- data/lib/constantcontact/components/library/info/move_results.rb +26 -0
- data/lib/constantcontact/components/library/info/upload_status.rb +26 -0
- data/lib/constantcontact/components/result_set.rb +50 -0
- data/lib/constantcontact/components/tracking/bounce_activity.rb +28 -0
- data/lib/constantcontact/components/tracking/click_activity.rb +26 -0
- data/lib/constantcontact/components/tracking/forward_activity.rb +26 -0
- data/lib/constantcontact/components/tracking/open_activity.rb +26 -0
- data/lib/constantcontact/components/tracking/send_activity.rb +27 -0
- data/lib/constantcontact/components/tracking/tracking_activity.rb +26 -0
- data/lib/constantcontact/components/tracking/tracking_summary.rb +27 -0
- data/lib/constantcontact/components/tracking/unsubscribe_activity.rb +27 -0
- data/lib/constantcontact/exceptions/ctct_exception.rb +25 -0
- data/lib/constantcontact/exceptions/illegal_argument_exception.rb +11 -0
- data/lib/constantcontact/exceptions/oauth2_exception.rb +11 -0
- data/lib/constantcontact/exceptions/webhooks_exception.rb +11 -0
- data/lib/constantcontact/services/account_service.rb +39 -0
- data/lib/constantcontact/services/activity_service.rb +136 -0
- data/lib/constantcontact/services/base_service.rb +68 -0
- data/lib/constantcontact/services/campaign_schedule_service.rb +101 -0
- data/lib/constantcontact/services/campaign_tracking_service.rb +152 -0
- data/lib/constantcontact/services/contact_service.rb +105 -0
- data/lib/constantcontact/services/contact_tracking_service.rb +152 -0
- data/lib/constantcontact/services/email_marketing_service.rb +94 -0
- data/lib/constantcontact/services/event_spot_service.rb +448 -0
- data/lib/constantcontact/services/library_service.rb +281 -0
- data/lib/constantcontact/services/list_service.rb +81 -0
- data/lib/constantcontact/util/config.rb +180 -0
- data/lib/constantcontact/util/helpers.rb +27 -0
- data/lib/constantcontact/version.rb +12 -0
- data/lib/constantcontact/webhooks/helpers/validator.rb +30 -0
- data/lib/constantcontact/webhooks/models/billing_change_notification.rb +27 -0
- data/lib/constantcontact/webhooks/webhooks_util.rb +45 -0
- data/lib/constantcontact.rb +124 -0
- data/spec/constantcontact/api_spec.rb +1560 -0
- data/spec/constantcontact/auth/oauth2_spec.rb +125 -0
- data/spec/constantcontact/components/contacts/address_spec.rb +18 -0
- data/spec/constantcontact/components/contacts/contact_list_spec.rb +18 -0
- data/spec/constantcontact/components/contacts/contact_spec.rb +18 -0
- data/spec/constantcontact/components/contacts/custom_field_spec.rb +18 -0
- data/spec/constantcontact/components/contacts/email_address_spec.rb +18 -0
- data/spec/constantcontact/sdk_spec.rb +24 -0
- data/spec/constantcontact/services/account_service_spec.rb +46 -0
- data/spec/constantcontact/services/activity_service_spec.rb +244 -0
- data/spec/constantcontact/services/base_service_spec.rb +50 -0
- data/spec/constantcontact/services/campaign_schedule_service_spec.rb +115 -0
- data/spec/constantcontact/services/campaign_tracking_service_spec.rb +131 -0
- data/spec/constantcontact/services/contact_service_spec.rb +111 -0
- data/spec/constantcontact/services/contact_tracking_service_spec.rb +131 -0
- data/spec/constantcontact/services/email_marketing_spec.rb +100 -0
- data/spec/constantcontact/services/event_spot_spec.rb +423 -0
- data/spec/constantcontact/services/library_service_spec.rb +252 -0
- data/spec/constantcontact/services/list_service_spec.rb +89 -0
- data/spec/constantcontact/webhooks/webhooks_spec.rb +26 -0
- metadata +243 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# event_track.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class EventTrack < Component
|
11
|
+
attr_accessor :early_fee_date, :guest_display_label, :guest_limit, :information_sections,
|
12
|
+
:is_guest_anonymous_enabled, :is_guest_name_required, :is_registration_closed_manually,
|
13
|
+
:is_ticketing_link_displayed, :late_fee_date, :registration_limit_count,
|
14
|
+
:registration_limit_date
|
15
|
+
|
16
|
+
# Factory method to create an event EventTrack object from a hash
|
17
|
+
# @param [Hash] props - hash of properties to create object from
|
18
|
+
# @return [EventTrack]
|
19
|
+
def self.create(props)
|
20
|
+
obj = EventTrack.new
|
21
|
+
props.each do |key, value|
|
22
|
+
key = key.to_s
|
23
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
24
|
+
end if props
|
25
|
+
obj
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# guest.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class Guest < Component
|
11
|
+
attr_accessor :guest_id, :guest_section
|
12
|
+
|
13
|
+
# Factory method to create a Guest object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [Guest]
|
16
|
+
def self.create(props)
|
17
|
+
obj = Guest.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
if key == 'guest_section'
|
21
|
+
obj.send("#{key}=", Components::EventSpot::GuestSection.create(value))
|
22
|
+
else
|
23
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
obj
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#
|
2
|
+
# guest_section.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class GuestSection < Component
|
11
|
+
attr_accessor :label, :fields
|
12
|
+
|
13
|
+
# Factory method to create a GuestSection object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [GuestSection]
|
16
|
+
def self.create(props)
|
17
|
+
obj = GuestSection.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
if key == 'fields'
|
21
|
+
value ||= []
|
22
|
+
obj.fields = value.collect do |field|
|
23
|
+
Components::EventSpot::RegistrantField.create(field)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
27
|
+
end
|
28
|
+
end if props
|
29
|
+
obj
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# notification_option.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class NotificationOption < Component
|
11
|
+
attr_accessor :is_opted_in, :notification_type
|
12
|
+
|
13
|
+
# Factory method to create an event NotificationOption object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [NotificationOption]
|
16
|
+
def self.create(props)
|
17
|
+
obj = NotificationOption.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
21
|
+
end if props
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# online_meeting.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class OnlineMeeting < Component
|
11
|
+
attr_accessor :instructions, :provider_meeting_id, :provider_type, :url
|
12
|
+
|
13
|
+
# Factory method to create an OnlineMeeting object from a json string
|
14
|
+
# @param [Hash] props - properties to create object from
|
15
|
+
# @return [OnlineMeeting]
|
16
|
+
def self.create(props)
|
17
|
+
obj = OnlineMeeting.new
|
18
|
+
if props
|
19
|
+
props.each do |key, value|
|
20
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
21
|
+
end
|
22
|
+
end
|
23
|
+
obj
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#
|
2
|
+
# payment_address.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class PaymentAddress < Component
|
11
|
+
attr_accessor :city, :country, :country_code, :latitude, :line1, :line2, :line3, :longitude, :postal_code,
|
12
|
+
:state, :state_code
|
13
|
+
|
14
|
+
# Factory method to create a PaymentAddress object from a json string
|
15
|
+
# @param [Hash] props - properties to create object from
|
16
|
+
# @return [PaymentAddress]
|
17
|
+
def self.create(props)
|
18
|
+
obj = PaymentAddress.new
|
19
|
+
if props
|
20
|
+
props.each do |key, value|
|
21
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
22
|
+
end
|
23
|
+
end
|
24
|
+
obj
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#
|
2
|
+
# payment_summary.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class PaymentSummary < Component
|
11
|
+
attr_accessor :order, :payment_status, :payment_type, :promo_code
|
12
|
+
|
13
|
+
# Factory method to create an event PaymentSummary object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [PaymentSummary]
|
16
|
+
def self.create(props)
|
17
|
+
obj = PaymentSummary.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
if key == 'order'
|
21
|
+
obj.order = Components::EventSpot::RegistrantOrder.create(value)
|
22
|
+
elsif key == 'promo_code'
|
23
|
+
obj.promo_code = Components::EventSpot::RegistrantPromoCode.create(value)
|
24
|
+
else
|
25
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
26
|
+
end
|
27
|
+
end if props
|
28
|
+
obj
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# promocode.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class Promocode < Component
|
10
|
+
attr_accessor :code_name, :code_type, :discount_amount, :discount_percent, :discount_scope, :discount_type,
|
11
|
+
:fee_ids, :id, :is_paused, :quantity_available, :quantity_total, :quantity_used, :status
|
12
|
+
|
13
|
+
# Factory method to create an event Promocode object from a hash
|
14
|
+
# @param [Hash] props - properties to create object from
|
15
|
+
# @return [Promocode]
|
16
|
+
def self.create(props)
|
17
|
+
obj = Promocode.new
|
18
|
+
props.each do |key, value|
|
19
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
20
|
+
end
|
21
|
+
obj
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
#
|
2
|
+
# registrant.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class Registrant < Component
|
10
|
+
attr_accessor :attendance_status, :email, :first_name, :guest_count, :id, :last_name, :payment_status,
|
11
|
+
:registration_date, :registration_status, :ticket_id, :updated_date,
|
12
|
+
:payment_summary, :promo_code, :sections, :guests
|
13
|
+
|
14
|
+
# Factory method to create an event Registrant object from a hash
|
15
|
+
# @param [Hash] props - hash of properties to create object from
|
16
|
+
# @return [Registrant]
|
17
|
+
def self.create(props)
|
18
|
+
obj = Registrant.new
|
19
|
+
if props
|
20
|
+
props.each do |key, value|
|
21
|
+
key = key.to_s
|
22
|
+
if key == 'payment_summary'
|
23
|
+
obj.payment_summary = Components::EventSpot::PaymentSummary.create(value)
|
24
|
+
elsif key == 'sections'
|
25
|
+
obj.sections = value.collect{|section| Components::EventSpot::RegistrantSection.create(section) }
|
26
|
+
elsif key == 'promo_code'
|
27
|
+
obj.promo_code = Components::EventSpot::RegistrantPromoCode.create(value)
|
28
|
+
elsif key == 'guests'
|
29
|
+
value = value["guest_info"] || []
|
30
|
+
obj.guests = value.collect{|guest| Components::EventSpot::Guest.create(guest) }
|
31
|
+
else
|
32
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
obj
|
37
|
+
end
|
38
|
+
|
39
|
+
# Factory method to create an event Registrant summary object from a hash
|
40
|
+
# @param [Hash] props - hash of properties to create object from
|
41
|
+
# @return [Registrant]
|
42
|
+
def self.create_summary(props)
|
43
|
+
obj = Registrant.new
|
44
|
+
props.each do |key, value|
|
45
|
+
key = key.to_s
|
46
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
47
|
+
end if props
|
48
|
+
obj
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#
|
2
|
+
# registrant_fee.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class RegistrantFee < Component
|
11
|
+
attr_accessor :id, :amount, :promo_type, :fee_period_type, :type, :name, :quantity
|
12
|
+
|
13
|
+
# Factory method to create a RegistrantFee object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [RegistrantFee]
|
16
|
+
def self.create(props)
|
17
|
+
obj = RegistrantFee.new
|
18
|
+
if props
|
19
|
+
props.each do |key, value|
|
20
|
+
key = key.to_s
|
21
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
22
|
+
end
|
23
|
+
end
|
24
|
+
obj
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# registrant_field.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class RegistrantField < Component
|
11
|
+
attr_accessor :type, :name, :label, :value, :values
|
12
|
+
|
13
|
+
# Factory method to create an event Fee object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [Campaign]
|
16
|
+
def self.create(props)
|
17
|
+
field = RegistrantField.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
field.send("#{key}=", value) if field.respond_to? key
|
21
|
+
end if props
|
22
|
+
field
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#
|
2
|
+
# registrant_order.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class RegistrantOrder < Component
|
11
|
+
attr_accessor :currency_type, :fees, :items, :order_id, :order_date, :total
|
12
|
+
|
13
|
+
# Factory method to create a RegistrantOrder object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [RegistrantOrder]
|
16
|
+
def self.create(props)
|
17
|
+
obj = RegistrantOrder.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
if key == 'fees'
|
21
|
+
value ||= []
|
22
|
+
obj.fees = value.collect do |fee|
|
23
|
+
Components::EventSpot::RegistrantFee.create(fee)
|
24
|
+
end
|
25
|
+
elsif key == 'items'
|
26
|
+
value ||= []
|
27
|
+
obj.items = value.collect do |item|
|
28
|
+
Components::EventSpot::SaleItem.create(item)
|
29
|
+
end
|
30
|
+
else
|
31
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
32
|
+
end
|
33
|
+
end if props
|
34
|
+
obj
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#
|
2
|
+
# registrant_promo_code.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class RegistrantPromoCode < Component
|
11
|
+
attr_accessor :total_discount, :promo_code_info
|
12
|
+
|
13
|
+
# Factory method to create a RegistrantPromoCode object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [RegistrantPromoCode]
|
16
|
+
def self.create(props)
|
17
|
+
obj = RegistrantPromoCode.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
if key == 'promo_code_info'
|
21
|
+
obj.send("#{key}=", Components::EventSpot::RegistrantPromoCodeInfo.create(value))
|
22
|
+
else
|
23
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
24
|
+
end
|
25
|
+
end if props
|
26
|
+
obj
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# registrant_promo_code_info.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class RegistrantPromoCodeInfo < Component
|
11
|
+
attr_accessor :code_name, :code_type, :discount_amount, :discount_scope, :discount_type, :redemption_count
|
12
|
+
|
13
|
+
# Factory method to create a RegistrantPromoCode object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [RegistrantPromoCodeInfo]
|
16
|
+
def self.create(props)
|
17
|
+
obj = RegistrantPromoCodeInfo.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
21
|
+
end if props
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#
|
2
|
+
# registrant_section.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class RegistrantSection < Component
|
11
|
+
attr_accessor :label, :fields
|
12
|
+
|
13
|
+
# Factory method to create a RegistrantSection object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [RegistrantSection]
|
16
|
+
def self.create(props)
|
17
|
+
obj = RegistrantSection.new
|
18
|
+
props.each do |key, value|
|
19
|
+
key = key.to_s
|
20
|
+
if key == 'fields'
|
21
|
+
value ||= []
|
22
|
+
obj.fields = value.collect do |field|
|
23
|
+
Components::EventSpot::RegistrantField.create(field)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
27
|
+
end
|
28
|
+
end if props
|
29
|
+
obj
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#
|
2
|
+
# sale_item.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
module EventSpot
|
10
|
+
class SaleItem < Component
|
11
|
+
attr_accessor :id, :amount, :promo_type, :fee_period_type, :type, :name, :quantity
|
12
|
+
|
13
|
+
# Factory method to create a SaleItem object from a hash
|
14
|
+
# @param [Hash] props - hash of properties to create object from
|
15
|
+
# @return [SaleItem]
|
16
|
+
def self.create(props)
|
17
|
+
obj = SaleItem.new
|
18
|
+
if props
|
19
|
+
props.each do |key, value|
|
20
|
+
key = key.to_s
|
21
|
+
obj.send("#{key}=", value) if obj.respond_to? key
|
22
|
+
end
|
23
|
+
end
|
24
|
+
obj
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#
|
2
|
+
# library_file.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class LibraryFile < Component
|
10
|
+
attr_accessor :created_date, :description, :file_type, :folder, :folder_id, :height, :id, :is_image,
|
11
|
+
:modified_date, :name, :size, :source, :status, :thumbnail, :url, :width, :type
|
12
|
+
|
13
|
+
# Factory method to create a LibraryFile object from a json string
|
14
|
+
# @param [Hash] props - properties to create object from
|
15
|
+
# @return [LibraryFile]
|
16
|
+
def self.create(props)
|
17
|
+
obj = LibraryFile.new
|
18
|
+
if props
|
19
|
+
props.each do |key, value|
|
20
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
obj
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# library_folder.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class LibraryFolder < Component
|
10
|
+
attr_accessor :created_date, :id, :item_count, :level, :modified_date, :name, :parent_id, :children
|
11
|
+
|
12
|
+
# Factory method to create a LibraryFolder object from a json string
|
13
|
+
# @param [Hash] props - properties to create object from
|
14
|
+
# @return [LibraryFolder]
|
15
|
+
def self.create(props)
|
16
|
+
obj = LibraryFolder.new
|
17
|
+
if props
|
18
|
+
props.each do |key, value|
|
19
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# library_summary.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class LibrarySummary < Component
|
10
|
+
attr_accessor :max_free_file_num, :max_premium_space_limit, :max_upload_size_limit, :image_root, :usage_summary
|
11
|
+
|
12
|
+
# Factory method to create a LibrarySummary object from a json string
|
13
|
+
# @param [Hash] props - properties to create object from
|
14
|
+
# @return [LibrarySummary]
|
15
|
+
def self.create(props)
|
16
|
+
obj = LibrarySummary.new
|
17
|
+
if props
|
18
|
+
props.each do |key, value|
|
19
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# move_results.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class MoveResults < Component
|
10
|
+
attr_accessor :id, :uri
|
11
|
+
|
12
|
+
# Factory method to create a MoveResults object from a json string
|
13
|
+
# @param [Hash] props - properties to create object from
|
14
|
+
# @return [MoveResults]
|
15
|
+
def self.create(props)
|
16
|
+
obj = MoveResults.new
|
17
|
+
if props
|
18
|
+
props.each do |key, value|
|
19
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# upload_status.rb
|
3
|
+
# ConstantContact
|
4
|
+
#
|
5
|
+
# Copyright (c) 2013 Constant Contact. All rights reserved.
|
6
|
+
|
7
|
+
module ConstantContact
|
8
|
+
module Components
|
9
|
+
class UploadStatus < Component
|
10
|
+
attr_accessor :status, :description, :file_id
|
11
|
+
|
12
|
+
# Factory method to create an UploadStatus object from a json string
|
13
|
+
# @param [Hash] props - properties to create object from
|
14
|
+
# @return [UploadStatus]
|
15
|
+
def self.create(props)
|
16
|
+
obj = UploadStatus.new
|
17
|
+
if props
|
18
|
+
props.each do |key, value|
|
19
|
+
obj.send("#{key}=", value) if obj.respond_to?("#{key}=")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
obj
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|