gapic-generator/lib/gapic/schema/service_config_parser.rb
def parse_service_yaml service_yaml_text
          return nil unless service_yaml_text && !service_yaml_text.empty?
          service_yaml = YAML.safe_load service_yaml_text
          service = Google::Api::Service.new

          if service_yaml.key? CONFIG_VERSION_KEY
            config_ver = Google::Protobuf::UInt32Value.new
            config_ver.value = service_yaml[CONFIG_VERSION_KEY]
            service.config_version = config_ver
          end

          service.name = service_yaml[NAME_KEY] if service_yaml.key? NAME_KEY
          service.id = service_yaml[ID_KEY] if service_yaml.key? ID_KEY
          service.title = service_yaml[TITLE_KEY] if service_yaml.key? TITLE_KEY

          service.apis = parse_apis service_yaml[APIS_KEY] if service_yaml.key? APIS_KEY
          service.http = parse_http service_yaml[HTTP_KEY] if service_yaml.key? HTTP_KEY
          service
        end
##
# Returns the parsed Google::Api::Service object.
# Only supports a limited subset of fields.
#
# @return [::Google::Api::Service]
#
Returns the parsed Google::Api::Service object.
Only supports a limited subset of fields.
Returns the parsed Google :: Api :: Service object . Only supports a limited subset of fields .
def parse_service_yaml service_yaml_text
          return nil unless service_yaml_text && !service_yaml_text.empty?
          service_yaml = YAML.safe_load service_yaml_text
          service = Google::Api::Service.new
          if service_yaml.key? CONFIG_VERSION_KEY
            config_ver = Google::Protobuf::UInt32Value.new
            config_ver.value = service_yaml[CONFIG_VERSION_KEY]
            service.config_version = config_ver
          end
          service.name = service_yaml[NAME_KEY] if service_yaml.key? NAME_KEY
          service.id = service_yaml[ID_KEY] if service_yaml.key? ID_KEY
          service.title = service_yaml[TITLE_KEY] if service_yaml.key? TITLE_KEY
          service.apis = parse_apis service_yaml[APIS_KEY] if service_yaml.key? APIS_KEY
          service.http = parse_http service_yaml[HTTP_KEY] if service_yaml.key? HTTP_KEY
          service
        end
def parse_service_yaml service_yaml_text return nil unless service_yaml_text && ! service_yaml_text . empty? service_yaml = YAML . safe_load service_yaml_text service = Google :: Api :: Service . new if service_yaml . key? CONFIG_VERSION_KEY config_ver = Google :: Protobuf :: UInt32Value . new config_ver . value = service_yaml [ CONFIG_VERSION_KEY ] service . config_version = config_ver end service . name = service_yaml [ NAME_KEY ] if service_yaml . key? NAME_KEY service . id = service_yaml [ ID_KEY ] if service_yaml . key? ID_KEY service . title = service_yaml [ TITLE_KEY ] if service_yaml . key? TITLE_KEY service . apis = parse_apis service_yaml [ APIS_KEY ] if service_yaml . key? APIS_KEY service . http = parse_http service_yaml [ HTTP_KEY ] if service_yaml . key? HTTP_KEY service end
Returns the parsed Google::Api::Service object.
Returns the parsed Google :: Api :: Service object .
None
::Google::Api::Service
service_yaml_text