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.



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

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>)


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

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)


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

def contents
  @contents
end

#create_timeString

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

Returns:

  • (String)


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

def create_time
  @create_time
end

#descriptionString

A detailed description. Corresponds to the JSON property description

Returns:

  • (String)


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

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)


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

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)


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

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>)


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

def labels
  @labels
end

#mime_typeString

A style (format) descriptor for this spec that is specified as a Media Type ( https://en.wikipedia.org/wiki/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)


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

def mime_type
  @mime_type
end

#nameString

Resource name. Corresponds to the JSON property name

Returns:

  • (String)


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

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)


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

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)


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

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)


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

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)


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

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)


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

def source_uri
  @source_uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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