3scale_api 1.0.5 → 1.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07933142916a8a3d9c55b490afdc849283fff51b
4
- data.tar.gz: da478f451a32ea063954f381f4490d976bfdb9f8
3
+ metadata.gz: b0f8796de5dcedb6331ec6b658438488735b3a12
4
+ data.tar.gz: 32184f83d8f8c85e099614ab5f3ed90d5cd3fedb
5
5
  SHA512:
6
- metadata.gz: 0945fb9b4861cff5afba081a36279697f4ba90afd42083f430d66d80aaf849385a2dd1b2acffb5dedeb7418e61dd686ece0bd0f6e8fad237ae33bb9115c69bba
7
- data.tar.gz: 91764b83b73e8894d6e45b3b3f1cb0b029c303bf6534f0596effa9596c10c9fbbb56aa86c82b3045bae5bb64d3eaedb2751ee79a2b1ed8aae8f8e4851cf6f214
6
+ metadata.gz: 08f1f3cd80b3f59664344a5dfb4c589340a2d2d986429d46537167a468fe6a37bd30e04e1a60d826d719ac710c523844b8da504495cf4ef34f844f02089153ed
7
+ data.tar.gz: 859454221162e63d58a95026a9634229fc208a8c209a47e4b5a6245db53c8816127c99289efedfdafc071547604b8d412f43fe7e55b79e296ca40c7a8fd7a718
@@ -112,12 +112,32 @@ module Threescale
112
112
  end
113
113
  end
114
114
 
115
- def create_account(name, service_id)
116
- response = @conn.post "/admin/api/services/#{service_id}/application_plans.xml", {:provider_key => @provider_key,
117
- :name => name}
118
- return false if response.status != 201
115
+ # Account API methods
116
+ def approve_account(account_id)
117
+ response = @conn.put "/admin/api/accounts/#{account_id}/approve.xml", {
118
+ :provider_key => @provider_key}
119
+ response.status == 201
120
+ end
121
+
122
+ def signup_express(account_plan_id, application_plan_id, email, org_name, password, service_plan_id, username,
123
+ additional_fields = nil)
124
+ params = {:provider_key => @provider_key, :username => username,
125
+ :password => password, :email => email, :org_name => org_name, :account_plan_id => account_plan_id,
126
+ :service_plan_id => service_plan_id, :application_plan_id => application_plan_id}
127
+ if (additional_fields)
128
+ additional_fields.each do |key, value|
129
+ params[key] = value
130
+ end
131
+ end
132
+ response = @conn.post "/admin/api/signup.xml", params
133
+ return false = response.status != 201
119
134
  xml = Nokogiri::XML(response.body)
120
- xml.css("plan id").text
135
+ account_id = xml.xpath('//account/id').first.text
136
+ user_id = xml.xpath('//account/users/user/id').text
137
+ self.approve_account account_id
138
+ results = self.get_application_list account_id
139
+ results[0][:user_id] = user_id.to_s
140
+ results
121
141
  end
122
142
 
123
143
  def create_user(account_id, email, password, username)
@@ -1,3 +1,3 @@
1
1
  module Threescale
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 3scale_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robbie Holmes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-09 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem is to be used to interact with 3Scale's API.
14
14
  email: