Skip to content

Latest commit

 

History

History
135 lines (83 loc) · 3.27 KB

PasswordResetTokensApi.md

File metadata and controls

135 lines (83 loc) · 3.27 KB

\PasswordResetTokensApi

All URIs are relative to https://api.equinix.com/metal/v1

Method HTTP request Description
CreatePasswordResetToken Post /reset-password Create a password reset token
ResetPassword Delete /reset-password Reset current user password

CreatePasswordResetToken

CreatePasswordResetToken(ctx).Email(email).Execute()

Create a password reset token

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {
    email := "email_example" // string | Email of user to create password reset token

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.PasswordResetTokensApi.CreatePasswordResetToken(context.Background()).Email(email).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PasswordResetTokensApi.CreatePasswordResetToken``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreatePasswordResetTokenRequest struct via the builder pattern

Name Type Description Notes
email string Email of user to create password reset token

Return type

(empty response body)

Authorization

x_auth_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ResetPassword

NewPassword ResetPassword(ctx).Execute()

Reset current user password

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/equinix/equinix-sdk-go/services/metalv1"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.PasswordResetTokensApi.ResetPassword(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `PasswordResetTokensApi.ResetPassword``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ResetPassword`: NewPassword
    fmt.Fprintf(os.Stdout, "Response from `PasswordResetTokensApi.ResetPassword`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiResetPasswordRequest struct via the builder pattern

Return type

NewPassword

Authorization

x_auth_token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]