Class List Method List File List

# Class: Com::Vmware::Cis::Tagging::Category

Inherits:
  VAPI::Bindings::VapiService
  - Object
  - VAPI::Bindings::VapiService
  - Com::Vmware::Cis::Tagging::Category
  show all
Defined in:
  /build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb

## Overview

The ``Com::Vmware::Cis::Tagging::Category`` class provides methods to create, read, update, delete, and enumerate categories.

## Defined Under Namespace

Classes: CreateSpec, UpdateSpec

## Instance Method Summary (collapse)

- - (Void) add_to_used_by(category_id, used_by_entity)

  Adds the ``used_by_entity`` to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set for the specified category.

- - (String) create(create_spec)

  Creates a category.

- - (Void) delete(category_id)

  Deletes an existing category.

- - (Com::Vmware::Cis::Tagging::CategoryModel) get(category_id)

  Fetches the category information for the given category identifier.

- - (Category) initialize(config) constructor

  Constructs a new instance.

- - (Array<String>) list

  Enumerates the categories in the system.

- - (Array<String>) list_used_categories(used_by_entity)

  Enumerates all categories for which the ``used_by_entity`` is part of the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set .

- - (Void) remove_from_used_by(category_id, used_by_entity)

  Removes the ``used_by_entity`` from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set .

- - (Void) revoke_propagating_permissions(category_id)

  Revokes all propagating permissions on the given category.

- - (Void) update(category_id, update_spec)

  Updates an existing category.

## Constructor Details

### - (`Category`) initialize(config)

Constructs a new instance.

Parameters:

- config (`VAPI::Bindings::StubConfig`) —

  A hash with the api provider details.

    161
    162
    163
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 161

    def initialize(config)
        super(config, @@service_info)
    end

## Instance Method Details

### - (`Void`) add_to_used_by(category_id, used_by_entity)

Adds the ``used_by_entity`` to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set for the specified category. If the ``used_by_entity`` is already in the set , then this becomes an idempotent no-op. To invoke this method , you need the modify :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` privilege on the category.

Parameters:

- category_id (`String`) —

  The identifier of the input category.

- used_by_entity (`String`) —

  The name of the user to be added to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` set .

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for the given ``category_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to add an entity to the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` field.

    274
    275
    276
    277
    278
    279
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 274

    def add_to_used_by(category_id, used_by_entity)
        invoke_with_info(@@add_to_used_by_info, {
            'category_id' => category_id,
            'used_by_entity' => used_by_entity,
        })
    end

### - (`String`) create(create_spec)

Creates a category. To invoke this method , you need the create category privilege.

Parameters:

- create_spec (`Com::Vmware::Cis::Tagging::Category::CreateSpec`) —

  Specification for the new category to be created.

Returns:

- (`String`) —

  The identifier of the created category.

Raises:

- (`Com::Vmware::Vapi::Std::Errors::AlreadyExists`) —

  if the :attr:`Com::Vmware::Cis::Tagging::Category::CreateSpec.name` provided in the ``create_spec`` is the name of an already existing category.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if any of the information in the ``create_spec`` is invalid.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to create a category.

    178
    179
    180
    181
    182
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 178

    def create(create_spec)
        invoke_with_info(@@create_info, {
            'create_spec' => create_spec,
        })
    end

### - (`Void`) delete(category_id)

Deletes an existing category. To invoke this method , you need the delete privilege on the category.

Parameters:

- category_id (`String`) —

  The identifier of category to be deleted.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for the given ``category_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to delete the category.

    234
    235
    236
    237
    238
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 234

    def delete(category_id)
        invoke_with_info(@@delete_info, {
            'category_id' => category_id,
        })
    end

### - (`Com::Vmware::Cis::Tagging::CategoryModel`) get(category_id)

Fetches the category information for the given category identifier. In order to view the category information, you need the read privilege on the category.

Parameters:

- category_id (`String`) —

  The identifier of the input category.

Returns:

- (`Com::Vmware::Cis::Tagging::CategoryModel`) —

  The :class:`Com::Vmware::Cis::Tagging::CategoryModel` that corresponds to ``category_id`` .

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for the given ``category_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to read the category.

    195
    196
    197
    198
    199
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 195

    def get(category_id)
        invoke_with_info(@@get_info, {
            'category_id' => category_id,
        })
    end

### - (`Array<String>`) list

Enumerates the categories in the system. To invoke this method , you need the read privilege on the individual categories. The list will only contain those categories for which you have read privileges.

Returns:

- (`Array<String>`) —

  The list of resource identifiers for the categories in the system.

    245
    246
    247
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 245

    def list()
        invoke_with_info(@@list_info)
    end

### - (`Array<String>`) list_used_categories(used_by_entity)

Enumerates all categories for which the ``used_by_entity`` is part of the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set . To invoke this method , you need the read privilege on the individual categories.

Parameters:

- used_by_entity (`String`) —

  The field on which the results will be filtered.

Returns:

- (`Array<String>`) —

  The list of resource identifiers for the categories in the system that are used by ``used_by_entity`` .

    256
    257
    258
    259
    260
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 256

    def list_used_categories(used_by_entity)
        invoke_with_info(@@list_used_categories_info, {
            'used_by_entity' => used_by_entity,
        })
    end

### - (`Void`) remove_from_used_by(category_id, used_by_entity)

Removes the ``used_by_entity`` from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` subscribers set . If the ``used_by_entity`` is not using this category, then this becomes a no-op. To invoke this method , you need the modify :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` privilege on the category.

Parameters:

- category_id (`String`) —

  The identifier of the input category.

- used_by_entity (`String`) —

  The name of the user to be removed from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` set .

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for the given ``category_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to remove an entity from the :attr:`Com::Vmware::Cis::Tagging::CategoryModel.used_by` field.

    293
    294
    295
    296
    297
    298
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 293

    def remove_from_used_by(category_id, used_by_entity)
        invoke_with_info(@@remove_from_used_by_info, {
            'category_id' => category_id,
            'used_by_entity' => used_by_entity,
        })
    end

