itglue 0.1.0 → 0.1.1

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: 577a952aa71445a0982220ba9519ef3e8ff30abb
4
- data.tar.gz: e00b1ce90a9bcd6a9b56935b72ad3953b85dcde0
3
+ metadata.gz: 8217e3d49165473cf67212ecfb101f481c6f4632
4
+ data.tar.gz: 8ed94c541d8e0cd8557b1eb87d6b04280aebf68e
5
5
  SHA512:
6
- metadata.gz: 430a99fea58b66419afbefa28449d4bc3cedf0b3e457c9e61bce8e3b6b131c6585d94b0dacb39e8b22bb5acd5019c3993dc7d5b0012cb0711d06c6f4ac049285
7
- data.tar.gz: 1ca0c09f3127a634d5dd087a38666ed8bbbb9a8cd6007569bfa86a6d539dd3a1e9c23409777e767c63ecf8191ef49f811cda42538b2f1db47f086806120f9ae7
6
+ metadata.gz: afa4b7449dcc55f49f44747421bda5887b07f86cfdac8799965831e397af57d443f184ff89d36e61d14ac34cc8a13f86b4aeae73c4a0291aba0259ec0d131664
7
+ data.tar.gz: 18a093cc4d219d15c281ac790d458a117e005f4227762913092151cba39a8b9200e4116d489b3929432892cec29f6db420bac30ec2f6a6c76b0a60241066056b
data/README.md CHANGED
@@ -24,7 +24,8 @@ For now this gem only supports API Key authentication.
24
24
  require 'itglue'
25
25
 
26
26
  ITGlue.configure do |config|
27
- config.itglue_api_key = 'ITG.b94e901420fe7cb163a364b451f172d9.P3nMIV9EDp1Xb7h4-sO7WDU0S2R5DgC-fu2DsTxBkW7eZHRp0y4ODRQ51se1c24m' config.itglue_api_base_uri = 'https://api.itglue.com'
27
+ config.itglue_api_key = 'ITG.b94e901420fe7cb163a364b451f172d9...'
28
+ config.itglue_api_base_uri = 'https://api.itglue.com'
28
29
  config.logger = ::Logger.new(STDOUT)
29
30
  end
30
31
  ```
@@ -46,11 +47,12 @@ organizations = ITGlue::Organization.filter(name: 'Happy Frog')
46
47
  Get organization by id
47
48
  ```ruby
48
49
  organization = ITGlue::Organization.find(123)
49
- #=> #<ITGlue::Organization id: 123 name: "Ben's Gem Test", description: nil, ...>]
50
+ #=> #<ITGlue::Organization id: 123 name: "Happy Frog", description: nil, ...>]
50
51
  ```
51
52
  Get configurations for a specific organization
52
53
  ```ruby
53
- configuration = ITGlue::Organization.get_nested(organization)
54
+ configurations = ITGlue::Configuration.get_nested(organization)
55
+ #=> [#<ITGlue::Configuration id: 23943 organization_id: 31131, organization_name: "Happy Frog", name: "HP", ...>, ...]
54
56
  ```
55
57
 
56
58
  ### Client
@@ -59,6 +61,7 @@ You can also directly instantiate a client and handle the data and response dire
59
61
  ```ruby
60
62
  client = ITGlue::Client.new
61
63
  #=> #<ITGlue::Client:0x007fd7eb032d00 ...>
64
+
62
65
  query = { filter: { name: 'HP' } }
63
66
  client.get(:configurations, { parent: organization }, { query: query })
64
67
  # => [
@@ -66,6 +69,7 @@ client.get(:configurations, { parent: organization }, { query: query })
66
69
  # id: 456,
67
70
  # type: "configurations",
68
71
  # attributes: {
72
+ # name: "HP",
69
73
  # organization_id: 123,
70
74
  # organization_name: "Happy Frog",
71
75
  # ...
@@ -76,15 +80,16 @@ client.get(:configurations, { parent: organization }, { query: query })
76
80
  ```
77
81
  A get request such as the one above will handle generating the route and pagination. If you want to handle these yourself, you can use 'execute'
78
82
  ```ruby
79
- client.execute(:get, '/organizations/31131/relationships/configurations', nil, {query: {filter: {name: 'HP'}}})
83
+ client.execute(:get, '/organizations/31131/relationships/configurations', nil, { query: query })
80
84
  # => {
81
85
  # "data"=> [
82
86
  # {
83
87
  # "id"=>"23943",
84
88
  # "type"=>"configurations",
85
89
  # "attributes"=> {
86
- # "organization-id"=>31131,
87
- # "organization-name"=>"Ben's Gem Test",
90
+ # "name" => "HP",
91
+ # "organization-id"=>123,
92
+ # "organization-name"=>"Happy Frog",
88
93
  # ...
89
94
  # }
90
95
  # },
@@ -1,8 +1,13 @@
1
- Dir[File.join(File.dirname(__FILE__), 'asset/*.rb')].each {|file| require file }
1
+ require File.join(File.dirname(__FILE__), 'asset/base.rb')
2
+ require File.join(File.dirname(__FILE__), 'asset/configuration.rb')
3
+ require File.join(File.dirname(__FILE__), 'asset/configuration_interface.rb')
4
+ require File.join(File.dirname(__FILE__), 'asset/configuration_status.rb')
5
+ require File.join(File.dirname(__FILE__), 'asset/configuration_type.rb')
6
+ require File.join(File.dirname(__FILE__), 'asset/organization.rb')
2
7
 
3
8
  module ITGlue
4
9
  module Asset
5
10
  class ITGlueAssetError < ITGlueError; end
6
11
  class MethodNotAvailable < ITGlueAssetError; end
7
12
  end
8
- end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module ITGlue
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itglue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-14 00:00:00.000000000 Z
11
+ date: 2018-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler