Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
namespace Beamable.Common.BeamCli.Contracts
{
/// <summary>
/// Contract projection of the autogenerated <c>BundleTag</c> API model. The generated model
/// uses Optional-wrapped fields and only exists in the CLI assembly, so command outputs expose
/// this type instead, allowing it to be copied into other SDKs.
/// Contract projection of a bundle's tags. The API returns them as a tag-to-checksum map
/// whose types only exist in the CLI assembly, so command outputs expose this type instead,
/// allowing it to be copied into other SDKs.
/// </summary>
[CliContractType, Serializable]
public class BundleTagInfo
{
/// <summary>
/// The fully qualified bundle name the tag belongs to.
/// </summary>
public string bundleName;

/// <summary>
/// The content checksum (sha256:...) the tag currently points at.
/// </summary>
Expand All @@ -24,10 +19,5 @@ public class BundleTagInfo
/// The tag name (e.g. "latest").
/// </summary>
public string tag;

/// <summary>
/// Unix timestamp (milliseconds) of when the tag was last moved.
/// </summary>
public long updatedAt;
}
}
66 changes: 43 additions & 23 deletions cli/beamable.common/Runtime/OpenApi/BeamBeamobundle.gs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ public partial interface IBeamBeamobundleApi
/// <returns>A promise containing the <see cref="GetBundleResponse"/></returns>
Promise<GetBundleResponse> GetBundles(string bundleName, string ns, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader);
/// <summary>
/// Publish history for a bundle (all checksums, newest first).
/// Release timeline for a bundle, newest first. fromVersion is an
///exclusive cursor - pass the last version you received to page backwards.
///
/// GET call to `/api/beamo/bundles/{ns}/{bundleName}/history` endpoint.
/// GET call to `/api/beamo/bundles/{ns}/{bundleName}/releases` endpoint.
/// </summary>
/// <param name="bundleName"></param>
/// <param name="fromVersion"></param>
/// <param name="limit"></param>
/// <param name="ns"></param>
/// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param>
/// <returns>A promise containing the <see cref="ListBundlesResponse"/></returns>
Promise<ListBundlesResponse> GetBundlesHistory(string bundleName, string ns, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader);
/// <returns>A promise containing the <see cref="ListBundleReleasesResponse"/></returns>
Promise<ListBundleReleasesResponse> GetBundlesReleases(string bundleName, string ns, [System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<long> fromVersion, [System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<int> limit, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader);
/// <summary>
/// Fetch a specific bundle version by content checksum.
///
Expand Down Expand Up @@ -84,17 +87,16 @@ public partial interface IBeamBeamobundleApi
/// <returns>A promise containing the <see cref="YankBundleResponse"/></returns>
Promise<YankBundleResponse> PostBundlesChecksumsYank(string bundleName, string checksum, string ns, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader);
/// <summary>
/// Widen the ACL on a bundle checksum. Admin-gated.
/// Widen a bundle's ACL. Admin-gated.
///
/// PUT call to `/api/beamo/bundles/{ns}/{bundleName}/checksums/{checksum}/acl` endpoint.
/// PUT call to `/api/beamo/bundles/{ns}/{bundleName}/acl` endpoint.
/// </summary>
/// <param name="bundleName"></param>
/// <param name="checksum"></param>
/// <param name="ns"></param>
/// <param name="gsReq">The <see cref="UpdateBundleAclRequest"/> instance to use for the request</param>
/// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param>
/// <returns>A promise containing the <see cref="ApiBeamoBundlesChecksumsAclPutBeamoBundleResponse"/></returns>
Promise<ApiBeamoBundlesChecksumsAclPutBeamoBundleResponse> PutBundlesChecksumsAcl(string bundleName, string checksum, string ns, UpdateBundleAclRequest gsReq, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader);
/// <returns>A promise containing the <see cref="ApiBeamoBundlesAclPutBeamoBundleResponse"/></returns>
Promise<ApiBeamoBundlesAclPutBeamoBundleResponse> PutBundlesAcl(string bundleName, string ns, UpdateBundleAclRequest gsReq, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader);
}
public partial class BeamBeamobundleApi : IBeamBeamobundleApi
{
Expand Down Expand Up @@ -129,21 +131,41 @@ public virtual Promise<GetBundleResponse> GetBundles(string bundleName, string n
return _requester.Request<GetBundleResponse>(Method.GET, gsUrl, default(object), includeAuthHeader, this.Serialize<GetBundleResponse>);
}
/// <summary>
/// Publish history for a bundle (all checksums, newest first).
/// Release timeline for a bundle, newest first. fromVersion is an
///exclusive cursor - pass the last version you received to page backwards.
///
/// GET call to `/api/beamo/bundles/{ns}/{bundleName}/history` endpoint.
/// GET call to `/api/beamo/bundles/{ns}/{bundleName}/releases` endpoint.
/// </summary>
/// <param name="bundleName"></param>
/// <param name="fromVersion"></param>
/// <param name="limit"></param>
/// <param name="ns"></param>
/// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param>
/// <returns>A promise containing the <see cref="ListBundlesResponse"/></returns>
public virtual Promise<ListBundlesResponse> GetBundlesHistory(string bundleName, string ns, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader)
/// <returns>A promise containing the <see cref="ListBundleReleasesResponse"/></returns>
public virtual Promise<ListBundleReleasesResponse> GetBundlesReleases(string bundleName, string ns, [System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<long> fromVersion, [System.Runtime.InteropServices.DefaultParameterValueAttribute(null)] [System.Runtime.InteropServices.OptionalAttribute()] Beamable.Common.Content.Optional<int> limit, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader)
{
string gsUrl = "/api/beamo/bundles/{ns}/{bundleName}/history";
string gsUrl = "/api/beamo/bundles/{ns}/{bundleName}/releases";
gsUrl = gsUrl.Replace("{ns}", _requester.EscapeURL(ns.ToString()));
gsUrl = gsUrl.Replace("{bundleName}", _requester.EscapeURL(bundleName.ToString()));
string gsQuery = "?";
System.Collections.Generic.List<string> gsQueries = new System.Collections.Generic.List<string>();
if (((limit != default(OptionalInt))
&& limit.HasValue))
{
gsQueries.Add(string.Concat("limit=", limit.Value.ToString()));
}
if (((fromVersion != default(OptionalLong))
&& fromVersion.HasValue))
{
gsQueries.Add(string.Concat("fromVersion=", fromVersion.Value.ToString()));
}
if ((gsQueries.Count > 0))
{
gsQuery = string.Concat(gsQuery, string.Join("&", gsQueries));
gsUrl = string.Concat(gsUrl, gsQuery);
}
// make the request and return the result
return _requester.Request<ListBundlesResponse>(Method.GET, gsUrl, default(object), includeAuthHeader, this.Serialize<ListBundlesResponse>);
return _requester.Request<ListBundleReleasesResponse>(Method.GET, gsUrl, default(object), includeAuthHeader, this.Serialize<ListBundleReleasesResponse>);
}
/// <summary>
/// Fetch a specific bundle version by content checksum.
Expand Down Expand Up @@ -222,24 +244,22 @@ public virtual Promise<YankBundleResponse> PostBundlesChecksumsYank(string bundl
return _requester.Request<YankBundleResponse>(Method.POST, gsUrl, default(object), includeAuthHeader, this.Serialize<YankBundleResponse>);
}
/// <summary>
/// Widen the ACL on a bundle checksum. Admin-gated.
/// Widen a bundle's ACL. Admin-gated.
///
/// PUT call to `/api/beamo/bundles/{ns}/{bundleName}/checksums/{checksum}/acl` endpoint.
/// PUT call to `/api/beamo/bundles/{ns}/{bundleName}/acl` endpoint.
/// </summary>
/// <param name="bundleName"></param>
/// <param name="checksum"></param>
/// <param name="ns"></param>
/// <param name="gsReq">The <see cref="UpdateBundleAclRequest"/> instance to use for the request</param>
/// <param name="includeAuthHeader">By default, every request will include an authorization header so that the request acts on behalf of the current user. When the includeAuthHeader argument is false, the request will not include the authorization header for the current user.</param>
/// <returns>A promise containing the <see cref="ApiBeamoBundlesChecksumsAclPutBeamoBundleResponse"/></returns>
public virtual Promise<ApiBeamoBundlesChecksumsAclPutBeamoBundleResponse> PutBundlesChecksumsAcl(string bundleName, string checksum, string ns, UpdateBundleAclRequest gsReq, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader)
/// <returns>A promise containing the <see cref="ApiBeamoBundlesAclPutBeamoBundleResponse"/></returns>
public virtual Promise<ApiBeamoBundlesAclPutBeamoBundleResponse> PutBundlesAcl(string bundleName, string ns, UpdateBundleAclRequest gsReq, [System.Runtime.InteropServices.DefaultParameterValueAttribute(true)] [System.Runtime.InteropServices.OptionalAttribute()] bool includeAuthHeader)
{
string gsUrl = "/api/beamo/bundles/{ns}/{bundleName}/checksums/{checksum}/acl";
string gsUrl = "/api/beamo/bundles/{ns}/{bundleName}/acl";
gsUrl = gsUrl.Replace("{ns}", _requester.EscapeURL(ns.ToString()));
gsUrl = gsUrl.Replace("{bundleName}", _requester.EscapeURL(bundleName.ToString()));
gsUrl = gsUrl.Replace("{checksum}", _requester.EscapeURL(checksum.ToString()));
// make the request and return the result
return _requester.Request<ApiBeamoBundlesChecksumsAclPutBeamoBundleResponse>(Method.PUT, gsUrl, Beamable.Serialization.JsonSerializable.ToJson(gsReq), includeAuthHeader, this.Serialize<ApiBeamoBundlesChecksumsAclPutBeamoBundleResponse>);
return _requester.Request<ApiBeamoBundlesAclPutBeamoBundleResponse>(Method.PUT, gsUrl, Beamable.Serialization.JsonSerializable.ToJson(gsReq), includeAuthHeader, this.Serialize<ApiBeamoBundlesAclPutBeamoBundleResponse>);
}
}
}
Loading
Loading