<commit_before>﻿/**
 * Copyright 2016 d-fens GmbH
 *
 * Licensed 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.
 */
 
 using System;
 using System.Diagnostics.Contracts;
 using biz.dfch.CS.Abiquo.Client.Authentication;
﻿using biz.dfch.CS.Abiquo.Client.v1.Model;
﻿using Task = biz.dfch.CS.Abiquo.Client.v1.Model.Task;

namespace biz.dfch.CS.Abiquo.Client
{
    [ContractClassFor(typeof(BaseAbiquoClient))]
    abstract class ContractClassForBaseAbiquoClient : BaseAbiquoClient
    {
        #region Login

        public override bool Login(string abiquoApiBaseUri, IAuthenticationInformation authenticationInformation)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(abiquoApiBaseUri));
            Contract.Requires(null != authenticationInformation);
            Contract.Ensures(Contract.Result<bool>() == !string.IsNullOrWhiteSpace(this.AbiquoApiBaseUri));
            Contract.Ensures(Contract.Result<bool>() == (null != this.AuthenticationInformation));
            Contract.Ensures(Contract.Result<bool>() == (null != this.CurrentUserInformation));

            return default(bool);
        }

        #endregion Login


        #region Enterprises

        public override Enterprises GetEnterprises()
        {
            Contract.Ensures(null != Contract.Result<Enterprises>());

            return default(Enterprises);
        }

        public override Enterprise GetCurrentEnterprise()
        {
            return default(Enterprise);
        }

        public override Enterprise GetEnterprise(int id)
        {
            Contract.Requires(0 < id);

            return default(Enterprise);
        }

        #endregion Enterprises


        #region Users

        public override UsersWithRoles GetUsersWithRolesOfCurrentEnterprise()
        {
            Contract.Ensures(null != Contract.Result<UsersWithRoles>());

            return default(UsersWithRoles);
        }

        public override UsersWithRoles GetUsersWithRoles(int enterpriseId)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Ensures(null != Contract.Result<UsersWithRoles>());

            return default(UsersWithRoles);
        }

        public override User GetUserOfCurrentEnterprise(int id)
        {
            Contract.Requires(0 < id);

            return default(User);
        }

        public override User GetUser(int enterpriseId, int id)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Requires(0 < id);

            return default(User);
        }

        public override User GetUserInformation()
        {
            Contract.Requires(IsLoggedIn);

            return default(User);
        }

        public override User GetUserInformation(string username)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(username));

            return default(User);
        }

        public override User GetUserInformation(int enterpriseId, string username)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Requires(!string.IsNullOrWhiteSpace(username));

            return default(User);
        }

        public override void SwitchEnterprise(Enterprise enterprise)
        {
            Contract.Requires(null != enterprise);
        }

        public override void SwitchEnterprise(int id)
        {
            Contract.Requires(0 < id);
        }

        #endregion Users


        #region Roles

        public override Roles GetRoles()
        {
            Contract.Ensures(null != Contract.Result<Roles>());

            return default(Roles);
        }

        public override Role GetRole(int id)
        {
            Contract.Requires(0 < id);

            return default(Role);
        }

        #endregion Roles


        #region DataCentersLimits

        public override DataCentersLimits GetDataCentersLimitsOfCurrentEnterprise()
        {
            return default(DataCentersLimits);
        }

        public override DataCentersLimits GetDataCentersLimits(int enterpriseId)
        {
            Contract.Requires(0 < enterpriseId);

            return default(DataCentersLimits);
        }

        public override DataCenterLimits GetDataCenterLimitsOfCurrentEnterprise(int id)
        {
            Contract.Requires(0 < id);

            return default(DataCenterLimits);
        }

        public override DataCenterLimits GetDataCenterLimits(int enterpriseId, int id)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Requires(0 < id);

            return default(DataCenterLimits);
        }

        #endregion DataCentersLimits


        #region VirtualMachines

        public override VirtualMachines GetAllVirtualMachines()
        {
            Contract.Ensures(null != Contract.Result<VirtualMachines>());

            return default(VirtualMachines);
        }

        public override VirtualMachines GetVirtualMachines(int virtualDataCenterId, int virtualApplianceId)
        {
            Contract.Requires(0 < virtualDataCenterId);
            Contract.Requires(0 < virtualApplianceId);
            Contract.Ensures(null != Contract.Result<VirtualMachines>());

            return default(VirtualMachines);
        }

        public override VirtualMachine GetVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int id)<commit_msg>Added code contracts for methods:<commit_after>﻿/**
 * Copyright 2016 d-fens GmbH
 *
 * Licensed 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.
 */
 
 using System;
 using System.Diagnostics.Contracts;
 using biz.dfch.CS.Abiquo.Client.Authentication;
﻿using biz.dfch.CS.Abiquo.Client.v1.Model;
﻿using Task = biz.dfch.CS.Abiquo.Client.v1.Model.Task;

namespace biz.dfch.CS.Abiquo.Client
{
    [ContractClassFor(typeof(BaseAbiquoClient))]
    abstract class ContractClassForBaseAbiquoClient : BaseAbiquoClient
    {
        #region Login

