api_connect_client 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d5b820368e3fd95d4158f69110437ae5131e4214dc89fe9e57a8f07634fcb7ed
4
- data.tar.gz: 66e1fe15b757fcaed60ff181f75f28fdb7ec313032f77929b241e51e7745b14b
3
+ metadata.gz: 318e7dcda856d10e17e4161ce29974e9c151d3fe221fee3a0d8b785a5c1ce351
4
+ data.tar.gz: 1977f40a67f6843793a1121037d78007f13fb28c789cbb6b36388e9183a44d10
5
5
  SHA512:
6
- metadata.gz: 39aff90f4a4e0c7c8b74689f2d0f15b22b3ec25811d844e3ca50903ceae644f283c840a858662a5e7e966e4ddd24b2fe3af83e5fdaff9cb80c635b69fa3b7f6d
7
- data.tar.gz: 1ecfc20c8a80c688820e6742e0f2fa78882e4ea37c43ef6d296853bf74ce006baca2420f264f9dfeb0dae2e8780d85df955d8422157cc6622d63fd00d58a2f1f
6
+ metadata.gz: 20f48825709bf373e79aba1aaf8e18b287a85a2c87c201e8fe9120ecc8f40c3dd9d740e83d8027721d9be1fdce71ff109e9f1ce00c80c9f3b5b870d734e465f5
7
+ data.tar.gz: 9b4828fbaf12f85d6cf78bd6163f6d3f49b75b3b61f8e9e90efb445b5c343593d4ce7f1e718c4bee62b5393512db0fe719d85506710f732558bb0475a10cddb7
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api_connect_client (0.2.0)
4
+ api_connect_client (0.3.0)
5
5
  json (~> 2.1, >= 2.1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- # Api Connect Client [![Build Status](https://travis-ci.org/cffiebig/api-connect-client.svg?branch=master)](https://travis-ci.org/cffiebigc/api-connect-client) [![Gem Version](https://badge.fury.io/rb/api_connect_client.svg)](https://badge.fury.io/rb/api_connect_client)
3
+ # Api Connect Client [![Build Status](https://travis-ci.org/cffiebigc/api-connect-client.svg?branch=master)](https://travis-ci.org/cffiebigc/api-connect-client) [![Gem Version](https://badge.fury.io/rb/api_connect_client.svg)](https://badge.fury.io/rb/api_connect_client)
4
4
 
5
5
  This gem is used to interact with the [Developer Portal REST APIs](https://www.ibm.com/support/knowledgecenter/en/SSFS6T/com.ibm.apic.apirest.doc/dev_portal_apis.html)
6
6
  to perform some of the operations that are normally carried out in the Developer Portal UI.
@@ -4,6 +4,7 @@ module ApiConnectClient
4
4
  require_relative './api_connect_client/base'
5
5
  require_relative './api_connect_client/product'
6
6
  require_relative './api_connect_client/user'
7
+ require_relative './api_connect_client/admin'
7
8
  require_relative './api_connect_client/application'
8
9
  require_relative './api_connect_client/manager'
9
10
  require_relative './api_connect_client/developer'
@@ -0,0 +1,17 @@
1
+ module ApiConnectClient
2
+ class Admin < Base
3
+ def initialize(admin_user, admin_pass)
4
+ super()
5
+ @headers = {
6
+ 'X-IBM-APIManagement-Context': ApiConnectClient::Config.context
7
+ }
8
+ @admin_user = admin_user
9
+ @admin_pass = admin_pass
10
+ end
11
+
12
+ def register_developer(body)
13
+ post('/users/register', body, @admin_user, @admin_pass)
14
+ end
15
+
16
+ end
17
+ end
@@ -80,5 +80,15 @@ module ApiConnectClient
80
80
  app = ApiConnectClient::Application.new(@@organization_id, @username, @password)
81
81
  app.unsubscribe(app_id, subscription_id)
82
82
  end
83
+
84
+ def get_profile_information
85
+ user = ApiConnectClient::User.new(@username, @password)
86
+ user.get_info
87
+ end
88
+
89
+ def list_organizations
90
+ user = ApiConnectClient::User.new(@username, @password)
91
+ user.list_organizations
92
+ end
83
93
  end
84
94
  end
@@ -13,8 +13,8 @@ module ApiConnectClient
13
13
  "password" => password,
14
14
  "username" => username
15
15
  }
16
- user = ApiConnectClient::User.new(@admin_user, @admin_pass)
17
- user.create(body.to_json)
16
+ admin = ApiConnectClient::Admin.new(@admin_user, @admin_pass)
17
+ admin.register_developer(body.to_json)
18
18
  end
19
19
 
20
20
  def list_products
@@ -1,16 +1,21 @@
1
1
  module ApiConnectClient
2
2
  class User < Base
3
- def initialize(admin_user, admin_pass)
3
+ def initialize(username, password)
4
4
  super()
5
5
  @headers = {
6
6
  'X-IBM-APIManagement-Context': ApiConnectClient::Config.context
7
7
  }
8
- @admin_user = admin_user
9
- @admin_pass = admin_pass
8
+ @username = username
9
+ @password = password
10
10
  end
11
11
 
12
- def create(body)
13
- post('/users/register', body, @admin_user, @admin_pass)
12
+ def get_info
13
+ get("/me", @username, @password)
14
14
  end
15
+
16
+ def list_organizations
17
+ get("/orgs", @username, @password)
18
+ end
19
+
15
20
  end
16
- end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module ApiConnectClient
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_connect_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Fiebig
@@ -134,6 +134,7 @@ files:
134
134
  - bin/console
135
135
  - bin/setup
136
136
  - lib/api_connect_client.rb
137
+ - lib/api_connect_client/admin.rb
137
138
  - lib/api_connect_client/api.rb
138
139
  - lib/api_connect_client/application.rb
139
140
  - lib/api_connect_client/base.rb