Skip to content

Commit

Permalink
Added ConnectApplication (#254)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew <[email protected]>
  • Loading branch information
andrew804 and andrew804 authored May 8, 2024
1 parent 65a5687 commit b654208
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Sources/StripeKit/Connect/Application/Application.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// Application.swift
//
//
// Created by Andrew Morris on 26/04/2024.
//

import Foundation

/// The [Application Object](https://stripe.com/docs/api/application/object)
public struct ConnectApplication: Codable {
/// Unique identifier for the object.
public var id: String
/// The name of the application.
public var name: String?
/// String representing the object’s type. Objects of the same type share the same value.
public var object: String

public init(id: String,
name: String? = nil,
object: String) {
self.id = id
self.name = name
self.object = object
}
}
3 changes: 3 additions & 0 deletions Sources/StripeKit/Core Resources/Events/Event.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public struct EventData: Codable {

public enum EventObject: Codable {
case account(ConnectAccount)
case application(ConnectApplication)
case card(Card)
case cashBalance(CashBalance)
case bankAccount(BankAccount)
Expand Down Expand Up @@ -125,6 +126,8 @@ public enum EventObject: Codable {
switch object {
case "account":
self = try .account(ConnectAccount(from: decoder))
case "application":
self = try .application(ConnectApplication(from: decoder))
case "application_fee":
self = try .applicationFee(ApplicationFee(from: decoder))
case "card":
Expand Down

0 comments on commit b654208

Please sign in to comment.