# Google Cloud Support V2BETA API - Class Google::Cloud::Support::V2beta::CommentService::Client (v0.6.0)

0.6.0 (latest) 0.5.1 0.4.0 0.3.1 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Support V2BETA API class Google::Cloud::Support::V2beta::CommentService::Client.

Client for the CommentService service.


<br />

A service to manage comments on cases.

## Inherits

- Object

## Includes

- [Google::Cloud::Support::V2beta::CommentService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the CommentService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration "Google::Cloud::Support::V2beta::CommentService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all CommentService clients
::Google::Cloud::Support::V2beta::CommentService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the CommentService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client#Google__Cloud__Support__V2beta__CommentService__Client_configure_class_ "Google::Cloud::Support::V2beta::CommentService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration "Google::Cloud::Support::V2beta::CommentService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration))

### #create_comment

    def create_comment(request, options = nil) -> ::Google::Cloud::Support::V2beta::Comment
    def create_comment(parent: nil, comment: nil) -> ::Google::Cloud::Support::V2beta::Comment

Add a new comment to a case.


<br />

The comment must have the following fields set: `body`.
**Overloads**

    def create_comment(request, options = nil) -> ::Google::Cloud::Support::V2beta::Comment

Pass arguments to `create_comment` via a request object, either of type [Google::Cloud::Support::V2beta::CreateCommentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CreateCommentRequest "Google::Cloud::Support::V2beta::CreateCommentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Support::V2beta::CreateCommentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CreateCommentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_comment(parent: nil, comment: nil) -> ::Google::Cloud::Support::V2beta::Comment

Pass arguments to `create_comment` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The name of the case to which the comment should be added.
- **comment** ([::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment), ::Hash) --- Required. The comment to be added.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/support/v2beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2beta::CommentService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2beta::CreateCommentRequest.new

# Call the create_comment method.
result = client.create_comment request

# The returned object is of type Google::Cloud::Support::V2beta::Comment.
p result
```

### #get_comment

    def get_comment(request, options = nil) -> ::Google::Cloud::Support::V2beta::Comment
    def get_comment(name: nil) -> ::Google::Cloud::Support::V2beta::Comment

Retrieve a comment.
**Overloads**

    def get_comment(request, options = nil) -> ::Google::Cloud::Support::V2beta::Comment

Pass arguments to `get_comment` via a request object, either of type [GetCommentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-GetCommentRequest "Google::Cloud::Support::V2beta::GetCommentRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Support::V2beta::GetCommentRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-GetCommentRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_comment(name: nil) -> ::Google::Cloud::Support::V2beta::Comment

Pass arguments to `get_comment` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The name of the comment to retrieve.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/support/v2beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2beta::CommentService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2beta::GetCommentRequest.new

# Call the get_comment method.
result = client.get_comment request

# The returned object is of type Google::Cloud::Support::V2beta::Comment.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new CommentService client object.
**Yields**

- (config) --- Configure the CommentService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-CommentService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Support::V2beta::CommentService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Support::V2beta::CommentService::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_comments

    def list_comments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>
    def list_comments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>

List all the comments associated with a case.
**Overloads**

    def list_comments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>

Pass arguments to `list_comments` via a request object, either of type [ListCommentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-ListCommentsRequest "Google::Cloud::Support::V2beta::ListCommentsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Support::V2beta::ListCommentsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-ListCommentsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_comments(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Support::V2beta::Comment>

Pass arguments to `list_comments` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **parent** (::String) --- Required. The name of the case for which to list comments.
- **page_size** (::Integer) --- The maximum number of comments to fetch. Defaults to 10.
- **page_token** (::String) --- A token identifying the page of results to return. If unspecified, the first page is returned.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Support::V2beta::Comment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-support-v2beta/latest/Google-Cloud-Support-V2beta-Comment)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/support/v2beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Support::V2beta::CommentService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Support::V2beta::ListCommentsRequest.new

# Call the list_comments method.
result = client.list_comments request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Support::V2beta::Comment.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)