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 +4 -4
 - data/lib/3scale_api/3scale/api.rb +25 -5
 - data/lib/3scale_api/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: b0f8796de5dcedb6331ec6b658438488735b3a12
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 32184f83d8f8c85e099614ab5f3ed90d5cd3fedb
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 08f1f3cd80b3f59664344a5dfb4c589340a2d2d986429d46537167a468fe6a37bd30e04e1a60d826d719ac710c523844b8da504495cf4ef34f844f02089153ed
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 859454221162e63d58a95026a9634229fc208a8c209a47e4b5a6245db53c8816127c99289efedfdafc071547604b8d412f43fe7e55b79e296ca40c7a8fd7a718
         
     | 
| 
         @@ -112,12 +112,32 @@ module Threescale 
     | 
|
| 
       112 
112 
     | 
    
         
             
                  end
         
     | 
| 
       113 
113 
     | 
    
         
             
                end
         
     | 
| 
       114 
114 
     | 
    
         | 
| 
       115 
     | 
    
         
            -
                 
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
      
 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. 
     | 
| 
      
 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)
         
     | 
    
        data/lib/3scale_api/version.rb
    CHANGED
    
    
    
        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. 
     | 
| 
      
 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- 
     | 
| 
      
 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:
         
     |