intraoapi42

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 16 Imported by: 0

README

intraoapi42

A Go client for the 42 Intranet API, generated from an OpenAPI 3 description with oapi-codegen, plus a thin wrapper handling OAuth2 client-credentials auth and automatic retries.

⚠️ Unofficial spec. The OpenAPI description in this repo is not provided by 42. It has been hand-crafted from the public api.intra.42.fr/apidoc reference and from observing real responses. Coverage of the full API surface is currently partial, contributions are very welcome, see Contributing.

💡 Not a Go user? The bundled openapi.yaml is a standard, self-contained OpenAPI 3 document, it isn't tied to oapi-codegen or to Go. You can feed it into any other client generator (e.g. openapi-generator, openapi-python-client, Swagger Codegen, etc.) to produce a client in Python, TypeScript, Java, Rust, or whatever language you need. See Using the spec in other languages.

Features

  • Strongly-typed request/response models generated straight from the OpenAPI spec (ClientWithResponses)
  • OAuth2 client-credentials flow with automatic, cached, thread-safe token refresh
  • Built-in retry transport for rate limiting, transient server errors, and expired tokens
  • Spec split into small, per-resource YAML files under specs/, bundled and linted with Redocly CLI
  • The bundled openapi.yaml is plain OpenAPI 3, language-agnostic, so it can drive client generation for Python, TypeScript, or any other language, not just this Go package

Installation

go get github.com/42paris/intraoapi42

Quick start

package main

import (
	"context"
	"fmt"
	"log"

	intraoapi42 "github.com/42paris/intraoapi42"
)

func main() {
	ctx := context.Background()

	config := intraoapi42.ProductionConfig.
		WithClientCredentials("your-client-id", "your-client-secret").
		WithScopes("public")

	client, err := intraoapi42.New(config)
	if err != nil {
		log.Fatal(err)
	}

	resp, err := client.GetUsersWithResponse(ctx, &intraoapi42.GetUsersParams{})
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(resp.StatusCode())
}

The exact generated method and parameter names (Get...WithResponse, ...Params, etc.) come from the operationIds defined under specs/paths/ and live in openapi.gen.go. Browse that file (or run go doc github.com/42paris/intraoapi42) for the full list of currently available endpoints, it will grow as the spec gets more complete.

Using the spec in other languages

This repo's real deliverable is arguably the spec itself: openapi.yaml at the repo root is a fully bundled, single-file OpenAPI 3 description with no external $refs left to resolve. It has no dependency on Go or on oapi-codegen, so it works as input to any OpenAPI-compatible generator. For example:

# Python (openapi-python-client)
pip install openapi-python-client
openapi-python-client generate --url https://raw.githubusercontent.com/42paris/intraoapi42/main/openapi.yaml

# Any language, via the generic openapi-generator (needs Java)
npx @openapitools/openapi-generator-cli generate \
  -i openapi.yaml \
  -g python \
  -o ./client-python
# swap "-g python" for "-g typescript-fetch", "-g java", "-g rust", etc.

A few things worth knowing if you go this route:

  • Always generate from the bundled openapi.yaml, not from files under specs/, those are hand-maintained fragments meant to be assembled by make bundle and aren't valid standalone specs.
  • Since the spec is hand-crafted and partial (see the note at the top of this README), coverage and accuracy for generators other than oapi-codegen haven't been verified as thoroughly, please report issues, they most likely mean the spec needs fixing rather than the generator.
  • OAuth2 client-credentials handling, retries, and pagination helpers are specific to this Go package, generators for other languages will only give you the typed request/response models and raw HTTP calls, you'll need to write the equivalent auth/retry glue yourself.

Retry mechanism

New(config) wires up an HTTP client with two layered http.RoundTrippers:

  1. oauth2.Transport, injects the Authorization: Bearer <token> header, backed by a refreshableTokenSource that caches the token in memory (guarded by a mutex) and only hits the token endpoint again once the cached token is invalid or expired.
  2. retryTransport, wraps the above and retries the request based on the response status:
Status Behavior
429 Too Many Requests Retried up to 3 times, waiting 1s between attempts
500 Internal Server Error Retried up to 5 times, waiting 500ms between attempts
401 Unauthorized The cached token is invalidated (forcing a fresh token fetch on the next attempt) and the request is retried

Repository layout

.
├── client.go                # Config, New(), retry transport, token source
├── time.go                  # custom time handling for the intra API's date/time formats
├── generate.go              # go:generate directive driving oapi-codegen
├── openapi.gen.go           # generated Go client (do not edit by hand)
├── openapi.yaml             # bundled, single-file OpenAPI spec (generated, do not edit by hand)
├── specs/                   # hand-maintained OpenAPI spec, split by concern
│   ├── openapi.yaml         # spec root, references the folders below
│   ├── paths/               # one file per resource/endpoint group
│   ├── schemas/             # one file per data model
│   └── parameters/          # shared/reusable parameters (e.g. pagination)
└── tool/
    ├── generate_indexes.py  # regenerates each specs/*/_index.yaml
    └── requirements.txt

Each folder under specs/ (paths, schemas, parameters) has an auto-generated _index.yaml that aggregates every top-level key defined in that folder into $ref entries, so the root spec can reference the whole folder without listing every file by hand. Never edit _index.yaml files directly, they're regenerated by tool/generate_indexes.py.

Working on the spec

The Makefile drives the whole spec pipeline (Docker is the only local dependency, no need to install Python or Node yourself):

make indexes   # regenerate specs/{paths,schemas,parameters}/_index.yaml
make bundle    # bundle specs/openapi.yaml + all $refs into ./openapi.yaml
make lint      # lint ./openapi.yaml with redocly/cli
make all       # runs the three steps above, in order

Once openapi.yaml is up to date, regenerate the Go client bindings:

go generate ./...   # runs generate.go, invoking oapi-codegen against openapi.yaml
go build ./...

oapi-codegen is declared as a Go tool dependency in go.mod (tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen), so go generate can invoke it via go tool without a separate global install.

If you're generating a client for a different language instead, you only need make all to produce an up-to-date openapi.yaml, then point your generator of choice at it as shown in Using the spec in other languages.

Contributing

This client is only as good as the spec behind it, and the spec is currently incomplete, plenty of endpoints, schemas, and edge cases from the real 42 API aren't described yet. Contributions of any size are welcome, especially:

  • New or missing paths (endpoints) and schemas (models)
  • Corrections to existing schemas: wrong types, missing required/nullable fields, incomplete enums
  • Better-documented error responses
  • Usage examples and documentation improvements
How to contribute
  1. Fork the repo and create a branch.
  2. Add or edit YAML under specs/paths/, specs/schemas/, or specs/parameters/, one file per resource, mirroring the existing style. Don't hand-edit _index.yaml or the root openapi.yaml.
  3. Run make all to regenerate the indexes, rebuild the bundled openapi.yaml, and lint it, fix any lint errors before opening a PR.
  4. Run go generate ./... and confirm go build ./... / go vet ./... still pass.
  5. Open a PR describing which endpoint(s)/schema(s) you added or changed, and how you verified them against the real API (a sample response, a link into the apidoc, etc.), since the spec is hand-crafted, this kind of provenance is what keeps it trustworthy.

Documentation

Overview

Package intraoapi42 provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var ProductionConfig = Config{
	Config: clientcredentials.Config{
		TokenURL: "https://api.intra.42.fr/oauth/token",
	},
	ServerURL: "https://api.intra.42.fr/v2",
}
View Source
var StagingConfig = Config{
	Config: clientcredentials.Config{
		TokenURL: "https://api.intra-staging.42.fr/oauth/token",
	},
	ServerURL: "https://api.intra-staging.42.fr/v2",
}

Functions

func FetchAll

func FetchAll[T any, P any, R HasJSON200Slice[T]](
	ctx context.Context,
	fetch func(context.Context, *P, ...RequestEditorFn) (R, error),
	params *P,
	pageSize ...int,
) ([]T, error)

func FetchAllConcurrent

func FetchAllConcurrent[T any, P any, R HasJSON200Slice[T]](
	ctx context.Context,
	fetch func(context.Context, *P, ...RequestEditorFn) (R, error),
	params *P,
	concurrency int,
	pageSize ...int,
) ([]T, error)

func NewGetCloseByIdRequest

func NewGetCloseByIdRequest(server string, id int) (*http.Request, error)

