pnap_ip_api 1.0.0
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 +7 -0
 - data/Gemfile +9 -0
 - data/README.md +150 -0
 - data/Rakefile +10 -0
 - data/VERSION +1 -0
 - data/docs/DeleteIpBlockResult.md +20 -0
 - data/docs/Error.md +20 -0
 - data/docs/IPBlocksApi.md +360 -0
 - data/docs/IpBlock.md +32 -0
 - data/docs/IpBlockCreate.md +22 -0
 - data/docs/IpBlockPatch.md +18 -0
 - data/lib/pnap_ip_api/api/ip_blocks_api.rb +339 -0
 - data/lib/pnap_ip_api/api_client.rb +392 -0
 - data/lib/pnap_ip_api/api_error.rb +57 -0
 - data/lib/pnap_ip_api/configuration.rb +278 -0
 - data/lib/pnap_ip_api/models/delete_ip_block_result.rb +240 -0
 - data/lib/pnap_ip_api/models/error.rb +236 -0
 - data/lib/pnap_ip_api/models/ip_block.rb +330 -0
 - data/lib/pnap_ip_api/models/ip_block_create.rb +265 -0
 - data/lib/pnap_ip_api/models/ip_block_patch.rb +235 -0
 - data/lib/pnap_ip_api/version.rb +19 -0
 - data/lib/pnap_ip_api.rb +45 -0
 - data/pnap_ip_api.gemspec +39 -0
 - data/spec/api/ip_blocks_api_spec.rb +95 -0
 - data/spec/api_client_spec.rb +226 -0
 - data/spec/configuration_spec.rb +42 -0
 - data/spec/models/delete_ip_block_result_spec.rb +40 -0
 - data/spec/models/error_spec.rb +40 -0
 - data/spec/models/ip_block_create_spec.rb +46 -0
 - data/spec/models/ip_block_patch_spec.rb +34 -0
 - data/spec/models/ip_block_spec.rb +76 -0
 - data/spec/spec_helper.rb +111 -0
 - metadata +124 -0
 
| 
         @@ -0,0 +1,339 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 2 
     | 
    
         
            +
            #IP Addresses API
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            #Public IP blocks are a set of contiguous IPs that allow you to access your servers or networks from the internet. Use the IP Addresses API to request and delete IP blocks.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/public-ip-management#bmc-public-ip-allocations-api' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/ips/v1/)</b> 
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            The version of the OpenAPI document: 1.0
         
     | 
| 
      
 7 
     | 
    
         
            +
            Contact: support@phoenixnap.com
         
     | 
| 
      
 8 
     | 
    
         
            +
            Generated by: https://openapi-generator.tech
         
     | 
| 
      
 9 
     | 
    
         
            +
            OpenAPI Generator version: 5.4.0
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            =end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            require 'cgi'
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            module IpApi
         
     | 
| 
      
 16 
     | 
    
         
            +
              class IPBlocksApi
         
     | 
| 
      
 17 
     | 
    
         
            +
                attr_accessor :api_client
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                def initialize(api_client = ApiClient.default)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  @api_client = api_client
         
     | 
| 
      
 21 
     | 
    
         
            +
                end
         
     | 
| 
      
 22 
     | 
    
         
            +
                # List IP Blocks.
         
     | 
| 
      
 23 
     | 
    
         
            +
                # List all IP Blocks.
         
     | 
| 
      
 24 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 25 
     | 
    
         
            +
                # @return [Array<IpBlock>]
         
     | 
| 
      
 26 
     | 
    
         
            +
                def ip_blocks_get(opts = {})
         
     | 
| 
      
 27 
     | 
    
         
            +
                  data, _status_code, _headers = ip_blocks_get_with_http_info(opts)
         
     | 
| 
      
 28 
     | 
    
         
            +
                  data
         
     | 
| 
      
 29 
     | 
    
         
            +
                end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                # List IP Blocks.
         
     | 
| 
      
 32 
     | 
    
         
            +
                # List all IP Blocks.
         
     | 
