Swiftagram Documentation

Structure Secret

public struct Secret: Codable, Storable  

A struct defining the logged in user authentication parameters.

cookies and client are only ever valid as a pair: if you need to change the Client, just authenticate again, passing the new one to the Authenticator.

%165 Secret Secret Codable Codable Secret->Codable Storable Storable Secret->Storable

Conforms To

Codable
Storable

Initializers

init?(cookies:​client:​)

public init?<Cookies: Collection>(cookies: Cookies, client: Client = .default) where Cookies.Element: HTTPCookie  

Init.

Parameters

cookies Cookies

A Collection of HTTPCookies.

client Client

A valid Client. Defaults to .default.

init(from:​)

public init(from decoder: Decoder) throws  

Init.

Parameters

decoder Decoder

A valid Decoder.

Throws

Some Error related to the decoding process.

Properties

client

public let client: Client

The associated Client. Defaults to .default.

identifier

public let identifier: String

The authenticated user primary key.

label

public var label: String  

The storable label.

header

public var header: [String: String]  

All header fields.

Methods

encode(to:​)

public func encode(to encoder: Encoder) throws  

Encode into Data.

Parameters

encoder Encoder

A valid Encoder.

Throws

Some Error related to the encoding process.

Returns

Some Data.