        public override bool Login(string abiquoApiBaseUri, IAuthenticationInformation authenticationInformation)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(abiquoApiBaseUri));
            Contract.Requires(null != authenticationInformation);
            Contract.Ensures(Contract.Result<bool>() == !string.IsNullOrWhiteSpace(this.AbiquoApiBaseUri));
            Contract.Ensures(Contract.Result<bool>() == (null != this.AuthenticationInformation));
            Contract.Ensures(Contract.Result<bool>() == (null != this.CurrentUserInformation));

            return default(bool);
        }

        #endregion Login


        #region Enterprises

        public override Enterprises GetEnterprises()
        {
            Contract.Ensures(null != Contract.Result<Enterprises>());

            return default(Enterprises);
        }

        public override Enterprise GetCurrentEnterprise()
        {
            return default(Enterprise);
        }

        public override Enterprise GetEnterprise(int id)
        {
            Contract.Requires(0 < id);

            return default(Enterprise);
        }

        #endregion Enterprises


        #region Users

        public override UsersWithRoles GetUsersWithRolesOfCurrentEnterprise()
        {
            Contract.Ensures(null != Contract.Result<UsersWithRoles>());

            return default(UsersWithRoles);
        }

        public override UsersWithRoles GetUsersWithRoles(Enterprise enterprise)
        {
            Contract.Requires(null != enterprise);

            return default(UsersWithRoles);
        }

        public override UsersWithRoles GetUsersWithRoles(int enterpriseId)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Ensures(null != Contract.Result<UsersWithRoles>());

            return default(UsersWithRoles);
        }

        public override User GetUserOfCurrentEnterprise(int id)
        {
            Contract.Requires(0 < id);

            return default(User);
        }

        public override User GetUser(Enterprise enterprise, int id)
        {
            Contract.Requires(null != enterprise);

            return default(User);
        }

        public override User GetUser(int enterpriseId, int id)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Requires(0 < id);

            return default(User);
        }

        public override User GetUserInformation()
        {
            Contract.Requires(IsLoggedIn);

            return default(User);
        }

        public override User GetUserInformation(string username)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(username));

            return default(User);
        }

        public override User GetUserInformation(int enterpriseId, string username)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Requires(!string.IsNullOrWhiteSpace(username));

            return default(User);
        }

        public override void SwitchEnterprise(Enterprise enterprise)
        {
            Contract.Requires(null != enterprise);
        }

        public override void SwitchEnterprise(int id)
        {
            Contract.Requires(0 < id);
        }

        #endregion Users


        #region Roles

        public override Roles GetRoles()
        {
            Contract.Ensures(null != Contract.Result<Roles>());

            return default(Roles);
        }

        public override Role GetRole(int id)
        {
            Contract.Requires(0 < id);

            return default(Role);
        }

        #endregion Roles


        #region DataCentersLimits

        public override DataCentersLimits GetDataCentersLimitsOfCurrentEnterprise()
        {
            return default(DataCentersLimits);
        }

        public override DataCentersLimits GetDataCentersLimits(Enterprise enterprise)
        {
            Contract.Requires(null != enterprise);

            return default(DataCentersLimits);
        }

        public override DataCentersLimits GetDataCentersLimits(int enterpriseId)
        {
            Contract.Requires(0 < enterpriseId);

            return default(DataCentersLimits);
        }

        public override DataCenterLimits GetDataCenterLimitsOfCurrentEnterprise(int id)
        {
            Contract.Requires(0 < id);

            return default(DataCenterLimits);
        }

        public override DataCenterLimits GetDataCenterLimits(Enterprise enterprise, int id)
        {
            Contract.Requires(null != enterprise);

            return default(DataCenterLimits);
        }

        public override DataCenterLimits GetDataCenterLimits(int enterpriseId, int id)
        {
            Contract.Requires(0 < enterpriseId);
            Contract.Requires(0 < id);

            return default(DataCenterLimits);
        }

        #endregion DataCentersLimits


        #region VirtualMachines

        public override VirtualMachines GetAllVirtualMachines()
        {
            Contract.Ensures(null != Contract.Result<VirtualMachines>());

            return default(VirtualMachines);
        }

        public override VirtualMachines GetVirtualMachines(VirtualAppliance virtualAppliance)
        {
            Contract.Requires(null != virtualAppliance);

            return default(VirtualMachines);
        }

        public override VirtualMachines GetVirtualMachines(int virtualDataCenterId, int virtualApplianceId)
        {
            Contract.Requires(0 < virtualDataCenterId);
            Contract.Requires(0 < virtualApplianceId);
            Contract.Ensures(null != Contract.Result<VirtualMachines>());

            return default(VirtualMachines);
        }

        public override VirtualMachine GetVirtualMachine(int virtualDataCenterId, int virtualApplianceId, int id)
{'fraction_non_alphanumeric': 0.07967313585291114, 'fraction_numerical': 0.0037715093894869177, 'mean_word_length': 2.300829875518672, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 21, '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': '6720375', 'n_tokens_mistral': 3265, 'n_tokens_neox': 3111, 'n_words': 720}