func (u *SUsers) Rm(usersID string) error { headers := httpclient.GetHeaders(u.Settings.SessionToken, u.Settings.Version, u.Settings.Pod, u.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/orgs/%s/users/%s", u.Settings.AuthHost, u.Settings.AuthHostVersion, u.Settings.OrgID, usersID), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
// Rm deletes an invite sent to a user. This invite must not already be // accepted. func (i *SInvites) Rm(inviteID string) error { headers := httpclient.GetHeaders(i.Settings.SessionToken, i.Settings.Version, i.Settings.Pod, i.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/orgs/%s/invites/%s", i.Settings.AuthHost, i.Settings.AuthHostVersion, i.Settings.OrgID, inviteID), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
// Signout signs out a user by their session token. func (a *SAuth) Signout() error { headers := httpclient.GetHeaders(a.Settings.SessionToken, a.Settings.Version, a.Settings.Pod, a.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/auth/signout", a.Settings.AuthHost, a.Settings.AuthHostVersion), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
func (r *SReleases) Rm(releaseName, svcID string) error { headers := httpclient.GetHeaders(r.Settings.SessionToken, r.Settings.Version, r.Settings.Pod, r.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/environments/%s/services/%s/releases/%s", r.Settings.PaasHost, r.Settings.PaasHostVersion, r.Settings.EnvironmentID, svcID, releaseName), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
func (d *SDeployKeys) Rm(name, keyType, svcID string) error { headers := httpclient.GetHeaders(d.Settings.SessionToken, d.Settings.Version, d.Settings.Pod, d.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/environments/%s/services/%s/ssh_keys/%s/type/%s", d.Settings.PaasHost, d.Settings.PaasHostVersion, d.Settings.EnvironmentID, svcID, name, keyType), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
func (j *SJobs) Delete(jobID, svcID string) error { headers := httpclient.GetHeaders(j.Settings.SessionToken, j.Settings.Version, j.Settings.Pod, j.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/environments/%s/services/%s/jobs/%s", j.Settings.PaasHost, j.Settings.PaasHostVersion, j.Settings.EnvironmentID, svcID, jobID), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
// Unset deletes an environment variable. Any changes to environment variables // will not take effect until the service is redeployed by pushing new code // or via `catalyze redeploy`. func (v *SVars) Unset(svcID, variable string) error { headers := httpclient.GetHeaders(v.Settings.SessionToken, v.Settings.Version, v.Settings.Pod, v.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/environments/%s/services/%s/env/%s", v.Settings.PaasHost, v.Settings.PaasHostVersion, v.Settings.EnvironmentID, svcID, variable), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
func (s *SSites) Rm(siteID int, svcID string) error { headers := httpclient.GetHeaders(s.Settings.SessionToken, s.Settings.Version, s.Settings.Pod, s.Settings.UsersID) resp, statusCode, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/environments/%s/services/%s/sites/%d", s.Settings.PaasHost, s.Settings.PaasHostVersion, s.Settings.EnvironmentID, svcID, siteID), headers) if err != nil { return err } return httpclient.ConvertResp(resp, statusCode, nil) }
func (k *SKeys) Remove(name string) error { headers := httpclient.GetHeaders(k.Settings.SessionToken, k.Settings.Version, k.Settings.Pod, k.Settings.UsersID) resp, status, err := httpclient.Delete(nil, fmt.Sprintf("%s%s/keys/%s", k.Settings.AuthHost, k.Settings.AuthHostVersion, name), headers) if err != nil { return err } if httpclient.IsError(status) { return httpclient.ConvertError(resp, status) } return nil }