<commit_before><?php

namespace Auth0\SDK\API\Management;

use Auth0\SDK\API\Helpers\ApiClient;
use Auth0\SDK\API\Header\ContentType;

class Tickets extends GenericResource {

    public function createEmailVerificationTicket($user_id, $result_url = null) {

        $body = array('user_id' => $user_id);
        if ($result_url !== null) {
            $body['result_url'] = $result_url;
        }

        $request = $this->apiClient->post()
            ->tickets()
            ->addPath('email-verification')
            ->withHeader(new ContentType('application/json'))
            ->withBody(json_encode($body));

        return $request->call();

    }

    public function createPasswordChangeTicket($user_id, $new_password, $result_url = null) {

        $body = array(
            'user_id' => $user_id,
            'new_password' => $<PASSWORD>
        );

        if ($result_url) {
            $body['result_url'] = $result_url;
        }

        return $this->apiClient->post()
            ->tickets()
            ->addPath('password-change')
            ->withBody(json_encode($body))
            ->call();

    }
}<commit_msg>fix change password ticket call<commit_after><?php

namespace Auth0\SDK\API\Management;

use Auth0\SDK\API\Helpers\ApiClient;
use Auth0\SDK\API\Header\ContentType;

class Tickets extends GenericResource {

    public function createEmailVerificationTicket($user_id, $result_url = null) {

        $body = array('user_id' => $user_id);
        if ($result_url !== null) {
            $body['result_url'] = $result_url;
        }

        $request = $this->apiClient->post()
            ->tickets()
            ->addPath('email-verification')
            ->withHeader(new ContentType('application/json'))
            ->withBody(json_encode($body));

        return $request->call();

    }

    public function createPasswordChangeTicket($user_id, $new_password = null, $result_url = null, $connection_id = null) {

        return $this->createPasswordChangeTicketRaw($user_id, null, $new_password, $result_url, $connection_id);
        
    }

    public function createPasswordChangeTicketByEmail($email, $new_password = null, $result_url = null, $connection_id = null) {

        return $this->createPasswordChangeTicketRaw(null, $mail, $new_password, $result_url, $connection_id);
        
    }

    public function createPasswordChangeTicketRaw($user_id = null, $email = null, $new_password = null, $result_url = null, $connection_id = null) {

        $body = [];

        if ($user_id) {
            $body['user_id'] = $user_id;
        }
        if ($email) {
            $body['email'] = $email;
        }
        if ($new_password) {
            $body['new_password'] = <PASSWORD>;
        }
        if ($result_url) {
            $body['result_url'] = $result_url;
        }
        if ($connection_id) {
            $body['connection_id'] = $connection_id;
        }

        return $this->apiClient->post()
            ->tickets()
            ->addPath('password-change')
            ->withBody(json_encode($body))
            ->call();
    }
}
{'fraction_non_alphanumeric': 0.14271876009041007, 'fraction_numerical': 0.0019373587342589602, 'mean_word_length': 2.3564463705308776, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2738071', 'n_tokens_mistral': 939, 'n_tokens_neox': 909, 'n_words': 161}