### - (`Void`) revoke_propagating_permissions(category_id)

Revokes all propagating permissions on the given category. You should then attach a direct permission with tagging privileges on the given category. To invoke this method , you need category related privileges (direct or propagating) on the concerned category.

Parameters:

- category_id (`String`) —

  The identifier of the input category.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for the given ``category_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to revoke propagating permissions on the category.

    310
    311
    312
    313
    314
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 310

    def revoke_propagating_permissions(category_id)
        invoke_with_info(@@revoke_propagating_permissions_info, {
            'category_id' => category_id,
        })
    end

### - (`Void`) update(category_id, update_spec)

Updates an existing category. To invoke this method , you need the edit privilege on the category.

Parameters:

- category_id (`String`) —

  The identifier of the category to be updated.

- update_spec (`Com::Vmware::Cis::Tagging::Category::UpdateSpec`) —

  Specification to update the category.

Returns:

- (`Void`)

Raises:

- (`Com::Vmware::Vapi::Std::Errors::AlreadyExists`) —

  if the :attr:`Com::Vmware::Cis::Tagging::Category::UpdateSpec.name` provided in the ``update_spec`` is the name of an already existing category.

- (`Com::Vmware::Vapi::Std::Errors::InvalidArgument`) —

  if any of the information in the ``update_spec`` is invalid.

- (`Com::Vmware::Vapi::Std::Errors::NotFound`) —

  if the category for the given ``category_id`` does not exist in the system.

- (`Com::Vmware::Vapi::Std::Errors::Unauthorized`) —

  if you do not have the privilege to update the category.

    217
    218
    219
    220
    221
    222
    # File '/build/mts/release/bora-4571906/build/sdk/aggregated-bindings/ruby/com/vmware/cis/tagging.rb', line 217

    def update(category_id, update_spec)
        invoke_with_info(@@update_info, {
            'category_id' => category_id,
            'update_spec' => update_spec,
        })
    end