Class CardAttachment
Represents a card attachment
public record CardAttachment : IEquatable<CardAttachment>
- Inheritance
-
CardAttachment
- Implements
- Inherited Members
Constructors
CardAttachment(string, string, Uri)
Represents a card attachment
public CardAttachment(string Title, string Text, Uri MediaUrl)
Parameters
TitlestringThe title of the card.
TextstringThe text to display on the card.
MediaUrlUriThe publicly accessible URL of the media attachment for the card. Supported media include images, videos, and PDFs.
Properties
MediaDescription
A short description of the media for accessibility purposes.
public string MediaDescription { get; init; }
Property Value
MediaForceRefresh
By default, media URLs are cached on the RCS platform for up to 60 days. Set this property to true to force the platform to fetch a fresh copy of the media from the provided URL.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool MediaForceRefresh { get; init; }
Property Value
MediaHeight
The height of the media element. If not specified, defaults to SHORT.
[JsonConverter(typeof(EnumDescriptionJsonConverter<CardAttachment.Height>))]
public CardAttachment.Height? MediaHeight { get; init; }
Property Value
MediaUrl
The publicly accessible URL of the media attachment for the card. Supported media include images, videos, and PDFs.
public Uri MediaUrl { get; init; }
Property Value
Suggestions
An array of suggestion objects to include with the card. You can include up to 4 suggestions per card.
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SuggestionBase[] Suggestions { get; init; }
Property Value
Text
The text to display on the card.
public string Text { get; init; }
Property Value
ThumbnailUrl
The publicly accessible URL of the thumbnail image for the card.
public Uri ThumbnailUrl { get; init; }
Property Value
Title
The title of the card.
public string Title { get; init; }
Property Value
Methods
AppendSuggestion(SuggestionBase)
Returns a card attachment with a new suggestion.
public CardAttachment AppendSuggestion(SuggestionBase suggestion)
Parameters
suggestionSuggestionBaseThe suggestion
Returns
- CardAttachment
The card attachment
ForceMediaRefresh()
Returns a card attachment with a forced media refresh.
public CardAttachment ForceMediaRefresh()
Returns
- CardAttachment
The card attachment
GetErrors()
Returns any validation errors for this card attachment.
public IEnumerable<string> GetErrors()
Returns
WithMediaDescription(string)
Returns a card attachment with a media description.
public CardAttachment WithMediaDescription(string value)
Parameters
valuestringThe media description
Returns
- CardAttachment
The card attachment
WithMediaHeight(Height)
Returns a card attachment with a media height.
public CardAttachment WithMediaHeight(CardAttachment.Height value)
Parameters
valueCardAttachment.HeightThe media height
Returns
- CardAttachment
The card attachment
WithThumbnailUrl(Uri)
Returns a card attachment with a thumbnail url.
public CardAttachment WithThumbnailUrl(Uri value)
Parameters
valueUriThe thumbnail url.
Returns
- CardAttachment
The card attachment