| 
      
 33 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 34 
     | 
    
         
            +
                # @return [Array<(Array<IpBlock>, Integer, Hash)>] Array<IpBlock> data, response status code and response headers
         
     | 
| 
      
 35 
     | 
    
         
            +
                def ip_blocks_get_with_http_info(opts = {})
         
     | 
| 
      
 36 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 37 
     | 
    
         
            +
                    @api_client.config.logger.debug 'Calling API: IPBlocksApi.ip_blocks_get ...'
         
     | 
| 
      
 38 
     | 
    
         
            +
                  end
         
     | 
| 
      
 39 
     | 
    
         
            +
                  # resource path
         
     | 
| 
      
 40 
     | 
    
         
            +
                  local_var_path = '/ip-blocks'
         
     | 
| 
      
 41 
     | 
    
         
            +
             
     | 
| 
      
 42 
     | 
    
         
            +
                  # query parameters
         
     | 
| 
      
 43 
     | 
    
         
            +
                  query_params = opts[:query_params] || {}
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  # header parameters
         
     | 
| 
      
 46 
     | 
    
         
            +
                  header_params = opts[:header_params] || {}
         
     | 
| 
      
 47 
     | 
    
         
            +
                  # HTTP header 'Accept' (if needed)
         
     | 
| 
      
 48 
     | 
    
         
            +
                  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                  # form parameters
         
     | 
| 
      
 51 
     | 
    
         
            +
                  form_params = opts[:form_params] || {}
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                  # http body (model)
         
     | 
| 
      
 54 
     | 
    
         
            +
                  post_body = opts[:debug_body]
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
                  # return_type
         
     | 
| 
      
 57 
     | 
    
         
            +
                  return_type = opts[:debug_return_type] || 'Array<IpBlock>'
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
      
 59 
     | 
    
         
            +
                  # auth_names
         
     | 
| 
      
 60 
     | 
    
         
            +
                  auth_names = opts[:debug_auth_names] || ['OAuth2']
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
                  new_options = opts.merge(
         
     | 
| 
      
 63 
     | 
    
         
            +
                    :operation => :"IPBlocksApi.ip_blocks_get",
         
     | 
| 
      
 64 
     | 
    
         
            +
                    :header_params => header_params,
         
     | 
| 
      
 65 
     | 
    
         
            +
                    :query_params => query_params,
         
     | 
| 
      
 66 
     | 
    
         
            +
                    :form_params => form_params,
         
     | 
| 
      
 67 
     | 
    
         
            +
                    :body => post_body,
         
     | 
| 
      
 68 
     | 
    
         
            +
                    :auth_names => auth_names,
         
     | 
| 
      
 69 
     | 
    
         
            +
                    :return_type => return_type
         
     | 
| 
      
 70 
     | 
    
         
            +
                  )
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
                  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
         
     | 
| 
      
 73 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 74 
     | 
    
         
            +
                    @api_client.config.logger.debug "API called: IPBlocksApi#ip_blocks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
         
     | 
| 
      
 75 
     | 
    
         
            +
                  end
         
     | 
| 
      
 76 
     | 
    
         
            +
                  return data, status_code, headers
         
     | 
| 
      
 77 
     | 
    
         
            +
                end
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                # Delete IP Block.
         
     | 
| 
      
 80 
     | 
    
         
            +
                # Delete an IP Block. An IP Block can only be deleted if not assigned to any resource.
         
     | 
| 
      
 81 
     | 
    
         
            +
                # @param ip_block_id [String] The IP Block identifier.
         
     | 
| 
      
 82 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 83 
     | 
    
         
            +
                # @return [DeleteIpBlockResult]
         
     | 
| 
      
 84 
     | 
    
         
            +
                def ip_blocks_ip_block_id_delete(ip_block_id, opts = {})
         
     | 
| 
      
 85 
     | 
    
         
            +
                  data, _status_code, _headers = ip_blocks_ip_block_id_delete_with_http_info(ip_block_id, opts)
         
     | 
