Class: Google::Apis::ApigeeregistryV1::ApiSpec

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/apigeeregistry_v1/classes.rb,
lib/google/apis/apigeeregistry_v1/representations.rb,
lib/google/apis/apigeeregistry_v1/representations.rb

Overview

Describes a version of an API in a structured way. ApiSpecs provide formal descriptions that consumers can use to use a version. ApiSpec resources are intended to be fully-resolved descriptions of an ApiVersion. When specs consist of multiple files, these should be bundled together (e.g., in a zip archive) and stored as a unit. Multiple specs can exist to provide representations in different API description formats. Synchronization of these representations would be provided by tooling and background services.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ApiSpec

Returns a new instance of ApiSpec.



342
343
344
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 342

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#annotationsHash<String,String>

Annotations attach non-identifying metadata to resources. Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts. Corresponds to the JSON property annotations

Returns:

  • (Hash<String,String>)


250
251
252
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 250

def annotations
  @annotations
end

#contentsString

Input only. The contents of the spec. Provided by API callers when specs are created or updated. To access the contents of a spec, use GetApiSpecContents. Corresponds to the JSON property contents NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


257
258
259
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 257

def contents
  @contents
end

#create_timeString

Output only. Creation timestamp; when the spec resource was created. Corresponds to the JSON property createTime

Returns:

  • (String)


262
263
264
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 262

def create_time
  @create_time
end

#descriptionString

A detailed description. Corresponds to the JSON property description

Returns:

  • (String)


267
268
269
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 267

def description
  @description
end

#filenameString

A possibly-hierarchical name used to refer to the spec from other specs. Corresponds to the JSON property filename

Returns:

  • (String)


272
273
274
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 272

def filename
  @filename
end

#hash_propString

Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is the hash of the uncompressed spec. Corresponds to the JSON property hash

Returns:

  • (String)


278
279
280
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 278

def hash_prop
  @hash_prop
end

#labelsHash<String,String>

Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry. googleapis.com/ and cannot be changed. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


290
291
292
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 290

def labels
  @labels
end

#mime_typeString

A style (format) descriptor for this spec that is specified as a Media Type. Possible values include application/vnd.apigee.proto, application/vnd.apigee.openapi, and application/vnd.apigee.graphql, with possible suffixes representing compression types. These hypothetical names are defined in the vendor tree defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. Content types can specify compression. Currently only GZip compression is supported (indicated with "+gzip"). Corresponds to the JSON property mimeType

Returns:

  • (String)


302
303
304
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 302

def mime_type
  @mime_type
end

#nameString

Resource name. Corresponds to the JSON property name

Returns:

  • (String)


307
308
309
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 307

def name
  @name
end

#revision_create_timeString

Output only. Revision creation timestamp; when the represented revision was created. Corresponds to the JSON property revisionCreateTime

Returns:

  • (String)


313
314
315
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 313

def revision_create_time
  @revision_create_time
end

#revision_idString

Output only. Immutable. The revision ID of the spec. A new revision is committed whenever the spec contents are changed. The format is an 8-character hexadecimal string. Corresponds to the JSON property revisionId

Returns:

  • (String)


320
321
322
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 320

def revision_id
  @revision_id
end

#revision_update_timeString

Output only. Last update timestamp: when the represented revision was last modified. Corresponds to the JSON property revisionUpdateTime

Returns:

  • (String)


326
327
328
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 326

def revision_update_time
  @revision_update_time
end

#size_bytesFixnum

Output only. The size of the spec file in bytes. If the spec is gzipped, this is the size of the uncompressed spec. Corresponds to the JSON property sizeBytes

Returns:

  • (Fixnum)


332
333
334
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 332

def size_bytes
  @size_bytes
end

#source_uriString

The original source URI of the spec (if one exists). This is an external location that can be used for reference purposes but which may not be authoritative since this external resource may change after the spec is retrieved. Corresponds to the JSON property sourceUri

Returns:

  • (String)


340
341
342
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 340

def source_uri
  @source_uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/google/apis/apigeeregistry_v1/classes.rb', line 347

def update!(**args)
  @annotations = args[:annotations] if args.key?(:annotations)
  @contents = args[:contents] if args.key?(:contents)
  @create_time = args[:create_time] if args.key?(:create_time)
  @description = args[:description] if args.key?(:description)
  @filename = args[:filename] if args.key?(:filename)
  @hash_prop = args[:hash_prop] if args.key?(:hash_prop)
  @labels = args[:labels] if args.key?(:labels)
  @mime_type = args[:mime_type] if args.key?(:mime_type)
  @name = args[:name] if args.key?(:name)
  @revision_create_time = args[:revision_create_time] if args.key?(:revision_create_time)
  @revision_id = args[:revision_id] if args.key?(:revision_id)
  @revision_update_time = args[:revision_update_time] if args.key?(:revision_update_time)
  @size_bytes = args[:size_bytes] if args.key?(:size_bytes)
  @source_uri = args[:source_uri] if args.key?(:source_uri)
end