NewGetCloseByIdRequest constructs an http.Request for the GetCloseById method

func NewGetClosesByUserIdRequest

func NewGetClosesByUserIdRequest(server string, userId int, params *GetClosesByUserIdParams) (*http.Request, error)

NewGetClosesByUserIdRequest constructs an http.Request for the GetClosesByUserId method

func NewGetClosesRequest

func NewGetClosesRequest(server string, params *GetClosesParams) (*http.Request, error)

NewGetClosesRequest constructs an http.Request for the GetCloses method

func NewGetInternshipsRequest

func NewGetInternshipsRequest(server string, params *GetInternshipsParams) (*http.Request, error)

NewGetInternshipsRequest constructs an http.Request for the GetInternships method

func NewGetLanguageByIdRequest

func NewGetLanguageByIdRequest(server string, id int) (*http.Request, error)

NewGetLanguageByIdRequest constructs an http.Request for the GetLanguageById method

func NewGetUserByIdRequest

func NewGetUserByIdRequest(server string, id string) (*http.Request, error)

NewGetUserByIdRequest constructs an http.Request for the GetUserById method

func NewGetUserCandidatureByIdRequest

func NewGetUserCandidatureByIdRequest(server string, id string) (*http.Request, error)

NewGetUserCandidatureByIdRequest constructs an http.Request for the GetUserCandidatureById method

func NewGetUsersRequest

func NewGetUsersRequest(server string, params *GetUsersParams) (*http.Request, error)

NewGetUsersRequest constructs an http.Request for the GetUsers method

Types

type AchievementResponse

type AchievementResponse struct {
	Description  string `json:"description"`
	Id           int    `json:"id"`
	Image        string `json:"image"`
	Kind         string `json:"kind"`
	Name         string `json:"name"`
	NbrOfSuccess *int   `json:"nbr_of_success,omitempty"`
	Tier         string `json:"tier"`
	UsersUrl     string `json:"users_url"`
	Visible      bool   `json:"visible"`
}

AchievementResponse defines model for AchievementResponse.

type CampusResponse

type CampusResponse struct {
	Active             bool              `json:"active"`
	Address            *string           `json:"address,omitempty"`
	City               string            `json:"city"`
	Country            string            `json:"country"`
	DefaultHiddenPhone *bool             `json:"default_hidden_phone,omitempty"`
	EmailExtension     string            `json:"email_extension"`
	Facebook           *string           `json:"facebook,omitempty"`
	Id                 int               `json:"id"`
	Language           *LanguageResponse `json:"language,omitempty"`
	Name               string            `json:"name"`
	Public             bool              `json:"public"`
	TimeZone           string            `json:"time_zone"`
	Twitter            *string           `json:"twitter,omitempty"`
	UsersCount         int               `json:"users_count"`
	VogsphereId        int               `json:"vogsphere_id"`
	Website            *string           `json:"website,omitempty"`
	Zip                *string           `json:"zip,omitempty"`
}

CampusResponse defines model for CampusResponse.

type CampusUserResponse

type CampusUserResponse struct {
	CampusId  int       `json:"campus_id"`
	CreatedAt time.Time `json:"created_at"`
	Id        int       `json:"id"`
	IsPrimary bool      `json:"is_primary"`
	UpdatedAt time.Time `json:"updated_at"`
	UserId    int       `json:"user_id"`
}

CampusUserResponse defines model for CampusUserResponse.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetCloseById

func (c *Client) GetCloseById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCloseById Get a close by ID

Corresponds with GET /closes/{id} (the `GetCloseById` operationId).

func (*Client) GetCloses