| 
      
 86 
     | 
    
         
            +
                  data
         
     | 
| 
      
 87 
     | 
    
         
            +
                end
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                # Delete IP Block.
         
     | 
| 
      
 90 
     | 
    
         
            +
                # Delete an IP Block. An IP Block can only be deleted if not assigned to any resource.
         
     | 
| 
      
 91 
     | 
    
         
            +
                # @param ip_block_id [String] The IP Block identifier.
         
     | 
| 
      
 92 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 93 
     | 
    
         
            +
                # @return [Array<(DeleteIpBlockResult, Integer, Hash)>] DeleteIpBlockResult data, response status code and response headers
         
     | 
| 
      
 94 
     | 
    
         
            +
                def ip_blocks_ip_block_id_delete_with_http_info(ip_block_id, opts = {})
         
     | 
| 
      
 95 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 96 
     | 
    
         
            +
                    @api_client.config.logger.debug 'Calling API: IPBlocksApi.ip_blocks_ip_block_id_delete ...'
         
     | 
| 
      
 97 
     | 
    
         
            +
                  end
         
     | 
| 
      
 98 
     | 
    
         
            +
                  # verify the required parameter 'ip_block_id' is set
         
     | 
| 
      
 99 
     | 
    
         
            +
                  if @api_client.config.client_side_validation && ip_block_id.nil?
         
     | 
| 
      
 100 
     | 
    
         
            +
                    fail ArgumentError, "Missing the required parameter 'ip_block_id' when calling IPBlocksApi.ip_blocks_ip_block_id_delete"
         
     | 
| 
      
 101 
     | 
    
         
            +
                  end
         
     | 
| 
      
 102 
     | 
    
         
            +
                  # resource path
         
     | 
| 
      
 103 
     | 
    
         
            +
                  local_var_path = '/ip-blocks/{ipBlockId}'.sub('{' + 'ipBlockId' + '}', CGI.escape(ip_block_id.to_s))
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                  # query parameters
         
     | 
| 
      
 106 
     | 
    
         
            +
                  query_params = opts[:query_params] || {}
         
     | 
| 
      
 107 
     | 
    
         
            +
             
     | 
| 
      
 108 
     | 
    
         
            +
                  # header parameters
         
     | 
| 
      
 109 
     | 
    
         
            +
                  header_params = opts[:header_params] || {}
         
     | 
| 
      
 110 
     | 
    
         
            +
                  # HTTP header 'Accept' (if needed)
         
     | 
| 
      
 111 
     | 
    
         
            +
                  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
                  # form parameters
         
     | 
| 
      
 114 
     | 
    
         
            +
                  form_params = opts[:form_params] || {}
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
                  # http body (model)
         
     | 
| 
      
 117 
     | 
    
         
            +
                  post_body = opts[:debug_body]
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
                  # return_type
         
     | 
| 
      
 120 
     | 
    
         
            +
                  return_type = opts[:debug_return_type] || 'DeleteIpBlockResult'
         
     | 
| 
      
 121 
     | 
    
         
            +
             
     | 
| 
      
 122 
     | 
    
         
            +
                  # auth_names
         
     | 
| 
      
 123 
     | 
    
         
            +
                  auth_names = opts[:debug_auth_names] || ['OAuth2']
         
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
      
 125 
     | 
    
         
            +
                  new_options = opts.merge(
         
     | 
| 
      
 126 
     | 
    
         
            +
                    :operation => :"IPBlocksApi.ip_blocks_ip_block_id_delete",
         
     | 
| 
      
 127 
     | 
    
         
            +
                    :header_params => header_params,
         
     | 
| 
      
 128 
     | 
    
         
            +
                    :query_params => query_params,
         
     | 
| 
      
 129 
     | 
    
         
            +
                    :form_params => form_params,
         
     | 
| 
      
 130 
     | 
    
         
            +
                    :body => post_body,
         
     | 
| 
      
 131 
     | 
    
         
            +
                    :auth_names => auth_names,
         
     | 
| 
      
 132 
     | 
    
         
            +
                    :return_type => return_type
         
     | 
| 
      
 133 
     | 
    
         
            +
                  )
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
                  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
         
     | 
