github.com/stripe/stripe-go/v76@v76.25.0/financialconnections_accountownership.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  package stripe
     8  
     9  import "encoding/json"
    10  
    11  // Describes a snapshot of the owners of an account at a particular point in time.
    12  type FinancialConnectionsAccountOwnership struct {
    13  	// Time at which the object was created. Measured in seconds since the Unix epoch.
    14  	Created int64 `json:"created"`
    15  	// Unique identifier for the object.
    16  	ID string `json:"id"`
    17  	// String representing the object's type. Objects of the same type share the same value.
    18  	Object string `json:"object"`
    19  	// A paginated list of owners for this account.
    20  	Owners *FinancialConnectionsAccountOwnerList `json:"owners"`
    21  }
    22  
    23  // UnmarshalJSON handles deserialization of a FinancialConnectionsAccountOwnership.
    24  // This custom unmarshaling is needed because the resulting
    25  // property may be an id or the full struct if it was expanded.
    26  func (f *FinancialConnectionsAccountOwnership) UnmarshalJSON(data []byte) error {
    27  	if id, ok := ParseID(data); ok {
    28  		f.ID = id
    29  		return nil
    30  	}
    31  
    32  	type financialConnectionsAccountOwnership FinancialConnectionsAccountOwnership
    33  	var v financialConnectionsAccountOwnership
    34  	if err := json.Unmarshal(data, &v); err != nil {
    35  		return err
    36  	}
    37  
    38  	*f = FinancialConnectionsAccountOwnership(v)
    39  	return nil
    40  }