# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. require 'addressable/uri' require 'google/inflection' require 'google/api_client/discovery/resource' require 'google/api_client/discovery/method' require 'google/api_client/discovery/media' module Google class APIClient ## # A service that has been described by a discovery document. class API ## # Creates a description of a particular version of a service. # # @param [String] api # The identifier for the service. Note that while this frequently # matches the first segment of all of the service's RPC names, this # should not be assumed. There is no requirement that these match. # @param [String] version # The identifier for the service version. # @param [Hash] api_description # The section of the discovery document that applies to this service # version. # # @return [Google::APIClient::API] The constructed service object. def initialize(document_base, discovery_document) @document_base = Addressable::URI.parse(document_base) @discovery_document = discovery_document metaclass = (class <String representation of the service's state. # # @return [String] The service's state, as a String. def inspect sprintf( "#<%s:%#0x ID:%s>", self.class.to_s, self.object_id, self.id ) end end end end