| 
      
 136 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 137 
     | 
    
         
            +
                    @api_client.config.logger.debug "API called: IPBlocksApi#ip_blocks_ip_block_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
         
     | 
| 
      
 138 
     | 
    
         
            +
                  end
         
     | 
| 
      
 139 
     | 
    
         
            +
                  return data, status_code, headers
         
     | 
| 
      
 140 
     | 
    
         
            +
                end
         
     | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
      
 142 
     | 
    
         
            +
                # Get IP Block.
         
     | 
| 
      
 143 
     | 
    
         
            +
                # Get IP Block.
         
     | 
| 
      
 144 
     | 
    
         
            +
                # @param ip_block_id [String] The IP Block identifier.
         
     | 
| 
      
 145 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 146 
     | 
    
         
            +
                # @return [IpBlock]
         
     | 
| 
      
 147 
     | 
    
         
            +
                def ip_blocks_ip_block_id_get(ip_block_id, opts = {})
         
     | 
| 
      
 148 
     | 
    
         
            +
                  data, _status_code, _headers = ip_blocks_ip_block_id_get_with_http_info(ip_block_id, opts)
         
     | 
| 
      
 149 
     | 
    
         
            +
                  data
         
     | 
| 
      
 150 
     | 
    
         
            +
                end
         
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
                # Get IP Block.
         
     | 
| 
      
 153 
     | 
    
         
            +
                # Get IP Block.
         
     | 
| 
      
 154 
     | 
    
         
            +
                # @param ip_block_id [String] The IP Block identifier.
         
     | 
| 
      
 155 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 156 
     | 
    
         
            +
                # @return [Array<(IpBlock, Integer, Hash)>] IpBlock data, response status code and response headers
         
     | 
| 
      
 157 
     | 
    
         
            +
                def ip_blocks_ip_block_id_get_with_http_info(ip_block_id, opts = {})
         
     | 
| 
      
 158 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 159 
     | 
    
         
            +
                    @api_client.config.logger.debug 'Calling API: IPBlocksApi.ip_blocks_ip_block_id_get ...'
         
     | 
| 
      
 160 
     | 
    
         
            +
                  end
         
     | 
| 
      
 161 
     | 
    
         
            +
                  # verify the required parameter 'ip_block_id' is set
         
     | 
| 
      
 162 
     | 
    
         
            +
                  if @api_client.config.client_side_validation && ip_block_id.nil?
         
     | 
| 
      
 163 
     | 
    
         
            +
                    fail ArgumentError, "Missing the required parameter 'ip_block_id' when calling IPBlocksApi.ip_blocks_ip_block_id_get"
         
     | 
| 
      
 164 
     | 
    
         
            +
                  end
         
     | 
| 
      
 165 
     | 
    
         
            +
                  # resource path
         
     | 
| 
      
 166 
     | 
    
         
            +
                  local_var_path = '/ip-blocks/{ipBlockId}'.sub('{' + 'ipBlockId' + '}', CGI.escape(ip_block_id.to_s))
         
     | 
| 
      
 167 
     | 
    
         
            +
             
     | 
| 
      
 168 
     | 
    
         
            +
                  # query parameters
         
     | 
| 
      
 169 
     | 
    
         
            +
                  query_params = opts[:query_params] || {}
         
     | 
| 
      
 170 
     | 
    
         
            +
             
     | 
| 
      
 171 
     | 
    
         
            +
                  # header parameters
         
     | 
| 
      
 172 
     | 
    
         
            +
                  header_params = opts[:header_params] || {}
         
     | 
| 
      
 173 
     | 
    
         
            +
                  # HTTP header 'Accept' (if needed)
         
     | 
