mxhero-api 0.1.30 → 0.1.31

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDViNTdjZTE3ZDY4NjhmN2E2NjM5NjgyZDhmNWNlMWNkYTEzYzY5ZQ==
4
+ MDkzNTUwNzUxNDUzN2Y0MjE5NjZhNTUzNTNlMDEwYzBlZTMwZjBlOQ==
5
5
  data.tar.gz: !binary |-
6
- ODg0Mzc3NjY5ZGFjZTQwODljOGNkODgyOWEwY2RhM2ZkZWQ0ZjYwMw==
6
+ NTVlZTQ2NDA4ZGU1ZWE1ZjEyNTA5YTMwOTFjMmJhYmRkOTRkYmZiMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDA0NDJhOWFmNTBiZTgyNDZhZjBkYmIxMmQ4ZGRmZWI5OGRkZjY3M2U4NTg1
10
- MWQ3MjdhOWVlODYwZDY4ZmI2NTg3MGU0MmIxOTI0NTBlMDQzMjU2MmVlMWI5
11
- OGNlNDk4YTJlOTFkNTQyMTM3ZWJhMTlkYzY5ZDdhMzYyOGRiN2M=
9
+ ZjZhY2E1N2RlNDA3ZjkyNjJiMGRlYmRhZDRjNzQ3OGI5YzgyZmM0OTdiZjIy
10
+ NDJkYWRiZmUwZjFlYjAyMTBmYzVhMzg3ODIwNTI3MTJiMDdmODEyMzMyZjA5
11
+ NTMxYjY5OTg4YWI4MzEzZmJiMmQ1NzBiODQ0MjUyMTk3OGUyZTM=
12
12
  data.tar.gz: !binary |-
13
- MzM2YTA4ZGZjMTM4NDJmYzhlYTA4ZTc1YWQ5ZDkyNDdmYmYxOWFiMDVkMzk1
14
- Mjk3YzgyOGQ0Y2M2ZjUzN2RiMjhmZmM0NWM2MmQzOTA0NmEyZDcxZGUyZTIz
15
- YmY2MjJiNGI1OWIzZDA0Mzc5N2MxYjZhMmU5MzhkZWQwMGNjMTc=
13
+ ZmNiNzk4M2JmOGRmMGNjNTEzZTNmYWVkMTE5MWUzM2JmNDVkY2YxNmYwMjJl
14
+ MDMwM2Q5ZmU5MTg4MDE5MmQyNGFmMjYzNjM3MTdkN2ViYTE3MmEzNTJjNzIz
15
+ ZDBmYzMxNmJjNGRkODc1ZWI3ZDgzNTg1MGIwOWI2Y2VjZTQ5NmE=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.30
1
+ 0.1.31
data/lib/communication.rb CHANGED
@@ -14,6 +14,7 @@ module MxHero
14
14
  end
15
15
  @client.set_auth(url, @username, @password)
16
16
  response = @client.request(method, url, nil, body, headers)
17
+ raise "Unauthorized" if response.status == 401
17
18
  unless more_options[:throw_exception] == false
18
19
  raise "An error ocurred when try to communicate with the API\nError: #{response.inspect}" if (500..600).include?(response.status)
19
20
  end
@@ -3,16 +3,18 @@ module MxHero::API
3
3
  class Domain < Resource
4
4
 
5
5
  attributes :domain, :server, :creation_date, :update_date,
6
- :aliases, :features, :cos, :cos_last_change
6
+ :aliases, :features, :cos, :cos_last_change, :metadata
7
7
 
8
8
  attribute :creation_date, map: 'creationDate', date: true
9
9
  attribute :update_date, map: 'updateDate', date: true
10
10
  attribute :cos_last_change, map: 'cosLastChange', date: true
11
+ attribute :metadata
11
12
 
12
13
  def initialize(data = {})
13
14
  super(data)
14
15
  load_features(features)
15
16
  load_cos(cos)
17
+ load_metadata
16
18
  end
17
19
 
18
20
  def change_to_trial
