# Class Message

Namespace
  AnthropicClient.Models

Assembly
  AnthropicClient.dll

Represents a message.

    public class Message

Inheritance
  object
  Message

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

## Constructors

### Message(string, List<Content>)

Initializes a new instance of the Message class.

    public Message(string role, List<Content> content)

#### Parameters

`role` string

  The role of the message.

`content` List<Content>

  The contents of the message.

#### Exceptions

ArgumentException

  Thrown when the role is invalid.

ArgumentNullException

  Thrown when the role or content is null.

## Properties

### Content

Gets the contents of the message.

    public List<Content> Content { get; init; }

#### Property Value

List<Content>

### Role

Gets the role of the message.

    public string Role { get; init; }

#### Property Value

string