| 
      
 174 
     | 
    
         
            +
                  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
         
     | 
| 
      
 175 
     | 
    
         
            +
             
     | 
| 
      
 176 
     | 
    
         
            +
                  # form parameters
         
     | 
| 
      
 177 
     | 
    
         
            +
                  form_params = opts[:form_params] || {}
         
     | 
| 
      
 178 
     | 
    
         
            +
             
     | 
| 
      
 179 
     | 
    
         
            +
                  # http body (model)
         
     | 
| 
      
 180 
     | 
    
         
            +
                  post_body = opts[:debug_body]
         
     | 
| 
      
 181 
     | 
    
         
            +
             
     | 
| 
      
 182 
     | 
    
         
            +
                  # return_type
         
     | 
| 
      
 183 
     | 
    
         
            +
                  return_type = opts[:debug_return_type] || 'IpBlock'
         
     | 
| 
      
 184 
     | 
    
         
            +
             
     | 
| 
      
 185 
     | 
    
         
            +
                  # auth_names
         
     | 
| 
      
 186 
     | 
    
         
            +
                  auth_names = opts[:debug_auth_names] || ['OAuth2']
         
     | 
| 
      
 187 
     | 
    
         
            +
             
     | 
| 
      
 188 
     | 
    
         
            +
                  new_options = opts.merge(
         
     | 
| 
      
 189 
     | 
    
         
            +
                    :operation => :"IPBlocksApi.ip_blocks_ip_block_id_get",
         
     | 
| 
      
 190 
     | 
    
         
            +
                    :header_params => header_params,
         
     | 
| 
      
 191 
     | 
    
         
            +
                    :query_params => query_params,
         
     | 
| 
      
 192 
     | 
    
         
            +
                    :form_params => form_params,
         
     | 
| 
      
 193 
     | 
    
         
            +
                    :body => post_body,
         
     | 
| 
      
 194 
     | 
    
         
            +
                    :auth_names => auth_names,
         
     | 
| 
      
 195 
     | 
    
         
            +
                    :return_type => return_type
         
     | 
| 
      
 196 
     | 
    
         
            +
                  )
         
     | 
| 
      
 197 
     | 
    
         
            +
             
     | 
| 
      
 198 
     | 
    
         
            +
                  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
         
     | 
| 
      
 199 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 200 
     | 
    
         
            +
                    @api_client.config.logger.debug "API called: IPBlocksApi#ip_blocks_ip_block_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
         
     | 
| 
      
 201 
     | 
    
         
            +
                  end
         
     | 
| 
      
 202 
     | 
    
         
            +
                  return data, status_code, headers
         
     | 
| 
      
 203 
     | 
    
         
            +
                end
         
     | 
| 
      
 204 
     | 
    
         
            +
             
     | 
| 
      
 205 
     | 
    
         
            +
                # Update IP block.
         
     | 
| 
      
 206 
     | 
    
         
            +
                # Update IP Block's details.
         
     | 
| 
      
 207 
     | 
    
         
            +
                # @param ip_block_id [String] The IP Block identifier.
         
     | 
| 
      
 208 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 209 
     | 
    
         
            +
                # @option opts [IpBlockPatch] :ip_block_patch 
         
     | 
| 
      
 210 
     | 
    
         
            +
                # @return [IpBlock]
         
     | 
| 
      
 211 
     | 
    
         
            +
                def ip_blocks_ip_block_id_patch(ip_block_id, opts = {})
         
     | 
| 
      
 212 
     | 
    
         
            +
                  data, _status_code, _headers = ip_blocks_ip_block_id_patch_with_http_info(ip_block_id, opts)
         
     | 
| 
      
 213 
     | 
    
         
            +
                  data
         
     | 
| 
      
 214 
     | 
    
         
            +
                end
         
     | 
| 
      
 215 
     | 
    
         
            +
             
     | 
| 
      
 216 
     | 
    
         
            +
                # Update IP block.
         
     | 
