fuelsdk 0.0.8 → 0.0.9

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.
data/fuelsdk.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = []
11
11
  spec.description = %q{Fuel SDK for Ruby}
12
12
  spec.summary = %q{Fuel SDK for Ruby}
13
- spec.homepage = "https://github.com/barberj/FuelSDK-Ruby"
13
+ spec.homepage = "https://code.exacttarget.com/sdks"
14
14
  spec.license = ""
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
data/lib/fuelsdk.rb CHANGED
@@ -30,4 +30,3 @@ ET_Subscriber = FuelSDK::Subscriber
30
30
  ET_UnsubEvent = FuelSDK::UnsubEvent
31
31
  ET_TriggeredSend = FuelSDK::TriggeredSend
32
32
  ET_Campaign = FuelSDK::Campaign
33
- ET_Get = FuelSDK::Get
@@ -300,7 +300,7 @@ module FuelSDK
300
300
 
301
301
  def munge_fields d
302
302
  # maybe one day will make it smart enough to zip properties and fields if count is same?
303
- if d.count > 1 and (fields and !fields.empty?)
303
+ if d.kind_of? Array and d.count > 1 and (fields and !fields.empty?)
304
304
  # we could map the field to all DataExtensions, but lets make user be explicit.
305
305
  # if they are going to use fields attribute properties should
306
306
  # be a single DataExtension Defined in a Hash
@@ -364,28 +364,4 @@ module FuelSDK
364
364
  end
365
365
  end
366
366
  end
367
-
368
- class Get < Objects::Base
369
- include Objects::Soap::Read
370
- attr_accessor :id
371
-
372
- def initialize client, id, properties, filter
373
- self.properties = properties
374
- self.filter = filter
375
- self.client = client
376
- self.id = id
377
- end
378
-
379
- def get
380
- super id
381
- end
382
-
383
- class << self
384
- def new client, id, properties=nil, filter=nil
385
- o = self.allocate
386
- o.send :initialize, client, id, properties, filter
387
- return o.get
388
- end
389
- end
390
- end
391
367
  end
data/lib/fuelsdk/soap.rb CHANGED
@@ -169,6 +169,19 @@ module FuelSDK
169
169
  soap_cud :delete, object_type, properties
170
170
  end
171
171
 
172
+ def soap_perform object_type, properties, action
173
+ message = {
174
+ 'Action' => action,
175
+ 'Definitions' => {
176
+ 'Definition' => properties,
177
+ :attributes! => {
178
+ 'Definition' => {'xsi:type' => ('tns:' + object_type)}
179
+ }
180
+ }
181
+ }
182
+ soap_request :perform, message
183
+ end
184
+
172
185
  private
173
186
 
174
187
  def soap_cud action, object_type, properties
@@ -1,3 +1,3 @@
1
1
  module FuelSDK
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -24,8 +24,6 @@ begin
24
24
  raise 'Failure creating data extensions' unless createDEResponse.success?
25
25
  raise 'Failure creating data extensions' unless createDEResponse.results.count == 2
26
26
 
27
- raise
28
-
29
27
  # Cleaning up the newly created DEs
30
28
  # Delete deOne
31
29
  p '>>> Delete deOne'
@@ -40,8 +40,6 @@ begin
40
40
  p 'Results: ' + postResponse.results.inspect
41
41
  raise 'Failure creating data extension' unless postResponse.success?
42
42
 
43
- raise
44
-
45
43
  # Update DE to add new field
46
44
  p '>>> Update DE to add new field'
47
45
  de3 = ET_DataExtension.new
@@ -1,8 +1,8 @@
1
1
  def auth
2
2
  {
3
3
  'client' => {
4
- 'id' => 'sdkph8s8dhtk63zezqfk9fac',
5
- 'secret' => 'VUZg3FNVbZ84CKjdFqswZu84'
4
+ 'id' => YOURID
5
+ 'secret' => YOURSERET
6
6
  }
7
7
  }
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuelsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -170,7 +170,6 @@ files:
170
170
  - samples/sample-dataextension.rb
171
171
  - samples/sample-email.rb
172
172
  - samples/sample-folder.rb
173
- - samples/sample-get.rb
174
173
  - samples/sample-list.rb
175
174
  - samples/sample-list.subscriber.rb
176
175
  - samples/sample-openevent.rb
@@ -188,7 +187,7 @@ files:
188
187
  - spec/soap_spec.rb
189
188
  - spec/spec_helper.rb
190
189
  - spec/targeting_spec.rb
191
- homepage: https://github.com/barberj/FuelSDK-Ruby
190
+ homepage: https://code.exacttarget.com/sdks
192
191
  licenses:
193
192
  - ''
194
193
  post_install_message:
@@ -223,7 +222,6 @@ test_files:
223
222
  - samples/sample-dataextension.rb
224
223
  - samples/sample-email.rb
225
224
  - samples/sample-folder.rb
226
- - samples/sample-get.rb
227
225
  - samples/sample-list.rb
228
226
  - samples/sample-list.subscriber.rb
229
227
  - samples/sample-openevent.rb
@@ -1,13 +0,0 @@
1
- require 'fuelsdk'
2
- require_relative 'sample_helper' # contains auth with credentials
3
-
4
- begin
5
- client = ET_Client.new auth
6
- get = ET_Get.new client, 'Account'
7
- p "Results: #{get.results}"
8
- raise 'Failure getting Account info' unless get.success?
9
-
10
- rescue => e
11
- p "Caught exception: #{e.message}"
12
- p e.backtrace
13
- end