@@ -30,6 +32,11 @@ module MxHero::API
30
32
  def load_features(features)
31
33
  @features = features.map { |feature| Feature.new feature }
32
34
  end
35
+
36
+ def load_metadata
37
+ @metadata = JSON.parse(metadata) if metadata
38
+ end
39
+
33
40
  end
34
41
 
35
42
 
data/mxhero-api.gemspec CHANGED
@@ -1,13 +1,13 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: mxhero-api 0.1.30 ruby lib
2
+ # stub: mxhero-api 0.1.31 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "mxhero-api"
6
- s.version = "0.1.30"
6
+ s.version = "0.1.31"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Maximiliano Dello Russo", "Juan Pablo Royo", "mxHero"]
10
- s.date = "2014-03-07"
10
+ s.date = "2014-04-11"
11
11
  s.description = "A gem to provide easy access to the API of MxHero platform (http://www.mxhero.com/)"
12
12
  s.email = ["maxidr@mxhero.com", "juanpablo.royo@gmail.com", "mxhero@mxhero.com"]
13
13
  s.files = [".gitignore", ".rvmrc", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "VERSION", "lib/communication.rb", "lib/directories.rb", "lib/dto.rb", "lib/groups.rb", "lib/mxhero-api.rb", "lib/resource.rb", "lib/resources/account.rb", "lib/resources/domain.rb", "lib/resources/group.rb", "lib/urls.rb", "mxhero-api.gemspec", "test/fixtures/api/account_properties.yml", "test/fixtures/api/account_properties_not_found.yml", "test/fixtures/api/accounts.yml", "test/fixtures/api/accounts_filtered.yml", "test/fixtures/api/accounts_from_domain.yml", "test/fixtures/api/accounts_from_domain_paginated.yml", "test/fixtures/api/accounts_without_group.yml", "test/fixtures/api/add_an_inexistent_account_to_group.yml", "test/fixtures/api/add_and_remove_account.yml", "test/fixtures/api/all_groups.yml", "test/fixtures/api/create_directory.yml", "test/fixtures/api/create_rule_for_domain.yml", "test/fixtures/api/create_user.yml", "test/fixtures/api/delete_directory.yml", "test/fixtures/api/delete_group.yml", "test/fixtures/api/delete_rule.yml", "test/fixtures/api/domain_by_id.yml", "test/fixtures/api/domain_by_id_not_found.yml", "test/fixtures/api/domain_rule.yml", "test/fixtures/api/domains.yml", "test/fixtures/api/fetch_directory.yml", "test/fixtures/api/fetch_user.yml", "test/fixtures/api/ldap_info.yml", "test/fixtures/api/move_to_trial.yml", "test/fixtures/api/refresh_directory.yml", "test/fixtures/api/remove_account_from_group_twice.yml", "test/fixtures/api/remove_inexistente_account_from_group.yml", "test/fixtures/api/rules_for_domain.yml", "test/fixtures/api/rules_for_domain_by_component.yml", "test/fixtures/api/save_group.yml", "test/fixtures/api/system_properties.yml", "test/fixtures/api/system_properties_create.yml", "test/fixtures/api/system_properties_element.yml", "test/fixtures/api/test_domain.yml", "test/fixtures/api/update_account_properties.yml", "test/fixtures/api/update_accounts_group_scope.yml", "test/fixtures/api/update_accounts_properties_scope.yml", "test/fixtures/api/update_directory.yml", "test/fixtures/api/update_rule.yml", "test/fixtures/api/user_domains.yml", "test/fixtures/api/validate_user_credential.yml", "test/fixtures/domain.rb", "test/helper.rb", "test/test_directories.rb", "test/test_domain.rb", "test/test_dto.rb", "test/test_feature.rb", "test/test_groups.rb", "test/test_mxhero_api.rb", "test/test_mxhero_api_response.rb", "test/test_resource.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mxhero-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.30
4
+ version: 0.1.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximiliano Dello Russo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-07 00:00:00.000000000 Z
13
+ date: 2014-04-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: vcr