| 
      
 217 
     | 
    
         
            +
                # Update IP Block's details.
         
     | 
| 
      
 218 
     | 
    
         
            +
                # @param ip_block_id [String] The IP Block identifier.
         
     | 
| 
      
 219 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 220 
     | 
    
         
            +
                # @option opts [IpBlockPatch] :ip_block_patch 
         
     | 
| 
      
 221 
     | 
    
         
            +
                # @return [Array<(IpBlock, Integer, Hash)>] IpBlock data, response status code and response headers
         
     | 
| 
      
 222 
     | 
    
         
            +
                def ip_blocks_ip_block_id_patch_with_http_info(ip_block_id, opts = {})
         
     | 
| 
      
 223 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 224 
     | 
    
         
            +
                    @api_client.config.logger.debug 'Calling API: IPBlocksApi.ip_blocks_ip_block_id_patch ...'
         
     | 
| 
      
 225 
     | 
    
         
            +
                  end
         
     | 
| 
      
 226 
     | 
    
         
            +
                  # verify the required parameter 'ip_block_id' is set
         
     | 
| 
      
 227 
     | 
    
         
            +
                  if @api_client.config.client_side_validation && ip_block_id.nil?
         
     | 
| 
      
 228 
     | 
    
         
            +
                    fail ArgumentError, "Missing the required parameter 'ip_block_id' when calling IPBlocksApi.ip_blocks_ip_block_id_patch"
         
     | 
| 
      
 229 
     | 
    
         
            +
                  end
         
     | 
| 
      
 230 
     | 
    
         
            +
                  # resource path
         
     | 
| 
      
 231 
     | 
    
         
            +
                  local_var_path = '/ip-blocks/{ipBlockId}'.sub('{' + 'ipBlockId' + '}', CGI.escape(ip_block_id.to_s))
         
     | 
| 
      
 232 
     | 
    
         
            +
             
     | 
| 
      
 233 
     | 
    
         
            +
                  # query parameters
         
     | 
| 
      
 234 
     | 
    
         
            +
                  query_params = opts[:query_params] || {}
         
     | 
| 
      
 235 
     | 
    
         
            +
             
     | 
| 
      
 236 
     | 
    
         
            +
                  # header parameters
         
     | 
| 
      
 237 
     | 
    
         
            +
                  header_params = opts[:header_params] || {}
         
     | 
| 
      
 238 
     | 
    
         
            +
                  # HTTP header 'Accept' (if needed)
         
     | 
| 
      
 239 
     | 
    
         
            +
                  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
         
     | 
| 
      
 240 
     | 
    
         
            +
                  # HTTP header 'Content-Type'
         
     | 
| 
      
 241 
     | 
    
         
            +
                  content_type = @api_client.select_header_content_type(['application/json'])
         
     | 
| 
      
 242 
     | 
    
         
            +
                  if !content_type.nil?
         
     | 
| 
      
 243 
     | 
    
         
            +
                      header_params['Content-Type'] = content_type
         
     | 
| 
      
 244 
     | 
    
         
            +
                  end
         
     | 
| 
      
 245 
     | 
    
         
            +
             
     | 
| 
      
 246 
     | 
    
         
            +
                  # form parameters
         
     | 
| 
      
 247 
     | 
    
         
            +
                  form_params = opts[:form_params] || {}
         
     | 
| 
      
 248 
     | 
    
         
            +
             
     | 
| 
      
 249 
     | 
    
         
            +
                  # http body (model)
         
     | 
| 
      
 250 
     | 
    
         
            +
                  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ip_block_patch'])
         
     | 
| 
      
 251 
     | 
    
         
            +
             
     | 
| 
      
 252 
     | 
    
         
            +
                  # return_type
         
     | 
| 
      
 253 
     | 
    
         
            +
                  return_type = opts[:debug_return_type] || 'IpBlock'
         
     | 
| 
      
 254 
     | 
    
         
            +
             
     | 
| 
      
 255 
     | 
    
         
            +
                  # auth_names
         
     | 
