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
30 changes: 30 additions & 0 deletions src/Stripe.net/Entities/V2/DeletedObject/DeletedObject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// File generated from our OpenAPI spec
namespace Stripe.V2
{
using Newtonsoft.Json;
#if NET6_0_OR_GREATER
using STJS = System.Text.Json.Serialization;
#endif

public class DeletedObject : StripeEntity<DeletedObject>, IHasId, IHasObject
{
/// <summary>
/// The ID of the object that's being deleted.
/// </summary>
[JsonProperty("id")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("id")]
#endif
public string Id { get; set; }

/// <summary>
/// String representing the type of the object that has been deleted. Objects of the same
/// type share the same value of the object field.
/// </summary>
[JsonProperty("object")]
#if NET6_0_OR_GREATER
[STJS.JsonPropertyName("object")]
#endif
public string Object { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ public virtual V2.EventDestination Create(EventDestinationCreateOptions options,
/// <summary>
/// Delete an event destination.
/// </summary>
public virtual V2.EventDestination Delete(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null)
public virtual V2.DeletedObject Delete(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null)
{
return this.Request<V2.EventDestination>(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions);
return this.Request<V2.DeletedObject>(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions);
}

/// <summary>
/// Delete an event destination.
/// </summary>
public virtual Task<V2.EventDestination> DeleteAsync(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
public virtual Task<V2.DeletedObject> DeleteAsync(string id, EventDestinationDeleteOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
return this.RequestAsync<V2.EventDestination>(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken);
return this.RequestAsync<V2.DeletedObject>(BaseAddress.Api, HttpMethod.Delete, $"/v2/core/event_destinations/{WebUtility.UrlEncode(id)}", options, requestOptions, cancellationToken);
}

/// <summary>
Expand Down
22 changes: 11 additions & 11 deletions src/StripeTests/Services/GeneratedExamplesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6256,7 +6256,7 @@ public void TestV2CoreEventGet()
HttpMethod.Get,
"/v2/core/events",
(HttpStatusCode)200,
"{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}],\"next_page_url\":null,\"previous_page_url\":null}",
"{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"type\":\"type\"}],\"next_page_url\":null,\"previous_page_url\":null}",
"object_id=object_id");
var options = new Stripe.V2.Core.EventListOptions
{
Expand All @@ -6279,7 +6279,7 @@ public void TestV2CoreEventGet2()
HttpMethod.Get,
"/v2/core/events/id_123",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"type\":\"type\"}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.Events;
Stripe.V2.Event result = service.Get("id_123");
Expand All @@ -6293,7 +6293,7 @@ public void TestV2CoreEventDestinationGet()
HttpMethod.Get,
"/v2/core/event_destinations",
(HttpStatusCode)200,
"{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}],\"next_page_url\":null,\"previous_page_url\":null}");
"{\"data\":[{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}],\"next_page_url\":null,\"previous_page_url\":null}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Stripe.V2.StripeList<Stripe.V2.EventDestination> eventDestinations = service
Expand All @@ -6308,7 +6308,7 @@ public void TestV2CoreEventDestinationPost()
HttpMethod.Post,
"/v2/core/event_destinations",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}");
var options = new Stripe.V2.Core.EventDestinationCreateOptions
{
EnabledEvents = new List<string> { "enabled_events" },
Expand All @@ -6330,10 +6330,10 @@ public void TestV2CoreEventDestinationDelete()
HttpMethod.Delete,
"/v2/core/event_destinations/id_123",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}");
"{\"id\":\"abc_123\",\"object\":\"some.object.tag\"}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Stripe.V2.EventDestination deleted = service.Delete("id_123");
Stripe.V2.DeletedObject deleted = service.Delete("id_123");
this.AssertRequest(
HttpMethod.Delete,
"/v2/core/event_destinations/id_123");
Expand All @@ -6346,7 +6346,7 @@ public void TestV2CoreEventDestinationGet2()
HttpMethod.Get,
"/v2/core/event_destinations/id_123",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Stripe.V2.EventDestination eventDestination = service.Get("id_123");
Expand All @@ -6362,7 +6362,7 @@ public void TestV2CoreEventDestinationPost2()
HttpMethod.Post,
"/v2/core/event_destinations/id_123",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}");
var options = new Stripe.V2.Core.EventDestinationUpdateOptions();
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Expand All @@ -6381,7 +6381,7 @@ public void TestV2CoreEventDestinationPost3()
HttpMethod.Post,
"/v2/core/event_destinations/id_123/disable",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Stripe.V2.EventDestination eventDestination = service.Disable(
Expand All @@ -6398,7 +6398,7 @@ public void TestV2CoreEventDestinationPost4()
HttpMethod.Post,
"/v2/core/event_destinations/id_123/enable",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"amazon_eventbridge\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"livemode\":true,\"metadata\":null,\"name\":\"name\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"webhook_endpoint\":null}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event_destination\",\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"livemode\":true,\"name\":\"name\",\"status\":\"disabled\",\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\"}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Stripe.V2.EventDestination eventDestination = service.Enable(
Expand All @@ -6415,7 +6415,7 @@ public void TestV2CoreEventDestinationPost5()
HttpMethod.Post,
"/v2/core/event_destinations/id_123/ping",
(HttpStatusCode)200,
"{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"reason\":null,\"type\":\"type\"}");
"{\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"created\":\"1970-01-12T21:42:34.472Z\",\"livemode\":true,\"type\":\"type\"}");
var client = new StripeClient(this.Requestor);
var service = client.V2.Core.EventDestinations;
Stripe.V2.Event result = service.Ping("id_123");
Expand Down
Loading