001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.bean.mcp.v20260728;
018
019import org.apache.juneau.marshall.*;
020
021/**
022 * MCP {@code audio} content block (base64 data).
023 *
024 * <p>
025 * Joins the general-purpose {@link Content} dictionary alongside {@link TextContent}/{@link ImageContent}/
026 * {@link EmbeddedResourceContent} — usable anywhere a {@link Content} is accepted, not only in sampling contexts.
027 * Added specifically to give {@code SamplingMessage.content}/{@code CreateMessageResult.content} genuine
028 * {@code text}/{@code image}/{@code audio}/{@code resource} fidelity to the real MCP sampling schema; usable
029 * anywhere a {@link Content} is accepted, not only sampling contexts.
030 */
031@Marshalled(typeName = "audio")
032public class AudioContent implements Content {
033
034   private String data;
035   private String mimeType;
036
037   /**
038    * Base64-encoded audio bytes.
039    *
040    * @return The data, or {@code null} if not set.
041    */
042   public String getData() {
043      return data;
044   }
045
046   /**
047    * Sets the base64 payload.
048    *
049    * @param value The new value.  Can be <jk>null</jk> to unset the property.
050    * @return This object (for method chaining).
051    */
052   public AudioContent setData(String value) {
053      data = value;
054      return this;
055   }
056
057   /**
058    * Audio MIME type (for example {@code audio/wav}, {@code audio/mpeg}).
059    *
060    * @return The MIME type, or {@code null} if not set.
061    */
062   public String getMimeType() {
063      return mimeType;
064   }
065
066   /**
067    * Sets the MIME type.
068    *
069    * @param value The new value.  Can be <jk>null</jk> to unset the property.
070    * @return This object (for method chaining).
071    */
072   public AudioContent setMimeType(String value) {
073      mimeType = value;
074      return this;
075   }
076}