| 
      
 256 
     | 
    
         
            +
                  auth_names = opts[:debug_auth_names] || ['OAuth2']
         
     | 
| 
      
 257 
     | 
    
         
            +
             
     | 
| 
      
 258 
     | 
    
         
            +
                  new_options = opts.merge(
         
     | 
| 
      
 259 
     | 
    
         
            +
                    :operation => :"IPBlocksApi.ip_blocks_ip_block_id_patch",
         
     | 
| 
      
 260 
     | 
    
         
            +
                    :header_params => header_params,
         
     | 
| 
      
 261 
     | 
    
         
            +
                    :query_params => query_params,
         
     | 
| 
      
 262 
     | 
    
         
            +
                    :form_params => form_params,
         
     | 
| 
      
 263 
     | 
    
         
            +
                    :body => post_body,
         
     | 
| 
      
 264 
     | 
    
         
            +
                    :auth_names => auth_names,
         
     | 
| 
      
 265 
     | 
    
         
            +
                    :return_type => return_type
         
     | 
| 
      
 266 
     | 
    
         
            +
                  )
         
     | 
| 
      
 267 
     | 
    
         
            +
             
     | 
| 
      
 268 
     | 
    
         
            +
                  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
         
     | 
| 
      
 269 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 270 
     | 
    
         
            +
                    @api_client.config.logger.debug "API called: IPBlocksApi#ip_blocks_ip_block_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
         
     | 
| 
      
 271 
     | 
    
         
            +
                  end
         
     | 
| 
      
 272 
     | 
    
         
            +
                  return data, status_code, headers
         
     | 
| 
      
 273 
     | 
    
         
            +
                end
         
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
                # Create an IP Block.
         
     | 
| 
      
 276 
     | 
    
         
            +
                # Request an IP Block. An IP Block is a set of contiguous IPs that can be assigned to other resources such as servers.
         
     | 
| 
      
 277 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 278 
     | 
    
         
            +
                # @option opts [IpBlockCreate] :ip_block_create 
         
     | 
| 
      
 279 
     | 
    
         
            +
                # @return [IpBlock]
         
     | 
| 
      
 280 
     | 
    
         
            +
                def ip_blocks_post(opts = {})
         
     | 
| 
      
 281 
     | 
    
         
            +
                  data, _status_code, _headers = ip_blocks_post_with_http_info(opts)
         
     | 
| 
      
 282 
     | 
    
         
            +
                  data
         
     | 
| 
      
 283 
     | 
    
         
            +
                end
         
     | 
| 
      
 284 
     | 
    
         
            +
             
     | 
| 
      
 285 
     | 
    
         
            +
                # Create an IP Block.
         
     | 
| 
      
 286 
     | 
    
         
            +
                # Request an IP Block. An IP Block is a set of contiguous IPs that can be assigned to other resources such as servers.
         
     | 
| 
      
 287 
     | 
    
         
            +
                # @param [Hash] opts the optional parameters
         
     | 
| 
      
 288 
     | 
    
         
            +
                # @option opts [IpBlockCreate] :ip_block_create 
         
     | 
| 
      
 289 
     | 
    
         
            +
                # @return [Array<(IpBlock, Integer, Hash)>] IpBlock data, response status code and response headers
         
     | 
| 
      
 290 
     | 
    
         
            +
                def ip_blocks_post_with_http_info(opts = {})
         
     | 
| 
      
 291 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 292 
     | 
    
         
            +
                    @api_client.config.logger.debug 'Calling API: IPBlocksApi.ip_blocks_post ...'
         
     | 
| 
      
 293 
     | 
    
         
            +
                  end
         
     | 
| 
      
 294 
     | 
    
         
            +
                  # resource path
         
     | 
| 
      
 295 
     | 
    
         
            +
                  local_var_path = '/ip-blocks'
         
     | 
| 
      
 296 
     | 
    
         
            +
             
     | 
