Skip to content

Commit 8267379

Browse files
Updated entities based on latest GraphQL schema (2024-06-29)
1 parent a1e78e5 commit 8267379

File tree

7 files changed

+129
-3
lines changed

7 files changed

+129
-3
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 https://code.4me.com
3+
Copyright (c) 2024 Klaas Vandeweerdt
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Sdk4me.GraphQL
4+
{
5+
/// <summary>
6+
/// The <see href="https://developer.4me.com/graphql/input_object/appofferingpublishmutationinput/">AppOfferingPublishMutationInput</see> object.
7+
/// </summary>
8+
public class AppOfferingPublishMutationInput : PropertyChangeSet
9+
{
10+
private string? clientMutationId;
11+
private string id;
12+
13+
/// <summary>
14+
/// A unique identifier for the client performing the mutation.
15+
/// </summary>
16+
[JsonProperty("clientMutationId")]
17+
public string? ClientMutationId
18+
{
19+
get => clientMutationId;
20+
set => clientMutationId = Set("clientMutationId", value);
21+
}
22+
23+
/// <summary>
24+
/// Identifier of the draft app offering that should be copied to created a new published app offering version.
25+
/// </summary>
26+
[JsonProperty("id"), Sdk4meField(IsRequiredForMutation = true)]
27+
public string ID
28+
{
29+
get => id;
30+
set => id = Set("id", value);
31+
}
32+
33+
/// <summary>
34+
/// Initializes a new instance of the <see cref="AppOfferingPublishMutationInput"/> class without providing the required values.
35+
/// </summary>
36+
public AppOfferingPublishMutationInput()
37+
{
38+
id = string.Empty;
39+
}
40+
41+
/// <summary>
42+
/// Initializes a new instance of the <see cref="AppOfferingPublishMutationInput"/> class.
43+
/// </summary>
44+
/// <param name="id">Identifier of the draft app offering that should be copied to created a new published app offering version.</param>
45+
public AppOfferingPublishMutationInput(string id)
46+
{
47+
this.id = Set("id", id);
48+
}
49+
}
50+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
3+
namespace Sdk4me.GraphQL
4+
{
5+
/// <summary>
6+
/// The <see href="https://developer.4me.com/graphql/object/appofferingpublishmutationpayload/">AppOfferingPublishMutationPayload</see> object.
7+
/// </summary>
8+
public class AppOfferingPublishMutationPayload : Payload
9+
{
10+
/// <summary>
11+
/// Record after mutation.
12+
/// </summary>
13+
[JsonProperty("appOffering"), Sdk4meField(IsDefaultQueryProperty = true)]
14+
public AppOffering? AppOffering { get; internal set; }
15+
}
16+
}

Scr/Sdk4me.GraphQL/Enumerators/Enumerators.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public enum LifeCycleState
709709
public enum NoteMedium
710710
{
711711
/// <summary>
712-
/// Ai.
712+
/// AI.
713713
/// </summary>
714714
[EnumMember(Value = "ai")]
715715
Ai = 1,

Scr/Sdk4me.GraphQL/Extensions/Sdk4meClientMutationExtension.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,34 @@ public static async Task<AppOfferingCreatePayload> Mutation(this Sdk4meClient cl
217217
return await client.Mutation(new AppOfferingCreateMutation(input, query), throwOnError);
218218
}
219219

220+
/// <summary>
221+
/// Creates a new, published, app offering based on the current state of a draft app offering.
222+
/// </summary>
223+
/// <param name="client">The <see cref="Sdk4meClient"/>.</param>
224+
/// <param name="input">The mutation to execute.</param>
225+
/// <param name="throwOnError">Throw an <see cref="Sdk4meException"/> when the mutation fails.</param>
226+
/// <returns>The task object representing the asynchronous operation.</returns>
227+
/// <exception cref="Sdk4meException"></exception>
228+
[Obsolete("Use Mutation(this Client client, MutationClass mutation, QueryClass responseQuery, bool throwOnError = true) instead. This method will be removed by February 2025.")]
229+
public static async Task<AppOfferingPublishMutationPayload> Mutation(this Sdk4meClient client, AppOfferingPublishMutationInput input, bool throwOnError = true)
230+
{
231+
return await client.Mutation(new AppOfferingPublishMutation(input, new AppOfferingQuery()), throwOnError);
232+
}
233+
234+
/// <summary>
235+
/// Creates a new, published, app offering based on the current state of a draft app offering.
236+
/// </summary>
237+
/// <param name="client">The <see cref="Sdk4meClient"/>.</param>
238+
/// <param name="input">The mutation to execute.</param>
239+
/// <param name="query">The app offering response query. Pagination is not supported on connections.</param>
240+
/// <param name="throwOnError">Throw an <see cref="Sdk4meException"/> when the mutation fails.</param>
241+
/// <returns>The task object representing the asynchronous operation.</returns>
242+
/// <exception cref="Sdk4meException"></exception>
243+
public static async Task<AppOfferingPublishMutationPayload> Mutation(this Sdk4meClient client, AppOfferingPublishMutationInput input, AppOfferingQuery query, bool throwOnError = true)
244+
{
245+
return await client.Mutation(new AppOfferingPublishMutation(input, query), throwOnError);
246+
}
247+
220248
/// <summary>
221249
/// Updates an existing app offering.
222250
/// </summary>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Collections.Generic;
2+
3+
namespace Sdk4me.GraphQL
4+
{
5+
/// <summary>
6+
/// Creates a new, published, app offering based on the current state of a draft app offering.
7+
/// </summary>
8+
internal class AppOfferingPublishMutation : Mutation<AppOfferingPublishMutationPayload, AppOfferingPublishMutationInput>
9+
{
10+
/// <summary>
11+
/// Initialize an new AppOfferingPublish mutation instance.
12+
/// </summary>
13+
/// <param name="data">The input data.</param>
14+
/// <param name="query">The app offering response query.</param>
15+
internal AppOfferingPublishMutation(AppOfferingPublishMutationInput data, AppOfferingQuery query)
16+
: base("appOfferingPublish", "AppOfferingPublishMutationInput!", data, GetQuery(query))
17+
{
18+
}
19+
20+
/// <summary>
21+
/// Generates the response query collection.
22+
/// </summary>
23+
/// <param name="query">The app offering response query.</param>
24+
/// <returns>A query collection.</returns>
25+
private static HashSet<IQuery> GetQuery(AppOfferingQuery query)
26+
{
27+
query.FieldName = "appOffering";
28+
query.IsConnection = false;
29+
return new HashSet<IQuery>() { query };
30+
}
31+
}
32+
}

Scr/Sdk4me.GraphQL/Sdk4me.GraphQL.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Title>Sdk4me.GraphQL</Title>
1313
<Authors>Klaas Vandeweerdt</Authors>
1414
<Description>A .NET client for accessing the 4me GraphQL API</Description>
15-
<Copyright>MIT License</Copyright>
15+
<Copyright>Copyright © 2024 Vandeweerdt Klaas</Copyright>
1616
<PackageProjectUrl>https://developer.4me.com/graphql</PackageProjectUrl>
1717
<RepositoryUrl>https://github.com/code4me/4me-sdk-graphql-dotnet</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>

0 commit comments

Comments
 (0)