func (c *Client) GetCloses(ctx context.Context, params *GetClosesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetCloses Get a list of closes

Corresponds with GET /closes (the `GetCloses` operationId).

func (*Client) GetClosesByUserId

func (c *Client) GetClosesByUserId(ctx context.Context, userId int, params *GetClosesByUserIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetClosesByUserId Get a list of closes by user id

Corresponds with GET /users/{user_id}/closes (the `GetClosesByUserId` operationId).

func (*Client) GetInternships

func (c *Client) GetInternships(ctx context.Context, params *GetInternshipsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetInternships Get a list of internships

Corresponds with GET /internships (the `GetInternships` operationId).

func (*Client) GetLanguageById

func (c *Client) GetLanguageById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)

GetLanguageById Get a language by ID

Corresponds with GET /languages/{id} (the `GetLanguageById` operationId).

func (*Client) GetUserById

func (c *Client) GetUserById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetUserById Get a user by ID

Corresponds with GET /users/{id} (the `GetUserById` operationId).

func (*Client) GetUserCandidatureById

func (c *Client) GetUserCandidatureById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetUserCandidatureById Get user candidature information

Corresponds with GET /users/{id}/user_candidature (the `GetUserCandidatureById` operationId).

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetUsers Get a list of users

Corresponds with GET /users (the `GetUsers` operationId).

type ClientInterface

type ClientInterface interface {

	// GetCloses Get a list of closes
	//
	// Corresponds with GET /closes (the `GetCloses` operationId).
	GetCloses(ctx context.Context, params *GetClosesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetCloseById Get a close by ID
	//
	// Corresponds with GET /closes/{id} (the `GetCloseById` operationId).
	GetCloseById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetInternships Get a list of internships
	//
	// Corresponds with GET /internships (the `GetInternships` operationId).
	GetInternships(ctx context.Context, params *GetInternshipsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLanguageById Get a language by ID
	//
	// Corresponds with GET /languages/{id} (the `GetLanguageById` operationId).
	GetLanguageById(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUsers Get a list of users
	//
	// Corresponds with GET /users (the `GetUsers` operationId).
	GetUsers(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUserById Get a user by ID
	//
	// Corresponds with GET /users/{id} (the `GetUserById` operationId).
	GetUserById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUserCandidatureById Get user candidature information
	//
	// Corresponds with GET /users/{id}/user_candidature (the `GetUserCandidatureById` operationId).
	GetUserCandidatureById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetClosesByUserId Get a list of closes by user id
	//
	// Corresponds with GET /users/{user_id}/closes (the `GetClosesByUserId` operationId).
	GetClosesByUserId(ctx context.Context, userId int, params *GetClosesByUserIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func New

func New(config Config) (*ClientWithResponses, error)

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetCloseByIdWithResponse

func (c *ClientWithResponses) GetCloseByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetCloseByIdResponse, error)

GetCloseByIdWithResponse Get a close by ID

Returns a wrapper object for the known response body format(s).

Corresponds with GET /closes/{id} (the `GetCloseById` operationId).

func (*ClientWithResponses) GetClosesByUserIdWithResponse

func (c *ClientWithResponses) GetClosesByUserIdWithResponse(ctx context.Context, userId int, params *GetClosesByUserIdParams, reqEditors ...RequestEditorFn) (*GetClosesByUserIdResponse, error)

GetClosesByUserIdWithResponse Get a list of closes by user id

Returns a wrapper object for the known response body format(s).

Corresponds with GET /users/{user_id}/closes (the `GetClosesByUserId` operationId).

func (*ClientWithResponses) GetClosesWithResponse

func (c *ClientWithResponses) GetClosesWithResponse(ctx context.Context, params *GetClosesParams, reqEditors ...RequestEditorFn) (*GetClosesResponse, error)

GetClosesWithResponse Get a list of closes

Returns a wrapper object for the known response body format(s).

Corresponds with GET /closes (the `GetCloses` operationId).

func (*ClientWithResponses) GetInternshipsWithResponse

func (c *ClientWithResponses) GetInternshipsWithResponse(ctx context.Context, params *GetInternshipsParams, reqEditors ...RequestEditorFn) (*GetInternshipsResponse, error)

GetInternshipsWithResponse Get a list of internships

Returns a wrapper object for the known response body format(s).

Corresponds with GET /internships (the `GetInternships` operationId).

func (*ClientWithResponses) GetLanguageByIdWithResponse

func (c *ClientWithResponses) GetLanguageByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetLanguageByIdResponse, error)

GetLanguageByIdWithResponse Get a language by ID

Returns a wrapper object for the known response body format(s).

Corresponds with GET /languages/{id} (the `GetLanguageById` operationId).

func (*ClientWithResponses) GetUserByIdWithResponse

func (c *ClientWithResponses) GetUserByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetUserByIdResponse, error)

GetUserByIdWithResponse Get a user by ID

Returns a wrapper object for the known response body format(s).

Corresponds with GET /users/{id} (the `GetUserById` operationId).

func (*ClientWithResponses) GetUserCandidatureByIdWithResponse

func (c *ClientWithResponses) GetUserCandidatureByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetUserCandidatureByIdResponse, error)

GetUserCandidatureByIdWithResponse Get user candidature information

Returns a wrapper object for the known response body format(s).

Corresponds with GET /users/{id}/user_candidature (the `GetUserCandidatureById` operationId).

func (*ClientWithResponses) GetUsersWithResponse

func (c *ClientWithResponses) GetUsersWithResponse(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*GetUsersResponse, error)

GetUsersWithResponse Get a list of users

Returns a wrapper object for the known response body format(s).

Corresponds with GET /users (the `GetUsers` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// GetClosesWithResponse Get a list of closes
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /closes (the `GetCloses` operationId).
	GetClosesWithResponse(ctx context.Context, params *GetClosesParams, reqEditors ...RequestEditorFn) (*GetClosesResponse, error)

	// GetCloseByIdWithResponse Get a close by ID
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /closes/{id} (the `GetCloseById` operationId).
	GetCloseByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetCloseByIdResponse, error)

	// GetInternshipsWithResponse Get a list of internships
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /internships (the `GetInternships` operationId).
	GetInternshipsWithResponse(ctx context.Context, params *GetInternshipsParams, reqEditors ...RequestEditorFn) (*GetInternshipsResponse, error)

	// GetLanguageByIdWithResponse Get a language by ID
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /languages/{id} (the `GetLanguageById` operationId).
	GetLanguageByIdWithResponse(ctx context.Context, id int, reqEditors ...RequestEditorFn) (*GetLanguageByIdResponse, error)

	// GetUsersWithResponse Get a list of users
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /users (the `GetUsers` operationId).
	GetUsersWithResponse(ctx context.Context, params *GetUsersParams, reqEditors ...RequestEditorFn) (*GetUsersResponse, error)

	// GetUserByIdWithResponse Get a user by ID
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /users/{id} (the `GetUserById` operationId).
	GetUserByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetUserByIdResponse, error)

	// GetUserCandidatureByIdWithResponse Get user candidature information
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /users/{id}/user_candidature (the `GetUserCandidatureById` operationId).
	GetUserCandidatureByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*GetUserCandidatureByIdResponse, error)

	// GetClosesByUserIdWithResponse Get a list of closes by user id
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /users/{user_id}/closes (the `GetClosesByUserId` operationId).
	GetClosesByUserIdWithResponse(ctx context.Context, userId int, params *GetClosesByUserIdParams, reqEditors ...RequestEditorFn) (*GetClosesByUserIdResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CloseResponse

type CloseResponse struct {
	// Closer Example: {"active":true,"alumni?":false,"alumnized_at":null,"anonymize_date":"2025-10-24T00:00:00.000+02:00","correction_point":4,"created_at":"2018-07-17T08:57:33.128Z","data_erasure_date":"2025-10-24T00:00:00.000+02:00","displayname":"Malo Allain","email":"malallai@student.42.fr","first_name":"Malo","id":39962,"image":{"link":"https://cdn.intra.42.fr/users/39a641ed152b654cfbff5c5864eb05c1/malallai.jpg","versions":{"large":"https://cdn.intra.42.fr/users/a818d7a54298d333411557d0b55b61b3/large_malallai.jpg","medium":"https://cdn.intra.42.fr/users/53691acd1e0ea75b782ddbe121c17423/medium_malallai.jpg","micro":"https://cdn.intra.42.fr/users/6f74b46e2016b0e6c41fa05b5952e17c/micro_malallai.jpg","small":"https://cdn.intra.42.fr/users/617de91b59fd7e59ecaf6470a4b37645/small_malallai.jpg"}},"kind":"student","last_name":"Allain","location":null,"login":"malallai","phone":"hidden","pool_month":"august","pool_year":"2018","staff":false,"updated_at":"2022-09-27T18:48:28.207Z","url":"https://api.intra.42.fr/v2/users/malallai","usual_first_name":null,"usual_full_name":"Malo Allain","wallet":290}
	Closer            LightUserResponse          `json:"closer"`
	CommunityServices []CommunityServiceResponse `json:"community_services"`
	CreatedAt         time.Time                  `json:"created_at"`
	EndAt             *time.Time                 `json:"end_at,omitempty"`
	Id                int                        `json:"id"`
	Kind              CloseResponseKind          `json:"kind"`
	Reason            string                     `json:"reason"`
	State             string                     `json:"state"`
	UpdatedAt         time.Time                  `json:"updated_at"`

	// User Example: {"active":true,"alumni?":false,"alumnized_at":null,"anonymize_date":"2025-10-24T00:00:00.000+02:00","correction_point":4,"created_at":"2018-07-17T08:57:33.128Z","data_erasure_date":"2025-10-24T00:00:00.000+02:00","displayname":"Malo Allain","email":"malallai@student.42.fr","first_name":"Malo","id":39962,"image":{"link":"https://cdn.intra.42.fr/users/39a641ed152b654cfbff5c5864eb05c1/malallai.jpg","versions":{"large":"https://cdn.intra.42.fr/users/a818d7a54298d333411557d0b55b61b3/large_malallai.jpg","medium":"https://cdn.intra.42.fr/users/53691acd1e0ea75b782ddbe121c17423/medium_malallai.jpg","micro":"https://cdn.intra.42.fr/users/6f74b46e2016b0e6c41fa05b5952e17c/micro_malallai.jpg","small":"https://cdn.intra.42.fr/users/617de91b59fd7e59ecaf6470a4b37645/small_malallai.jpg"}},"kind":"student","last_name":"Allain","location":null,"login":"malallai","phone":"hidden","pool_month":"august","pool_year":"2018","staff":false,"updated_at":"2022-09-27T18:48:28.207Z","url":"https://api.intra.42.fr/v2/users/malallai","usual_first_name":null,"usual_full_name":"Malo Allain","wallet":290}
	User LightUserResponse `json:"user"`
}

CloseResponse defines model for CloseResponse.

type CloseResponseKind

type CloseResponseKind string

CloseResponseKind defines model for CloseResponse.Kind.

const (
	CloseResponseKindAgu               CloseResponseKind = "agu"
	CloseResponseKindBlackHole         CloseResponseKind = "black_hole"
	CloseResponseKindDeserter          CloseResponseKind = "deserter"
	CloseResponseKindNonAdmitted       CloseResponseKind = "non_admitted"
	CloseResponseKindOther             CloseResponseKind = "other"
	CloseResponseKindPaceUnknown       CloseResponseKind = "pace_unknown"
	CloseResponseKindSeriousMisconduct CloseResponseKind = "serious_misconduct"
	CloseResponseKindSocialSecurity    CloseResponseKind = "social_security"
)

Defines values for CloseResponseKind.

func (CloseResponseKind) Valid

func (e CloseResponseKind) Valid() bool

Valid indicates whether the value is a known member of the CloseResponseKind enum.

type CommunityServiceResponse

type CommunityServiceResponse struct {
	CreatedAt  time.Time `json:"created_at"`
	Duration   int       `json:"duration"`
	Id         int       `json:"id"`
	Occupation string    `json:"occupation"`
	ScheduleAt time.Time `json:"schedule_at"`
	State      string    `json:"state"`
	UpdatedAt  *string   `json:"updated_at,omitempty"`
}

CommunityServiceResponse defines model for CommunityServiceResponse.

type Config

type Config struct {
	clientcredentials.Config
	ServerURL string
}

func (Config) WithClientCredentials

func (c Config) WithClientCredentials(clientID, clientSecret string) Config

func (Config) WithScopes

func (c Config) WithScopes(scopes ...string) Config

type CursusResponse

type CursusResponse struct {
	CreatedAt time.Time `json:"created_at"`
	Id        int       `json:"id"`
	Kind      string    `json:"kind"`
	Name      string    `json:"name"`
	Slug      string    `json:"slug"`
}

CursusResponse defines model for CursusResponse.

type CursusUserResponse

type CursusUserResponse struct {
	BeginAt      time.Time       `json:"begin_at"`
	BlackholedAt *time.Time      `json:"blackholed_at,omitempty"`
	CreatedAt    time.Time       `json:"created_at"`
	Cursus       CursusResponse  `json:"cursus"`
	CursusId     int             `json:"cursus_id"`
	EndAt        *time.Time      `json:"end_at,omitempty"`
	Grade        string          `json:"grade"`
	HasCoalition bool            `json:"has_coalition"`
	Id           int             `json:"id"`
	Level        float64         `json:"level"`
	Skills       []SkillResponse `json:"skills"`
	UpdatedAt    time.Time       `json:"updated_at"`
}

CursusUserResponse defines model for CursusUserResponse.

type Error

type Error struct {
	// Error Error message
	Error string `json:"error"`

	// Status HTTP status code
	Status int `json:"status"`
}

Error Example: {"error":"The access token is invalid","status":401}

type ErrorResponse

type ErrorResponse = Error

ErrorResponse Example: {"error":"The access token is invalid","status":401}

type GetCloseByIdResponse

type GetCloseByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *CloseResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetCloseByIdResponse

func ParseGetCloseByIdResponse(rsp *http.Response) (*GetCloseByIdResponse, error)

ParseGetCloseByIdResponse parses an HTTP response from a GetCloseByIdWithResponse call

func (GetCloseByIdResponse) ContentType

func (r GetCloseByIdResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetCloseByIdResponse) GetBody

func (r GetCloseByIdResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetCloseByIdResponse) GetJSON200

func (r GetCloseByIdResponse) GetJSON200() *CloseResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetCloseByIdResponse) GetJSONDefault

func (r GetCloseByIdResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetCloseByIdResponse) Status

func (r GetCloseByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetCloseByIdResponse) StatusCode

func (r GetCloseByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetClosesByUserIdParams

type GetClosesByUserIdParams struct {
	// Sort The sort field. Sorted by created_at desc, id desc by default.
	// Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
	Sort *GetClosesByUserIdParamsSort `form:"sort,omitempty" json:"sort,omitempty"`

	// Filter Filtering on one or more fields. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid, campus_id, end.
	Filter *map[string]string `json:"filter,omitempty"`

	// Range Select on a particular range. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
	Range *map[string]string `json:"range,omitempty"`

	// Page Page number (1-based). The 42 API paginates index endpoints and defaults to 30 items per page.
	// You can also use the `per_page` parameter to set the page size (up to 100 for many endpoints).
	Page *Page `form:"page,omitempty" json:"page,omitempty"`

	// PerPage Number of items per page. Maximum is generally 100 but some endpoints limit this for technical reasons.
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`

	// PageNumber Alternate pagination style using `page[number]` (1-based page index). Can be used together with `page[size]`.
	PageNumber *PageNumber `form:"page[number],omitempty" json:"page[number],omitempty"`

	// PageSize Alternate pagination style to set the page size (maximum depends on endpoint, commonly up to 100).
	PageSize *PageSize `form:"page[size],omitempty" json:"page[size],omitempty"`
}

GetClosesByUserIdParams defines parameters for GetClosesByUserId.

type GetClosesByUserIdParamsSort

type GetClosesByUserIdParamsSort string

GetClosesByUserIdParamsSort defines parameters for GetClosesByUserId.

const (
	GetClosesByUserIdParamsSortCloserId  GetClosesByUserIdParamsSort = "closer_id"
	GetClosesByUserIdParamsSortCreatedAt GetClosesByUserIdParamsSort = "created_at"
	GetClosesByUserIdParamsSortEndAt     GetClosesByUserIdParamsSort = "end_at"
	GetClosesByUserIdParamsSortId        GetClosesByUserIdParamsSort = "id"
	GetClosesByUserIdParamsSortJid       GetClosesByUserIdParamsSort = "jid"
	GetClosesByUserIdParamsSortKind      GetClosesByUserIdParamsSort = "kind"
	GetClosesByUserIdParamsSortReason    GetClosesByUserIdParamsSort = "reason"
	GetClosesByUserIdParamsSortState     GetClosesByUserIdParamsSort = "state"
	GetClosesByUserIdParamsSortUpdatedAt GetClosesByUserIdParamsSort = "updated_at"
	GetClosesByUserIdParamsSortUserId    GetClosesByUserIdParamsSort = "user_id"
)

Defines values for GetClosesByUserIdParamsSort.

func (GetClosesByUserIdParamsSort) Valid

Valid indicates whether the value is a known member of the GetClosesByUserIdParamsSort enum.

type GetClosesByUserIdResponse

type GetClosesByUserIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]CloseResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetClosesByUserIdResponse

func ParseGetClosesByUserIdResponse(rsp *http.Response) (*GetClosesByUserIdResponse, error)

ParseGetClosesByUserIdResponse parses an HTTP response from a GetClosesByUserIdWithResponse call

func (GetClosesByUserIdResponse) ContentType

func (r GetClosesByUserIdResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetClosesByUserIdResponse) GetBody

func (r GetClosesByUserIdResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetClosesByUserIdResponse) GetJSON200

func (r GetClosesByUserIdResponse) GetJSON200() *[]CloseResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetClosesByUserIdResponse) GetJSONDefault

func (r GetClosesByUserIdResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetClosesByUserIdResponse) Status

func (r GetClosesByUserIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetClosesByUserIdResponse) StatusCode

func (r GetClosesByUserIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetClosesParams

type GetClosesParams struct {
	// Sort The sort field. Sorted by created_at desc, id desc by default.
	// Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
	Sort *GetClosesParamsSort `form:"sort,omitempty" json:"sort,omitempty"`

	// Filter Filtering on one or more fields. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid, campus_id, end.
	Filter *map[string]string `json:"filter,omitempty"`

	// Range Select on a particular range. Must be one of: id, user_id, closer_id, reason, state, created_at, updated_at, kind, end_at, jid.
	Range *map[string]string `json:"range,omitempty"`

	// Page Page number (1-based). The 42 API paginates index endpoints and defaults to 30 items per page.
	// You can also use the `per_page` parameter to set the page size (up to 100 for many endpoints).
	Page *Page `form:"page,omitempty" json:"page,omitempty"`

	// PerPage Number of items per page. Maximum is generally 100 but some endpoints limit this for technical reasons.
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`

	// PageNumber Alternate pagination style using `page[number]` (1-based page index). Can be used together with `page[size]`.
	PageNumber *PageNumber `form:"page[number],omitempty" json:"page[number],omitempty"`

	// PageSize Alternate pagination style to set the page size (maximum depends on endpoint, commonly up to 100).
	PageSize *PageSize `form:"page[size],omitempty" json:"page[size],omitempty"`
}

GetClosesParams defines parameters for GetCloses.

type GetClosesParamsSort

type GetClosesParamsSort string

GetClosesParamsSort defines parameters for GetCloses.

const (
	GetClosesParamsSortCloserId  GetClosesParamsSort = "closer_id"
	GetClosesParamsSortCreatedAt GetClosesParamsSort = "created_at"
	GetClosesParamsSortEndAt     GetClosesParamsSort = "end_at"
	GetClosesParamsSortId        GetClosesParamsSort = "id"
	GetClosesParamsSortJid       GetClosesParamsSort = "jid"
	GetClosesParamsSortKind      GetClosesParamsSort = "kind"
	GetClosesParamsSortReason    GetClosesParamsSort = "reason"
	GetClosesParamsSortState     GetClosesParamsSort = "state"
	GetClosesParamsSortUpdatedAt GetClosesParamsSort = "updated_at"
	GetClosesParamsSortUserId    GetClosesParamsSort = "user_id"
)

Defines values for GetClosesParamsSort.

func (GetClosesParamsSort) Valid

func (e GetClosesParamsSort) Valid() bool

Valid indicates whether the value is a known member of the GetClosesParamsSort enum.

type GetClosesResponse

type GetClosesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]CloseResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetClosesResponse

func ParseGetClosesResponse(rsp *http.Response) (*GetClosesResponse, error)

ParseGetClosesResponse parses an HTTP response from a GetClosesWithResponse call

func (GetClosesResponse) ContentType

func (r GetClosesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetClosesResponse) GetBody

func (r GetClosesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetClosesResponse) GetJSON200

func (r GetClosesResponse) GetJSON200() *[]CloseResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetClosesResponse) GetJSONDefault

func (r GetClosesResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetClosesResponse) Status

func (r GetClosesResponse) Status() string

Status returns HTTPResponse.Status

func (GetClosesResponse) StatusCode

func (r GetClosesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetInternshipsParams

type GetInternshipsParams struct {
	// Sort The sort field. Sorted by id desc by default.
	// Must be one of: id, user_id, administration_id, offer_id, language_id, state, days, user_address, user_postal, user_city, user_country, company_name, company_boss_user_first_name, company_boss_user_last_name, company_boss_user_email, company_boss_user_phone, company_user_first_name, company_user_last_name, company_user_post, company_user_email, company_user_phone, company_address, company_postal, company_city, company_country, company_siret, internship_address, internship_postal, internship_city, internship_country, contract_type, subject, start_at, end_at, duration, nb_days, nb_hours, movement, salary, currency, breach_at, convention, created_at, updated_at, anti_grav_units_user_id.
	// Example: -updated_at,anti_grav_units_user_id (to sort by updated_at descending and anti_grav_units_user_id ascending)
	Sort *string `form:"sort,omitempty" json:"sort,omitempty"`

	// Filter Filtering on one or more fields.
	// Must be one of: id, user_id, administration_id, offer_id, language_id, state, days, user_address, user_postal, user_city, user_country, company_name, company_boss_user_first_name, company_boss_user_last_name, company_boss_user_email, company_boss_user_phone, company_user_first_name, company_user_last_name, company_user_post, company_user_email, company_user_phone, company_address, company_postal, company_city, company_country, company_siret, internship_address, internship_postal, internship_city, internship_country, contract_type, subject, start_at, end_at, duration, nb_days, nb_hours, movement, salary, currency, breach_at, convention, created_at, updated_at, anti_grav_units_user_id.
	// Example: filter[id]=a_value,another_value (to filter on internships with id matching a_value or another_value)
	Filter *map[string]string `json:"filter,omitempty"`

	// Range Select on a particular range.
	// Must be one of: id, user_id, administration_id, offer_id, language_id, state, days, user_address, user_postal, user_city, user_country, company_name, company_boss_user_first_name, company_boss_user_last_name, company_boss_user_email, company_boss_user_phone, company_user_first_name, company_user_last_name, company_user_post, company_user_email, company_user_phone, company_address, company_postal, company_city, company_country, company_siret, internship_address, internship_postal, internship_city, internship_country, contract_type, subject, start_at, end_at, duration, nb_days, nb_hours, movement, salary, currency, breach_at, convention, created_at, updated_at.
	// Example: range[status]=min_value,max_value (to range on internships with status field between min_value and max_value)
	Range *map[string]string `json:"range,omitempty"`

	// Page Page number (1-based). The 42 API paginates index endpoints and defaults to 30 items per page.
	// You can also use the `per_page` parameter to set the page size (up to 100 for many endpoints).
	Page *Page `form:"page,omitempty" json:"page,omitempty"`

	// PerPage Number of items per page. Maximum is generally 100 but some endpoints limit this for technical reasons.
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`

	// PageNumber Alternate pagination style using `page[number]` (1-based page index). Can be used together with `page[size]`.
	PageNumber *PageNumber `form:"page[number],omitempty" json:"page[number],omitempty"`

	// PageSize Alternate pagination style to set the page size (maximum depends on endpoint, commonly up to 100).
	PageSize *PageSize `form:"page[size],omitempty" json:"page[size],omitempty"`
}

GetInternshipsParams defines parameters for GetInternships.

type GetInternshipsResponse

type GetInternshipsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]InternshipResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetInternshipsResponse200Headers
}

func ParseGetInternshipsResponse

func ParseGetInternshipsResponse(rsp *http.Response) (*GetInternshipsResponse, error)

ParseGetInternshipsResponse parses an HTTP response from a GetInternshipsWithResponse call

func (GetInternshipsResponse) ContentType

func (r GetInternshipsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetInternshipsResponse) GetBody

func (r GetInternshipsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetInternshipsResponse) GetJSON200

func (r GetInternshipsResponse) GetJSON200() *[]InternshipResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetInternshipsResponse) GetJSONDefault

func (r GetInternshipsResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetInternshipsResponse) Status

func (r GetInternshipsResponse) Status() string

Status returns HTTPResponse.Status

func (GetInternshipsResponse) StatusCode

func (r GetInternshipsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetInternshipsResponse200Headers

type GetInternshipsResponse200Headers struct {
	Link     *string
	XPage    *int
	XPerPage *int
	XTotal   *int
}

GetInternshipsResponse200Headers the declared response headers of an HTTP 200 response for GetInternships

type GetLanguageByIdResponse

type GetLanguageByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *LanguageResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetLanguageByIdResponse

func ParseGetLanguageByIdResponse(rsp *http.Response) (*GetLanguageByIdResponse, error)

ParseGetLanguageByIdResponse parses an HTTP response from a GetLanguageByIdWithResponse call

func (GetLanguageByIdResponse) ContentType

func (r GetLanguageByIdResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetLanguageByIdResponse) GetBody

func (r GetLanguageByIdResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetLanguageByIdResponse) GetJSON200

func (r GetLanguageByIdResponse) GetJSON200() *LanguageResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetLanguageByIdResponse) GetJSONDefault

func (r GetLanguageByIdResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetLanguageByIdResponse) Status

func (r GetLanguageByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetLanguageByIdResponse) StatusCode

func (r GetLanguageByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUserByIdResponse

type GetUserByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *UserResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetUserByIdResponse

func ParseGetUserByIdResponse(rsp *http.Response) (*GetUserByIdResponse, error)

ParseGetUserByIdResponse parses an HTTP response from a GetUserByIdWithResponse call

func (GetUserByIdResponse) ContentType

func (r GetUserByIdResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetUserByIdResponse) GetBody

func (r GetUserByIdResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetUserByIdResponse) GetJSON200

func (r GetUserByIdResponse) GetJSON200() *UserResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetUserByIdResponse) GetJSONDefault

func (r GetUserByIdResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetUserByIdResponse) Status

func (r GetUserByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetUserByIdResponse) StatusCode

func (r GetUserByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUserCandidatureByIdResponse

type GetUserCandidatureByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *UserCandidatureResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
}

func ParseGetUserCandidatureByIdResponse

func ParseGetUserCandidatureByIdResponse(rsp *http.Response) (*GetUserCandidatureByIdResponse, error)

ParseGetUserCandidatureByIdResponse parses an HTTP response from a GetUserCandidatureByIdWithResponse call

func (GetUserCandidatureByIdResponse) ContentType

func (r GetUserCandidatureByIdResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetUserCandidatureByIdResponse) GetBody

func (r GetUserCandidatureByIdResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetUserCandidatureByIdResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetUserCandidatureByIdResponse) GetJSONDefault

func (r GetUserCandidatureByIdResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetUserCandidatureByIdResponse) Status

Status returns HTTPResponse.Status

func (GetUserCandidatureByIdResponse) StatusCode

func (r GetUserCandidatureByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUsersParams

type GetUsersParams struct {
	// Sort The sort field. Sorted by id desc by default.
	// Must be one of: id, login, email, encrypted_password, reset_password_token, reset_password_sent_at, created_at, updated_at, image, first_name, last_name, pool_year, pool_month, kind, status, otp_secret_key, otp_tmp, otp_activated, otp_backup_passwords, slack_team, slack_login, slack_mail, slack_code_validation, slack_validated_at, token_id, email_stop, linked_user_id, usual_first_name, last_seen_at, password_changed_at, encrypted_single_usage_password, first_warn_anon_sent_at, second_warn_anon_sent_at, alumnized_at, anonymized_at.
	// Example: -alumnized_at,anonymized_at (to sort on alumnized_at descending and anonymized_at ascending)
	Sort *string `form:"sort,omitempty" json:"sort,omitempty"`

	// Filter Filtering on one or more fields.
	// Must be one of: id, login, email, created_at, updated_at, pool_year, pool_month, kind, status, primary_campus_id, first_name, last_name, alumni?, staff?.
	// Example: filter[id]=a_value,another_value (to filter on users with id matching a_value or another_value)
	Filter *map[string]string `json:"filter,omitempty"`

	// Range Select on a particular range.
	// Must be one of: id, login, email, created_at, updated_at, pool_year, pool_month, kind, status.
	// Example: range[status]=min_value,max_value (to range on users with status field between min_value and max_value)
	Range *map[string]string `json:"range,omitempty"`

	// Page Page number (1-based). The 42 API paginates index endpoints and defaults to 30 items per page.
	// You can also use the `per_page` parameter to set the page size (up to 100 for many endpoints).
	Page *Page `form:"page,omitempty" json:"page,omitempty"`

	// PerPage Number of items per page. Maximum is generally 100 but some endpoints limit this for technical reasons.
	PerPage *PerPage `form:"per_page,omitempty" json:"per_page,omitempty"`

	// PageNumber Alternate pagination style using `page[number]` (1-based page index). Can be used together with `page[size]`.
	PageNumber *PageNumber `form:"page[number],omitempty" json:"page[number],omitempty"`

	// PageSize Alternate pagination style to set the page size (maximum depends on endpoint, commonly up to 100).
	PageSize *PageSize `form:"page[size],omitempty" json:"page[size],omitempty"`
}

GetUsersParams defines parameters for GetUsers.

type GetUsersResponse

type GetUsersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *[]LightUserResponse
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *ErrorResponse
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *GetUsersResponse200Headers
}

func ParseGetUsersResponse

func ParseGetUsersResponse(rsp *http.Response) (*GetUsersResponse, error)

ParseGetUsersResponse parses an HTTP response from a GetUsersWithResponse call

func (GetUsersResponse) ContentType

func (r GetUsersResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetUsersResponse) GetBody

func (r GetUsersResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetUsersResponse) GetJSON200

func (r GetUsersResponse) GetJSON200() *[]LightUserResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetUsersResponse) GetJSONDefault

func (r GetUsersResponse) GetJSONDefault() *ErrorResponse

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetUsersResponse) Status

func (r GetUsersResponse) Status() string

Status returns HTTPResponse.Status

func (GetUsersResponse) StatusCode

func (r GetUsersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUsersResponse200Headers

type GetUsersResponse200Headers struct {
	Link     *string
	XPage    *int
	XPerPage *int
	XTotal   *int
}

GetUsersResponse200Headers the declared response headers of an HTTP 200 response for GetUsers

type GroupResponse

type GroupResponse struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

GroupResponse defines model for GroupResponse.

type HasJSON200Slice

type HasJSON200Slice[T any] interface {
	GetJSON200() *[]T
	GetBody() []byte
}

Varies per endpoint — needs a type parameter

type HasJSONDefault

type HasJSONDefault interface {
	GetJSONDefault() *ErrorResponse
}

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InternshipResponse

type InternshipResponse struct {
	AdministrationId         int        `json:"administration_id"`
	BreachAt                 *time.Time `json:"breach_at"`
	CompanyAddress           string     `json:"company_address"`
	CompanyBossUserEmail     string     `json:"company_boss_user_email"`
	CompanyBossUserFirstName string     `json:"company_boss_user_first_name"`
	CompanyBossUserLastName  string     `json:"company_boss_user_last_name"`
	CompanyBossUserPhone     string     `json:"company_boss_user_phone"`
	CompanyCity              string     `json:"company_city"`
	CompanyCountry           string     `json:"company_country"`
	CompanyName              string     `json:"company_name"`
	CompanyPostal            string     `json:"company_postal"`
	CompanySiret             string     `json:"company_siret"`
	CompanyUserEmail         string     `json:"company_user_email"`
	CompanyUserFirstName     string     `json:"company_user_first_name"`
	CompanyUserLastName      string     `json:"company_user_last_name"`
	CompanyUserPhone         string     `json:"company_user_phone"`
	CompanyUserPost          string     `json:"company_user_post"`
	ContractType             string     `json:"contract_type"`
	Convention               struct {
		Convention struct {
			Url *string `json:"url"`
		} `json:"convention"`
	} `json:"convention"`
	ConventionUri     *string                   `json:"convention_uri"`
	Currency          string                    `json:"currency"`
	Days              string                    `json:"days"`
	Duration          int                       `json:"duration"`
	EndAt             time.Time                 `json:"end_at"`
	Id                int                       `json:"id"`
	InternshipAddress string                    `json:"internship_address"`
	InternshipCity    string                    `json:"internship_city"`
	InternshipCountry string                    `json:"internship_country"`
	InternshipPostal  string                    `json:"internship_postal"`
	LanguageId        int                       `json:"language_id"`
	NbDays            int                       `json:"nb_days"`
	NbHours           int                       `json:"nb_hours"`
	OfferId           *int                      `json:"offer_id"`
	ProjectsUser      *int                      `json:"projects_user,omitempty"`
	Salary            InternshipResponse_Salary `json:"salary"`
	StartAt           time.Time                 `json:"start_at"`
	State             string                    `json:"state"`
	Subject           string                    `json:"subject"`

	// User Example: {"active":true,"alumni?":false,"alumnized_at":null,"anonymize_date":"2025-10-24T00:00:00.000+02:00","correction_point":4,"created_at":"2018-07-17T08:57:33.128Z","data_erasure_date":"2025-10-24T00:00:00.000+02:00","displayname":"Malo Allain","email":"malallai@student.42.fr","first_name":"Malo","id":39962,"image":{"link":"https://cdn.intra.42.fr/users/39a641ed152b654cfbff5c5864eb05c1/malallai.jpg","versions":{"large":"https://cdn.intra.42.fr/users/a818d7a54298d333411557d0b55b61b3/large_malallai.jpg","medium":"https://cdn.intra.42.fr/users/53691acd1e0ea75b782ddbe121c17423/medium_malallai.jpg","micro":"https://cdn.intra.42.fr/users/6f74b46e2016b0e6c41fa05b5952e17c/micro_malallai.jpg","small":"https://cdn.intra.42.fr/users/617de91b59fd7e59ecaf6470a4b37645/small_malallai.jpg"}},"kind":"student","last_name":"Allain","location":null,"login":"malallai","phone":"hidden","pool_month":"august","pool_year":"2018","staff":false,"updated_at":"2022-09-27T18:48:28.207Z","url":"https://api.intra.42.fr/v2/users/malallai","usual_first_name":null,"usual_full_name":"Malo Allain","wallet":290}
	User        LightUserResponse `json:"user"`
	UserAddress string            `json:"user_address"`
	UserCity    string            `json:"user_city"`
	UserCountry string            `json:"user_country"`
	UserPostal  string            `json:"user_postal"`
}

InternshipResponse defines model for InternshipResponse.

type InternshipResponseSalary0

type InternshipResponseSalary0 = int

InternshipResponseSalary0 defines model for InternshipResponse.Salary.0.

type InternshipResponseSalary1

type InternshipResponseSalary1 = float32

InternshipResponseSalary1 defines model for InternshipResponse.Salary.1.

type InternshipResponse_Salary

type InternshipResponse_Salary struct {
	// contains filtered or unexported fields
}

InternshipResponse_Salary defines model for InternshipResponse.Salary.

func (InternshipResponse_Salary) AsInternshipResponseSalary0

func (t InternshipResponse_Salary) AsInternshipResponseSalary0() (InternshipResponseSalary0, error)

AsInternshipResponseSalary0 returns the union data inside the InternshipResponse_Salary as a InternshipResponseSalary0

func (InternshipResponse_Salary) AsInternshipResponseSalary1

func (t InternshipResponse_Salary) AsInternshipResponseSalary1() (InternshipResponseSalary1, error)

AsInternshipResponseSalary1 returns the union data inside the InternshipResponse_Salary as a InternshipResponseSalary1

func (*InternshipResponse_Salary) FromInternshipResponseSalary0

func (t *InternshipResponse_Salary) FromInternshipResponseSalary0(v InternshipResponseSalary0) error

FromInternshipResponseSalary0 overwrites any union data inside the InternshipResponse_Salary as the provided InternshipResponseSalary0

func (*InternshipResponse_Salary) FromInternshipResponseSalary1

func (t *InternshipResponse_Salary) FromInternshipResponseSalary1(v InternshipResponseSalary1) error

FromInternshipResponseSalary1 overwrites any union data inside the InternshipResponse_Salary as the provided InternshipResponseSalary1

func (InternshipResponse_Salary) MarshalJSON

func (t InternshipResponse_Salary) MarshalJSON() ([]byte, error)

func (*InternshipResponse_Salary) MergeInternshipResponseSalary0

func (t *InternshipResponse_Salary) MergeInternshipResponseSalary0(v InternshipResponseSalary0) error

MergeInternshipResponseSalary0 performs a merge with any union data inside the InternshipResponse_Salary, using the provided InternshipResponseSalary0

func (*InternshipResponse_Salary) MergeInternshipResponseSalary1

func (t *InternshipResponse_Salary) MergeInternshipResponseSalary1(v InternshipResponseSalary1) error

MergeInternshipResponseSalary1 performs a merge with any union data inside the InternshipResponse_Salary, using the provided InternshipResponseSalary1

func (*InternshipResponse_Salary) UnmarshalJSON

func (t *InternshipResponse_Salary) UnmarshalJSON(b []byte) error

type IntraDateTime

type IntraDateTime = IntraTime

IntraDateTime Example: 2017-03-25T13:30:00.000Z

type IntraTime

type IntraTime time.Time

IntraTime accepts Intra date strings that may be date-only or RFC3339 date-times.

func (IntraTime) MarshalJSON

func (t IntraTime) MarshalJSON() ([]byte, error)

MarshalJSON renders the time in RFC3339Nano.

func (IntraTime) Time

func (t IntraTime) Time() time.Time

Time exposes the underlying time.Time value.

func (*IntraTime) UnmarshalJSON

func (t *IntraTime) UnmarshalJSON(data []byte) error

UnmarshalJSON normalizes common Intra formats before parsing.

type LanguageResponse

type LanguageResponse struct {
	CreatedAt  time.Time `json:"created_at"`
	Id         int       `json:"id"`
	Identifier string    `json:"identifier"`
	Name       string    `json:"name"`
	UpdatedAt  time.Time `json:"updated_at"`
}

LanguageResponse defines model for LanguageResponse.

type LanguageUserResponse

type LanguageUserResponse struct {
	CreatedAt  time.Time `json:"created_at"`
	Id         int       `json:"id"`
	LanguageId int       `json:"language_id"`
	Position   int       `json:"position"`
	UserId     int       `json:"user_id"`
}

LanguageUserResponse defines model for LanguageUserResponse.

type LightUserResponse

type LightUserResponse struct {
	// Active Indicates if the user is active.
	Active bool `json:"active"`

	// Alumni Indicates if the user is an alumnus.
	Alumni bool `json:"alumni?"`

	// AlumnizedAt The date when the user became an alumnus.
	AlumnizedAt *time.Time `json:"alumnized_at,omitempty"`

	// AnonymizeDate The date when user data will be anonymized.
	AnonymizeDate time.Time `json:"anonymize_date"`

	// CorrectionPoint The user's correction points.
	CorrectionPoint int `json:"correction_point"`

	// CreatedAt The user creation timestamp.
	CreatedAt time.Time `json:"created_at"`

	// DataErasureDate The date when user data will be erased.
	DataErasureDate time.Time `json:"data_erasure_date"`

	// Displayname The display name of the user.
	Displayname string `json:"displayname"`

	// Email The email address of the user.
	Email string `json:"email"`

	// FirstName The first name of the user.
	FirstName string `json:"first_name"`

	// Id The unique identifier of the user.
	Id    int                `json:"id"`
	Image *UserImageResponse `json:"image,omitempty"`

	// Kind The kind of user (e.g., student, admin, external).
	Kind LightUserResponseKind `json:"kind"`

	// LastName The last name of the user.
	LastName string `json:"last_name"`

	// Location The location of the user.
	Location *string `json:"location,omitempty"`

	// Login The login name of the user.
	Login string `json:"login"`

	// Phone The phone number of the user (always hidden).
	Phone *string `json:"phone,omitempty"`

	// PoolMonth The month of the user's pool.
	PoolMonth string `json:"pool_month"`

	// PoolYear The year of the user's pool.
	PoolYear string `json:"pool_year"`

	// Staff Indicates if the user is staff.
	Staff *bool `json:"staff?,omitempty"`

	// UpdatedAt The last user update timestamp.
	UpdatedAt time.Time `json:"updated_at"`

	// Url The URL to the user's resource.
	Url string `json:"url"`

	// UsualFirstName The usual first name of the user, first_name if none.
	UsualFirstName *string `json:"usual_first_name,omitempty"`

	// UsualFullName The usual full name of the user, usually usual_first_name or first_name + last_name.
	UsualFullName string `json:"usual_full_name"`

	// Wallet The user's wallet balance.
	Wallet int `json:"wallet"`
}

LightUserResponse Example: {"active":true,"alumni?":false,"alumnized_at":null,"anonymize_date":"2025-10-24T00:00:00.000+02:00","correction_point":4,"created_at":"2018-07-17T08:57:33.128Z","data_erasure_date":"2025-10-24T00:00:00.000+02:00","displayname":"Malo Allain","email":"malallai@student.42.fr","first_name":"Malo","id":39962,"image":{"link":"https://cdn.intra.42.fr/users/39a641ed152b654cfbff5c5864eb05c1/malallai.jpg","versions":{"large":"https://cdn.intra.42.fr/users/a818d7a54298d333411557d0b55b61b3/large_malallai.jpg","medium":"https://cdn.intra.42.fr/users/53691acd1e0ea75b782ddbe121c17423/medium_malallai.jpg","micro":"https://cdn.intra.42.fr/users/6f74b46e2016b0e6c41fa05b5952e17c/micro_malallai.jpg","small":"https://cdn.intra.42.fr/users/617de91b59fd7e59ecaf6470a4b37645/small_malallai.jpg"}},"kind":"student","last_name":"Allain","location":null,"login":"malallai","phone":"hidden","pool_month":"august","pool_year":"2018","staff":false,"updated_at":"2022-09-27T18:48:28.207Z","url":"https://api.intra.42.fr/v2/users/malallai","usual_first_name":null,"usual_full_name":"Malo Allain","wallet":290}

type LightUserResponseKind

type LightUserResponseKind string

LightUserResponseKind The kind of user (e.g., student, admin, external).

const (
	LightUserResponseKindAdmin    LightUserResponseKind = "admin"
	LightUserResponseKindExternal LightUserResponseKind = "external"
	LightUserResponseKindStudent  LightUserResponseKind = "student"
)

Defines values for LightUserResponseKind.

func (LightUserResponseKind) Valid

func (e LightUserResponseKind) Valid() bool

Valid indicates whether the value is a known member of the LightUserResponseKind enum.

type Page

type Page = int

Page defines model for page.

type PageNumber

type PageNumber = int

PageNumber defines model for page_number.

type PageSize

type PageSize = int

PageSize defines model for page_size.

type PatronageResponse

type PatronageResponse struct {
	CreatedAt   time.Time `json:"created_at"`
	GodfatherId *int      `json:"godfather_id,omitempty"`
	GodsonId    *int      `json:"godson_id,omitempty"`
	Id          int       `json:"id"`
	Ongoing     bool      `json:"ongoing"`
	UpdatedAt   time.Time `json:"updated_at"`
	UserId      *int      `json:"user_id,omitempty"`
}

PatronageResponse defines model for PatronageResponse.

type PerPage

type PerPage = int

PerPage defines model for per_page.

type ProjectLightResponse

type ProjectLightResponse struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	ParentId *int   `json:"parent_id,omitempty"`
	Slug     string `json:"slug"`
}

ProjectLightResponse defines model for ProjectLightResponse.

type ProjectUserResponse

type ProjectUserResponse struct {
	CreatedAt     time.Time             `json:"created_at"`
	CurrentTeamId *int                  `json:"current_team_id,omitempty"`
	CursusIds     []int                 `json:"cursus_ids"`
	FinalMark     *int                  `json:"final_mark,omitempty"`
	Id            int                   `json:"id"`
	Marked        bool                  `json:"marked"`
	MarkedAt      *time.Time            `json:"marked_at,omitempty"`
	Occurrence    int                   `json:"occurrence"`
	Project       *ProjectLightResponse `json:"project,omitempty"`
	RetriableAt   *time.Time            `json:"retriable_at,omitempty"`
	Status        string                `json:"status"`
	UpdatedAt     time.Time             `json:"updated_at"`
	Validated     *bool                 `json:"validated,omitempty"`
}

ProjectUserResponse defines model for ProjectUserResponse.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RoleResponse

type RoleResponse struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

RoleResponse defines model for RoleResponse.

type SkillResponse

type SkillResponse struct {
	Id    int     `json:"id"`
	Level float64 `json:"level"`
	Name  string  `json:"name"`
}

SkillResponse defines model for SkillResponse.

type TitleResponse

type TitleResponse struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

TitleResponse defines model for TitleResponse.

type TitleUserResponse

type TitleUserResponse struct {
	CreatedAt time.Time `json:"created_at"`
	Id        int       `json:"id"`
	Selected  bool      `json:"selected"`
	TitleId   int       `json:"title_id"`
	UpdatedAt time.Time `json:"updated_at"`
	UserId    int       `json:"user_id"`
}

TitleUserResponse defines model for TitleUserResponse.

type UserCandidatureResponse

type UserCandidatureResponse struct {
	BirthCity          string                         `json:"birth_city"`
	BirthCountry       *string                        `json:"birth_country,omitempty"`
	BirthDate          *openapi_types.Date            `json:"birth_date,omitempty"`
	ContactAffiliation string                         `json:"contact_affiliation"`
	ContactFirstName   string                         `json:"contact_first_name"`
	ContactLastName    string                         `json:"contact_last_name"`
	ContactPhone1      string                         `json:"contact_phone1"`
	ContactPhone2      *string                        `json:"contact_phone2,omitempty"`
	Country            *string                        `json:"country,omitempty"`
	CreatedAt          time.Time                      `json:"created_at"`
	Email              string                         `json:"email"`
	Gender             *UserCandidatureResponseGender `json:"gender,omitempty"`
	HiddenPhone        bool                           `json:"hidden_phone"`
	Id                 int                            `json:"id"`
	Language           string                         `json:"language"`
	MaxLevelLogic      *float64                       `json:"max_level_logic,omitempty"`
	MaxLevelMemory     *float64                       `json:"max_level_memory,omitempty"`
	MeetingDate        *IntraDateTime                 `json:"meeting_date,omitempty"`
	OtherInformation   *string                        `json:"other_information,omitempty"`
	Phone              string                         `json:"phone"`
	PhoneCountryCode   string                         `json:"phone_country_code"`
	Pin                string                         `json:"pin"`
	PiscineDate        *IntraDateTime                 `json:"piscine_date,omitempty"`
	PostalCity         string                         `json:"postal_city"`
	PostalComplement   *string                        `json:"postal_complement,omitempty"`
	PostalCountry      string                         `json:"postal_country"`
	PostalStreet       string                         `json:"postal_street"`
	PostalZipCode      string                         `json:"postal_zip_code"`
	UpdatedAt          time.Time                      `json:"updated_at"`
	UserId             int                            `json:"user_id"`
	ZipCode            *string                        `json:"zip_code,omitempty"`
}

UserCandidatureResponse Example: {"birth_city":"Paris","birth_country":"France","birth_date":"2013-01-01","contact_affiliation":"Parent","contact_first_name":"Norminette","contact_last_name":"Moulinette","contact_phone1":"+33600000000","contact_phone2":null,"country":"France","created_at":"2020-08-27T07:31:49.431Z","email":"tmatis@example.com","gender":"male","hidden_phone":false,"id":42,"language":"fr","max_level_logic":null,"max_level_memory":null,"meeting_date":"2020-08-27T07:31:49.431Z","other_information":null,"phone":"+33600000000","phone_country_code":"FR","pin":"7777","piscine_date":null,"postal_city":"Paris","postal_complement":null,"postal_country":"France","postal_street":"96 boulevard Bessières","postal_zip_code":"75017","updated_at":"2025-07-10T16:16:34.238Z","user_id":42,"zip_code":"75017"}

type UserCandidatureResponseGender

type UserCandidatureResponseGender string

UserCandidatureResponseGender defines model for UserCandidatureResponse.Gender.

const (
	UserCandidatureResponseGenderFemale UserCandidatureResponseGender = "female"
	UserCandidatureResponseGenderMale   UserCandidatureResponseGender = "male"
	UserCandidatureResponseGenderOther  UserCandidatureResponseGender = "other"
)

Defines values for UserCandidatureResponseGender.

func (UserCandidatureResponseGender) Valid

Valid indicates whether the value is a known member of the UserCandidatureResponseGender enum.

type UserImageResponse

type UserImageResponse struct {
	// Link The URL to the user's image.
	Link     string `json:"link"`
	Versions struct {
		// Large URL to the large version of the user's image.
		Large string `json:"large"`

		// Medium URL to the medium version of the user's image.
		Medium string `json:"medium"`

		// Micro URL to the micro version of the user's image.
		Micro string `json:"micro"`

		// Small URL to the small version of the user's image.
		Small string `json:"small"`
	} `json:"versions"`
}

UserImageResponse defines model for UserImageResponse.

type UserResponse

type UserResponse struct {
	Achievements []AchievementResponse `json:"achievements"`

	// Active Indicates if the user is active.
	Active bool `json:"active"`

	// Alumni Indicates if the user is an alumnus.
	Alumni bool `json:"alumni?"`

	// AlumnizedAt The date when the user became an alumnus.
	AlumnizedAt *time.Time `json:"alumnized_at,omitempty"`

	// AnonymizeDate The date when user data will be anonymized.
	AnonymizeDate time.Time            `json:"anonymize_date"`
	Campus        []CampusResponse     `json:"campus"`
	CampusUsers   []CampusUserResponse `json:"campus_users"`

	// CorrectionPoint The user's correction points.
	CorrectionPoint int `json:"correction_point"`

	// CreatedAt The user creation timestamp.
	CreatedAt   time.Time            `json:"created_at"`
	CursusUsers []CursusUserResponse `json:"cursus_users"`

	// DataErasureDate The date when user data will be erased.
	DataErasureDate time.Time `json:"data_erasure_date"`

	// Displayname The display name of the user.
	Displayname string `json:"displayname"`

	// Email The email address of the user.
	Email string `json:"email"`

	// FirstName The first name of the user.
	FirstName string          `json:"first_name"`
	Groups    []GroupResponse `json:"groups"`

	// Id The unique identifier of the user.
	Id    int                `json:"id"`
	Image *UserImageResponse `json:"image,omitempty"`

	// Kind The kind of user (e.g., student, admin, external).
	Kind           UserResponseKind       `json:"kind"`
	LanguagesUsers []LanguageUserResponse `json:"languages_users"`

	// LastName The last name of the user.
	LastName string `json:"last_name"`

	// Location The location of the user.
	Location *string `json:"location,omitempty"`

	// Login The login name of the user.
	Login     string              `json:"login"`
	Patroned  []PatronageResponse `json:"patroned"`
	Patroning []PatronageResponse `json:"patroning"`

	// Phone The phone number of the user (always hidden).
	Phone *string `json:"phone,omitempty"`

	// PoolMonth The month of the user's pool.
	PoolMonth string `json:"pool_month"`

	// PoolYear The year of the user's pool.
	PoolYear      string                `json:"pool_year"`
	ProjectsUsers []ProjectUserResponse `json:"projects_users"`
	Roles         []RoleResponse        `json:"roles"`

	// Staff Indicates if the user is staff.
	Staff       *bool               `json:"staff?,omitempty"`
	Titles      []TitleResponse     `json:"titles"`
	TitlesUsers []TitleUserResponse `json:"titles_users"`

	// UpdatedAt The last user update timestamp.
	UpdatedAt time.Time `json:"updated_at"`

	// Url The URL to the user's resource.
	Url string `json:"url"`

	// UsualFirstName The usual first name of the user, first_name if none.
	UsualFirstName *string `json:"usual_first_name,omitempty"`

	// UsualFullName The usual full name of the user, usually usual_first_name or first_name + last_name.
	UsualFullName string `json:"usual_full_name"`

	// Wallet The user's wallet balance.
	Wallet int `json:"wallet"`
}

UserResponse defines model for UserResponse.

type UserResponseKind

type UserResponseKind string

UserResponseKind The kind of user (e.g., student, admin, external).

const (
	UserResponseKindAdmin    UserResponseKind = "admin"
	UserResponseKindExternal UserResponseKind = "external"
	UserResponseKindStudent  UserResponseKind = "student"
)

Defines values for UserResponseKind.

func (UserResponseKind) Valid

func (e UserResponseKind) Valid() bool

Valid indicates whether the value is a known member of the UserResponseKind enum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL