RawFileMetadataBuilder

public final class RawFileMetadataBuilder

Allows metadata for raw files, which will be written to user’s library, to be built up.

  • Initializes builder with mandatory values

    Declaration

    Swift

    public init(mimeType: MimeType, accounts: [String])

    Parameters

    mimeType

    The MIME type of the data being written

    accounts

    An array of user accounts associated with data being written

  • Adds references associated with data being written. Typically this would include the name of the file.

    Declaration

    Swift

    public func reference(_ value: [String]) -> RawFileMetadataBuilder

    Parameters

    value

    An array of reference values

    Return Value

    The updated builder

  • Adds tags describing the data being written

    Declaration

    Swift

    public func tags(_ value: [String]) -> RawFileMetadataBuilder

    Parameters

    value

    An array of tag values

    Return Value

    The updated builder

  • Adds the identifier of the respective contract which can read the written data

    Declaration

    Swift

    public func contractId(_ value: String) -> RawFileMetadataBuilder

    Parameters

    value

    The contract identifier

    Return Value

    The updated builder

  • Adds the identifier of the application containing the respective contract which can read the written data

    Declaration

    Swift

    public func appId(_ value: String) -> RawFileMetadataBuilder

    Parameters

    value

    The application identifier

    Return Value

    The updated builder

  • Adds the name of the provider writing the data

    Declaration

    Swift

    public func providerName(_ value: String) -> RawFileMetadataBuilder

    Parameters

    value

    The provider name

    Return Value

    The updated builder

  • Adds object types describing data being written

    Declaration

    Swift

    public func objectTypes(_ value: [RawFileMetadata.ObjectType]) -> RawFileMetadataBuilder

    Parameters

    value

    The object types

    Return Value

    The updated builder

  • Adds identifiers of service groups associated with data being written. See https://developers.digi.me/reference-objects#service-group for list of service groups.

    Declaration

    Swift

    public func serviceGroups(_ value: [Int]) -> RawFileMetadataBuilder

    Parameters

    value

    The service group identifiers

    Return Value

    The updated builder

  • Builds the metadata for the data file being written

    Declaration

    Swift

    public func build() -> RawFileMetadata

    Return Value

    The built metadata