=begin
#Telstra Programmable Network API

#Telstra Programmable Network is a self-provisioning platform that allows its users to create on-demand connectivity services between multiple end-points and add various network functions to those services. Programmable Network enables to connectivity to a global ecosystem of networking services as well as public and private cloud services. Once you are connected to the platform on one or more POPs (points of presence), you can start creating those services based on the use case that you want to accomplish. The Programmable Network API is available to all customers who have registered to use the Programmable Network. To register, please contact your account representative.

OpenAPI spec version: 2.4.2
Contact: pnapi-support@team.telstra.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 3.1.2

=end

require 'uri'

module TelstraTPN
  class TopologiesApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end
    # Assign an Endpoint to a Topology
    # @param endpointuuid Unique identifier representing a specific endpoint
    # @param [Hash] opts the optional parameters
    # @option opts [Assigntopotagrequest] :assigntopotagrequest 
    # @return [SuccessFragment]
    def endpoints_assign_topology_tag(endpointuuid, opts = {})
      data, _status_code, _headers = endpoints_assign_topology_tag_with_http_info(endpointuuid, opts)
      data
    end

    # Assign an Endpoint to a Topology
    # @param endpointuuid Unique identifier representing a specific endpoint
    # @param [Hash] opts the optional parameters
    # @option opts [Assigntopotagrequest] :assigntopotagrequest 
    # @return [Array<(SuccessFragment, Fixnum, Hash)>] SuccessFragment data, response status code and response headers
    def endpoints_assign_topology_tag_with_http_info(endpointuuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.endpoints_assign_topology_tag ...'
      end
      # verify the required parameter 'endpointuuid' is set
      if @api_client.config.client_side_validation && endpointuuid.nil?
        fail ArgumentError, "Missing the required parameter 'endpointuuid' when calling TopologiesApi.endpoints_assign_topology_tag"
      end
      # resource path
      local_var_path = '/eis/1.0.0/endpoints/{endpointuuid}/assign_topology_tag'.sub('{' + 'endpointuuid' + '}', endpointuuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(opts[:'assigntopotagrequest'])
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'SuccessFragment')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#endpoints_assign_topology_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # List Endpoints for Topology
    # List all Endpoints associated with the topology tag.
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse20014]
    def endpoints_topology_tag_uuid(topotaguuid, opts = {})
      data, _status_code, _headers = endpoints_topology_tag_uuid_with_http_info(topotaguuid, opts)
      data
    end

    # List Endpoints for Topology
    # List all Endpoints associated with the topology tag.
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse20014, Fixnum, Hash)>] InlineResponse20014 data, response status code and response headers
    def endpoints_topology_tag_uuid_with_http_info(topotaguuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.endpoints_topology_tag_uuid ...'
      end
      # verify the required parameter 'topotaguuid' is set
      if @api_client.config.client_side_validation && topotaguuid.nil?
        fail ArgumentError, "Missing the required parameter 'topotaguuid' when calling TopologiesApi.endpoints_topology_tag_uuid"
      end
      # resource path
      local_var_path = '/eis/1.0.0/endpoints/topology_tag_uuid/{topotaguuid}'.sub('{' + 'topotaguuid' + '}', topotaguuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'InlineResponse20014')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#endpoints_topology_tag_uuid\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Remove Endpoint from a Topology
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param endpointuuid Unique identifier representing a specific endpoint
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def endpoints_topology_tag_uuid_endpoint(topotaguuid, endpointuuid, opts = {})
      endpoints_topology_tag_uuid_endpoint_with_http_info(topotaguuid, endpointuuid, opts)
      nil
    end

    # Remove Endpoint from a Topology
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param endpointuuid Unique identifier representing a specific endpoint
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def endpoints_topology_tag_uuid_endpoint_with_http_info(topotaguuid, endpointuuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.endpoints_topology_tag_uuid_endpoint ...'
      end
      # verify the required parameter 'topotaguuid' is set
      if @api_client.config.client_side_validation && topotaguuid.nil?
        fail ArgumentError, "Missing the required parameter 'topotaguuid' when calling TopologiesApi.endpoints_topology_tag_uuid_endpoint"
      end
      # verify the required parameter 'endpointuuid' is set
      if @api_client.config.client_side_validation && endpointuuid.nil?
        fail ArgumentError, "Missing the required parameter 'endpointuuid' when calling TopologiesApi.endpoints_topology_tag_uuid_endpoint"
      end
      # resource path
      local_var_path = '/eis/1.0.0/endpoints/topology_tag_uuid/{topotaguuid}/endpoint/{endpointuuid}'.sub('{' + 'topotaguuid' + '}', topotaguuid.to_s).sub('{' + 'endpointuuid' + '}', endpointuuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#endpoints_topology_tag_uuid_endpoint\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # List all topology tags
    # @param [Hash] opts the optional parameters
    # @return [Array<Topology>]
    def topology_tag_get(opts = {})
      data, _status_code, _headers = topology_tag_get_with_http_info(opts)
      data
    end

    # List all topology tags
    # @param [Hash] opts the optional parameters
    # @return [Array<(Array<Topology>, Fixnum, Hash)>] Array<Topology> data, response status code and response headers
    def topology_tag_get_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.topology_tag_get ...'
      end
      # resource path
      local_var_path = '/ttms/1.0.0/topology_tag'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Array<Topology>')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#topology_tag_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # List objects for Topology
    # List all objects (Endpoints, Links, VPorts, etc.) associated with the topology tag.
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [InlineResponse20013]
    def topology_tag_objects(topotaguuid, opts = {})
      data, _status_code, _headers = topology_tag_objects_with_http_info(topotaguuid, opts)
      data
    end

    # List objects for Topology
    # List all objects (Endpoints, Links, VPorts, etc.) associated with the topology tag.
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [Array<(InlineResponse20013, Fixnum, Hash)>] InlineResponse20013 data, response status code and response headers
    def topology_tag_objects_with_http_info(topotaguuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.topology_tag_objects ...'
      end
      # verify the required parameter 'topotaguuid' is set
      if @api_client.config.client_side_validation && topotaguuid.nil?
        fail ArgumentError, "Missing the required parameter 'topotaguuid' when calling TopologiesApi.topology_tag_objects"
      end
      # resource path
      local_var_path = '/ttms/1.0.0/topology_tag/{topotaguuid}/objects/'.sub('{' + 'topotaguuid' + '}', topotaguuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'InlineResponse20013')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#topology_tag_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Create a named topology tag
    # @param [Hash] opts the optional parameters
    # @option opts [Topotagcreaterequest] :topotagcreaterequest 
    # @return [Topology]
    def topology_tag_post(opts = {})
      data, _status_code, _headers = topology_tag_post_with_http_info(opts)
      data
    end

    # Create a named topology tag
    # @param [Hash] opts the optional parameters
    # @option opts [Topotagcreaterequest] :topotagcreaterequest 
    # @return [Array<(Topology, Fixnum, Hash)>] Topology data, response status code and response headers
    def topology_tag_post_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.topology_tag_post ...'
      end
      # resource path
      local_var_path = '/ttms/1.0.0/topology_tag'

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(opts[:'topotagcreaterequest'])
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Topology')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#topology_tag_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Delete a topology tag
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def topology_tag_uuid_delete(topotaguuid, opts = {})
      topology_tag_uuid_delete_with_http_info(topotaguuid, opts)
      nil
    end

    # Delete a topology tag
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def topology_tag_uuid_delete_with_http_info(topotaguuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.topology_tag_uuid_delete ...'
      end
      # verify the required parameter 'topotaguuid' is set
      if @api_client.config.client_side_validation && topotaguuid.nil?
        fail ArgumentError, "Missing the required parameter 'topotaguuid' when calling TopologiesApi.topology_tag_uuid_delete"
      end
      # resource path
      local_var_path = '/ttms/1.0.0/topology_tag/{topotaguuid}/'.sub('{' + 'topotaguuid' + '}', topotaguuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#topology_tag_uuid_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Get information about the specified topology tag
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [Topology]
    def topology_tag_uuid_get(topotaguuid, opts = {})
      data, _status_code, _headers = topology_tag_uuid_get_with_http_info(topotaguuid, opts)
      data
    end

    # Get information about the specified topology tag
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @return [Array<(Topology, Fixnum, Hash)>] Topology data, response status code and response headers
    def topology_tag_uuid_get_with_http_info(topotaguuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.topology_tag_uuid_get ...'
      end
      # verify the required parameter 'topotaguuid' is set
      if @api_client.config.client_side_validation && topotaguuid.nil?
        fail ArgumentError, "Missing the required parameter 'topotaguuid' when calling TopologiesApi.topology_tag_uuid_get"
      end
      # resource path
      local_var_path = '/ttms/1.0.0/topology_tag/{topotaguuid}/'.sub('{' + 'topotaguuid' + '}', topotaguuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Topology')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#topology_tag_uuid_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
    # Update a topology tag's name and/or description
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @option opts [Topotagupdateresponse] :topotagupdateresponse 
    # @return [Topology]
    def topology_tag_uuid_put(topotaguuid, opts = {})
      data, _status_code, _headers = topology_tag_uuid_put_with_http_info(topotaguuid, opts)
      data
    end

    # Update a topology tag&#39;s name and/or description
    # @param topotaguuid Unique identifier representing a specific topology tag
    # @param [Hash] opts the optional parameters
    # @option opts [Topotagupdateresponse] :topotagupdateresponse 
    # @return [Array<(Topology, Fixnum, Hash)>] Topology data, response status code and response headers
    def topology_tag_uuid_put_with_http_info(topotaguuid, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: TopologiesApi.topology_tag_uuid_put ...'
      end
      # verify the required parameter 'topotaguuid' is set
      if @api_client.config.client_side_validation && topotaguuid.nil?
        fail ArgumentError, "Missing the required parameter 'topotaguuid' when calling TopologiesApi.topology_tag_uuid_put"
      end
      # resource path
      local_var_path = '/ttms/1.0.0/topology_tag/{topotaguuid}/'.sub('{' + 'topotaguuid' + '}', topotaguuid.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(opts[:'topotagupdateresponse'])
      auth_names = ['oAuth2']
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Topology')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: TopologiesApi#topology_tag_uuid_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