| 
      
 297 
     | 
    
         
            +
                  # query parameters
         
     | 
| 
      
 298 
     | 
    
         
            +
                  query_params = opts[:query_params] || {}
         
     | 
| 
      
 299 
     | 
    
         
            +
             
     | 
| 
      
 300 
     | 
    
         
            +
                  # header parameters
         
     | 
| 
      
 301 
     | 
    
         
            +
                  header_params = opts[:header_params] || {}
         
     | 
| 
      
 302 
     | 
    
         
            +
                  # HTTP header 'Accept' (if needed)
         
     | 
| 
      
 303 
     | 
    
         
            +
                  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
         
     | 
| 
      
 304 
     | 
    
         
            +
                  # HTTP header 'Content-Type'
         
     | 
| 
      
 305 
     | 
    
         
            +
                  content_type = @api_client.select_header_content_type(['application/json'])
         
     | 
| 
      
 306 
     | 
    
         
            +
                  if !content_type.nil?
         
     | 
| 
      
 307 
     | 
    
         
            +
                      header_params['Content-Type'] = content_type
         
     | 
| 
      
 308 
     | 
    
         
            +
                  end
         
     | 
| 
      
 309 
     | 
    
         
            +
             
     | 
| 
      
 310 
     | 
    
         
            +
                  # form parameters
         
     | 
| 
      
 311 
     | 
    
         
            +
                  form_params = opts[:form_params] || {}
         
     | 
| 
      
 312 
     | 
    
         
            +
             
     | 
| 
      
 313 
     | 
    
         
            +
                  # http body (model)
         
     | 
| 
      
 314 
     | 
    
         
            +
                  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'ip_block_create'])
         
     | 
| 
      
 315 
     | 
    
         
            +
             
     | 
| 
      
 316 
     | 
    
         
            +
                  # return_type
         
     | 
| 
      
 317 
     | 
    
         
            +
                  return_type = opts[:debug_return_type] || 'IpBlock'
         
     | 
| 
      
 318 
     | 
    
         
            +
             
     | 
| 
      
 319 
     | 
    
         
            +
                  # auth_names
         
     | 
| 
      
 320 
     | 
    
         
            +
                  auth_names = opts[:debug_auth_names] || ['OAuth2']
         
     | 
| 
      
 321 
     | 
    
         
            +
             
     | 
| 
      
 322 
     | 
    
         
            +
                  new_options = opts.merge(
         
     | 
| 
      
 323 
     | 
    
         
            +
                    :operation => :"IPBlocksApi.ip_blocks_post",
         
     | 
| 
      
 324 
     | 
    
         
            +
                    :header_params => header_params,
         
     | 
| 
      
 325 
     | 
    
         
            +
                    :query_params => query_params,
         
     | 
| 
      
 326 
     | 
    
         
            +
                    :form_params => form_params,
         
     | 
| 
      
 327 
     | 
    
         
            +
                    :body => post_body,
         
     | 
| 
      
 328 
     | 
    
         
            +
                    :auth_names => auth_names,
         
     | 
| 
      
 329 
     | 
    
         
            +
                    :return_type => return_type
         
     | 
| 
      
 330 
     | 
    
         
            +
                  )
         
     | 
| 
      
 331 
     | 
    
         
            +
             
     | 
| 
      
 332 
     | 
    
         
            +
                  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
         
     | 
| 
      
 333 
     | 
    
         
            +
                  if @api_client.config.debugging
         
     | 
| 
      
 334 
     | 
    
         
            +
                    @api_client.config.logger.debug "API called: IPBlocksApi#ip_blocks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
         
     | 
| 
      
 335 
     | 
    
         
            +
                  end
         
     | 
| 
      
 336 
     | 
    
         
            +
                  return data, status_code, headers
         
     | 
| 
      
 337 
     | 
    
         
            +
                end
         
     | 
| 
      
 338 
     | 
    
         
            +
              end
         
     | 
| 
      
 339 
     | 
    
         
            +
            end
         
     |