3scale-api 0.1.3 → 0.1.4

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: d9076fbdc6914551fa33773e4216b3669c080a13
4
- data.tar.gz: 9f3dabd8c12a5fcc88c2c75f22e8d5f157617896
3
+ metadata.gz: 94f03fe320fe39054fded73ddd6fe765a1dc6057
4
+ data.tar.gz: b4f7f3e2b07138c733aff57cdd419406c5d5b72b
5
5
  SHA512:
6
- metadata.gz: 328dc5a4c07737a1eb5d573600abcf72143d9fa382048dc7dd69ad5eae850a862b3dd766e4d9ee42c3cd25a467979468b3de9c74a9036d6e6c82debada05d142
7
- data.tar.gz: 0c4ea2c0a39b1e4c98c7c9d0434694b5f29ebc3c631c47e7cf57ad47f7086948c9422baf59c5221da004faa600b1e23dc7366541b30ea651e8bda1ecfe1fd22a
6
+ metadata.gz: 2c6089e0ffb2bfdc0942506531d7cadf10287217fa2a6f344c0e7e79c914994df3db93a9d6d35cbc35235833c8e247ae5d2592f6f0ba6c404f1dcef1ffdd01aa
7
+ data.tar.gz: 111169a40674449ac58bfaa837bd29ea6ef8fd58663e98c7a9a9061b4ae7ba1f4c0c3ba3c00ed40056f44d2ab392373e5e8e1b9bd00f4d5ca06bec2b9fc60b01
@@ -34,6 +34,56 @@ module ThreeScale
34
34
  extract(collection: 'applications', entity: 'application', from: response)
35
35
  end
36
36
 
37
+ # @api public
38
+ # @return [Hash]
39
+ # @param [Fixnum] id Application ID
40
+ def show_application(id)
41
+ find_application(id: id)
42
+ end
43
+
44
+ # @api public
45
+ # @return [Hash]
46
+ # @param [Fixnum] id Application ID
47
+ # @param [String] user_key Application User Key
48
+ # @param [String] application_id Application App ID
49
+ def find_application(id: nil, user_key: nil, application_id: nil)
50
+ params = { application_id: id, user_key: user_key, app_id: application_id }.reject { |_,value| value.nil? }
51
+ response = http_client.get('/admin/api/applications/find', params: params)
52
+ extract(entity: 'application', from: response)
53
+ end
54
+
55
+ # @api public
56
+ # @return [Hash] an Application
57
+ # @param [Fixnum] plan_id Application Plan ID
58
+ # @param [Hash] attributes Application Attributes
59
+ # @option attributes [String] :name Application Name
60
+ # @option attributes [String] :description Application Description
61
+ # @option attributes [String] :user_key Application User Key
62
+ # @option attributes [String] :application_id Application App ID
63
+ # @option attributes [String] :application_key Application App Key(s)
64
+ def create_application(account_id, attributes = {}, plan_id: , **rest)
65
+ body = { plan_id: plan_id }.merge(attributes).merge(rest)
66
+ response = http_client.post("/admin/api/accounts/#{account_id}/applications", body: body)
67
+ extract(entity: 'application', from: response)
68
+ end
69
+
70
+ # @api public
71
+ # @return [Hash] an Account
72
+ # @param [String] name Account Name
73
+ # @param [String] username User Username
74
+ # @param [Hash] attributes User and Account Attributes
75
+ # @option attributes [String] :email User Email
76
+ # @option attributes [String] :password User Password
77
+ # @option attributes [String] :account_plan_id Account Plan ID
78
+ # @option attributes [String] :service_plan_id Service Plan ID
79
+ # @option attributes [String] :application_plan_id Application Plan ID
80
+ def signup(attributes = {}, name: , username: , **rest)
81
+ body = { org_name: name,
82
+ username: username }.merge(attributes).merge(rest)
83
+ response = http_client.post('/admin/api/signup', body: body)
84
+ extract(entity: 'account', from: response)
85
+ end
86
+
37
87
  # @api public
38
88
  # @return [Hash]
39
89
  # @param [Hash] attributes Service Attributes
@@ -1,5 +1,5 @@
1
1
  module ThreeScale
2
2
  module API
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  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: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Cichra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler