nominateFacility

abstract suspend fun nominateFacility(clubName: String, address1: String, address2: String?, city: String, stateCode: String, zipCode: String, latitude: Double?, longitude: Double?, phoneNumber: String?, email: String?, managerName: String?, currentlyAMember: Boolean?, metadata: Map<String, String?>?): AFResult

Submits a new facility for nomination.

This allows a member to suggest a new facility that is not yet part of the network. The submitted information will be reviewed for potential inclusion. While many parameters are optional, providing more detail increases the likelihood of a successful nomination.

Return

An AFResult indicating whether the nomination was successfully submitted.

Parameters

clubName

The name of the facility or club.

address1

The primary street address line.

address2

Optional secondary street address line (e.g., suite, floor).

city

The city where the facility is located.

stateCode

The two-letter state or province code.

zipCode

The postal or ZIP code.

latitude

Optional geographical latitude of the facility.

longitude

Optional geographical longitude of the facility.

phoneNumber

Optional contact phone number for the facility.

email

Optional contact email address for the facility.

managerName

Optional name of a manager or contact person at the facility.

currentlyAMember

Optional flag indicating if the person nominating is currently a member of the facility.

metadata

Optional map for any additional custom data related to the nomination.

Throws

if the submission fails due to a network or server error.

Android (Kotlin)

lifecycleScope.launch {
try {
val result = AFCore.facilities().nominateFacility(
clubName = "Downtown Fitness",
address1 = "123 Main St",
city = "Anytown",
stateCode = "CA",
zipCode = "90210",
currentlyAMember = true
)
if (result.status) {
println("Facility nominated successfully")
} else {
println("Failed to nominate facility: ${result.statusMessage}")
}
} catch (t: Throwable) {
showError("Failed to nominate facility: ${t.message}")
}
}

### iOS (Swift)
```swift
Task {
do {
let result = try await AFCore.shared.facilities().nominateFacility(
clubName: "Downtown Fitness",
address1: "123 Main St",
city: "Anytown",
stateCode: "CA",
zipCode: "90210",
currentlyAMember: true
)
if (result.status) {
print("Facility nominated successfully")
} else {
print("Failed to nominate facility: \(result.statusMessage)")
}
} catch {
print("Failed to nominate facility: \(error.localizedDescription)")
}
}