<commit_before>/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cdancy.bitbucket.rest;

import com.cdancy.bitbucket.rest.auth.AuthenticationType;
import com.cdancy.bitbucket.rest.config.BitbucketAuthenticationModule;
import com.google.common.collect.Lists;
import java.util.Objects;
import java.util.Properties;
import org.jclouds.ContextBuilder;
import org.jclouds.javax.annotation.Nullable;

public final class BitbucketClient {

    private final String endPoint;
    private final BitbucketAuthentication credentials;
    private final BitbucketApi bitbucketApi;
    private final Properties overrides;

    /**
     * Create a BitbucketClient inferring endpoint and authentication from
     * environment and system properties.
     */
    public BitbucketClient() {
        this(null, null, null);
    }

    /**
     * Create a BitbucketClient inferring authentication from
     * environment and system properties.
     *
     * @param endPoint URL of Bitbucket instance
     */
    public BitbucketClient(@Nullable final String endPoint) {
        this(endPoint, null, null);
    }

    /**
     * Create an BitbucketClient using the passed in endpoint and Basic credential String.
     *
     * @param endPoint URL of Bitbucket instance
     * @param basicCredentials the optional credentials for the Bitbucket instance
     */
    @Deprecated //Constructor will be deleted in favor of 'String, BitbucketCredentials' version in 2.x releases
    public BitbucketClient(@Nullable final String endPoint, @Nullable final String basicCredentials) {
        this(endPoint,
                basicCredentials != null
                        ? BitbucketAuthentication.builder().credentials(basicCredentials).build()
                        : null,
                null);
    }

    /**
     * Create an BitbucketClient. If any of the passed in variables are null we
     * will query System Properties and Environment Variables, in order, to 
     * search for values that may be set in a devops/CI fashion. The only
     * difference is the `overrides` which gets merged, but takes precedence,
     * with those System Properties and Environment Variables found.
     *
     * @param endPoint URL of Bitbucket instance.
     * @param authentication authentication used to connect to Bitbucket instance.
     * @param overrides jclouds Properties to override defaults when creating a new BitbucketApi.
     */
    public BitbucketClient(@Nullable final String endPoint,
            @Nullable final BitbucketAuthentication authentication,
            @Nullable final Properties overrides) {
        this.endPoint = endPoint != null
                ? endPoint
                : BitbucketUtils.inferEndpoint();
        this.credentials = authentication != null
                ? authentication
                : BitbucketUtils.inferAuthentication();
        this.overrides = mergeOverrides(overrides);
        this.bitbucketApi = createApi(this.endPoint, this.credentials, this.overrides);<commit_msg>Remove unsupported constructors.<commit_after>/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cdancy.bitbucket.rest;

import com.cdancy.bitbucket.rest.auth.AuthenticationType;
import com.cdancy.bitbucket.rest.config.BitbucketAuthenticationModule;
import com.google.common.collect.Lists;
import java.util.Properties;
import org.jclouds.ContextBuilder;
import org.jclouds.javax.annotation.Nullable;

public final class BitbucketClient {

    private final String endPoint;
    private final BitbucketAuthentication credentials;
    private final BitbucketApi bitbucketApi;
    private final Properties overrides;

    /**
     * Create a BitbucketClient inferring endpoint and authentication from
     * environment and system properties.
     */
    public BitbucketClient() {
        this(null, null, null);
    }

    /**
     * Create an BitbucketClient. If any of the passed in variables are null we
     * will query System Properties and Environment Variables, in order, to 
     * search for values that may be set in a devops/CI fashion. The only
     * difference is the `overrides` which gets merged, but takes precedence,
     * with those System Properties and Environment Variables found.
     *
     * @param endPoint URL of Bitbucket instance.
     * @param authentication authentication used to connect to Bitbucket instance.
     * @param overrides jclouds Properties to override defaults when creating a new BitbucketApi.
     */
    public BitbucketClient(@Nullable final String endPoint,
            @Nullable final BitbucketAuthentication authentication,
            @Nullable final Properties overrides) {
        this.endPoint = endPoint != null
                ? endPoint
                : BitbucketUtils.inferEndpoint();
        this.credentials = authentication != null
                ? authentication
                : BitbucketUtils.inferAuthentication();
        this.overrides = mergeOverrides(overrides);
        this.bitbucketApi = createApi(this.endPoint, this.credentials, this.overrides);
{'fraction_non_alphanumeric': 0.06423558132438206, 'fraction_numerical': 0.00137320720170888, 'mean_word_length': 3.183152520740268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1216394', 'n_tokens_mistral': 1549, 'n_tokens_neox': 1526, 'n_words': 631}